changeset 32286:c0b19a2770ca

(Info-goto-node, Info-menu): Doc fix. (Info-mode-menu): Bind beginning-of-buffer, Info-edit (info-tool-bar-map): New variable. (Info-mode): Use it. (Info-edit-map): Define all in defvar. (speedbar-attached-frame): Avoid compiler warning.
author Dave Love <fx@gnu.org>
date Sun, 08 Oct 2000 15:44:36 +0000
parents 4763231809cd
children 9d63959616b7
files lisp/info.el
diffstat 1 files changed, 31 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Sun Oct 08 15:29:52 2000 +0000
+++ b/lisp/info.el	Sun Oct 08 15:44:36 2000 +0000
@@ -963,7 +963,8 @@
 
 (defun Info-goto-node (nodename &optional fork)
   "Go to info node named NAME.  Give just NODENAME or (FILENAME)NODENAME.
-If FORK is non-nil, show the node in a new info buffer.
+If FORK is non-nil (interactively with a prefix arg), show the node in
+a new info buffer.
 If FORK is a string, it is the name to use for the new buffer."
   (interactive (list (Info-read-node-name "Goto node: ") current-prefix-arg))
   (info-initialize)
@@ -1369,7 +1370,10 @@
 
 (defun Info-menu (menu-item &optional fork)
   "Go to node for menu item named (or abbreviated) NAME.
-Completion is allowed, and the menu item point is on is the default."
+Completion is allowed, and the menu item point is on is the default.
+If FORK is non-nil (interactively with a prefix arg), show the node in
+a new info buffer.  If FORK is a string, it is the name to use for the
+new buffer."
   (interactive
    (let ((completions '())
 	 ;; If point is within a menu item, use that item as the default
@@ -1987,6 +1991,8 @@
     :help "Go backward one node, considering all as a sequence"]
    ["Forward" Info-forward-node
     :help "Go forward one node, considering all as a sequence"]
+   ["Beginning" beginning-of-buffer
+    :help "Go to beginning of this node"]
    ["Top" Info-top-node
     :help "Go to top node of file"]
    ["Final Node" Info-final-node
@@ -2004,8 +2010,24 @@
      :help "Look for a string in the index items"]
     ["Next Matching Item" Info-index-next
      :help "Look for another occurrence of previous item"])
+   ["Edit" Info-edit :help "Edit contents of this node"
+    :active Info-enable-edit]
    ["Exit" Info-exit t]))
 
+
+(defvar info-tool-bar-map
+  (if (display-graphic-p)
+      (let ((tool-bar-map (make-sparse-keymap)))
+	(tool-bar-add-item-from-menu 'Info-exit "close" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-prev "left_arrow" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-next "right_arrow" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-up "up_arrow" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-top-node "home" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-index "index" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-goto-node "jump_to" Info-mode-map)
+	(tool-bar-add-item-from-menu 'Info-search "search" Info-mode-map)
+	tool-bar-map)))
+
 (defvar Info-menu-last-node nil)
 ;; Last node the menu was created for.
 ;; Value is a list, (FILE-NAME NODE-NAME).
@@ -2152,6 +2174,7 @@
   (setq Info-tag-table-buffer nil)
   (make-local-variable 'Info-history)
   (make-local-variable 'Info-index-alternatives)
+  (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
   ;; This is for the sake of the invisible text we use handling titles.
   (make-local-variable 'line-move-ignore-invisible)
   (setq line-move-ignore-invisible t)
@@ -2169,12 +2192,11 @@
 	      (with-current-buffer Info-tag-table-buffer
 		(copy-marker (marker-position m))))))))
 
-(defvar Info-edit-map nil
+(defvar Info-edit-map (let ((map (make-sparse-keymap)))
+			(set-keymap-parent map text-mode-map)
+			(define-key map "\C-c\C-c" 'Info-cease-edit)
+			map)
   "Local keymap used within `e' command of Info.")
-(if Info-edit-map
-    nil
-  (setq Info-edit-map (nconc (make-sparse-keymap) text-mode-map))
-  (define-key Info-edit-map "\C-c\C-c" 'Info-cease-edit))
 
 ;; Info-edit mode is suitable only for specially formatted data.
 (put 'Info-edit-mode 'mode-class 'special)
@@ -2493,6 +2515,8 @@
   (speedbar-change-initial-expansion-list "Info")
   )
 
+(eval-when-compile (defvar speedbar-attached-frame))
+
 (defun Info-speedbar-hierarchy-buttons (directory depth &optional node)
   "Display an Info directory hierarchy in speedbar.
 DIRECTORY is the current directory in the attached frame.