]> code.delx.au - gnu-emacs/blobdiff - lisp/info.el
(lm-font-lock-face-O, lm-font-lock-face-X)
[gnu-emacs] / lisp / info.el
index 78c2193f005243b861d913ef976b768b105b0d85..16e19c56757bf4c09f0141b766a0f0e0aee507fd 100644 (file)
@@ -259,30 +259,31 @@ Do the right thing if the file has been compressed or zipped."
                       (expand-file-name "info/" installation-directory)))
          alternative)
       (setq Info-directory-list
-           (if path
-               (split-string path (regexp-quote path-separator))
-             (if (and sibling (file-exists-p sibling))
-                 ;; Uninstalled, Emacs builddir != srcdir.
-                 (setq alternative sibling)
-               ;; Uninstalled, builddir == srcdir
-               (setq alternative source))
-             (if (or (member alternative Info-default-directory-list)
-                     ;; On DOS/NT, we use movable executables always,
-                     ;; and we must always find the Info dir at run time.
-                     (if (memq system-type '(ms-dos windows-nt))
-                         nil
-                       ;; Use invocation-directory for Info
-                       ;; only if we used it for exec-directory also.
-                       (not (string= exec-directory
-                                     (expand-file-name "lib-src/"
-                                                       installation-directory))))
-                     (not (file-exists-p alternative)))
-                 Info-default-directory-list
-               ;; `alternative' contains the Info files that came with this
-               ;; version, so we should look there first.  `Info-insert-dir'
-               ;; currently expects to find `alternative' first on the list.
-               (cons alternative
-                     (reverse (cdr (reverse Info-default-directory-list))))))))))
+           (prune-directory-list
+            (if path
+                (split-string path (regexp-quote path-separator))
+              (if (and sibling (file-exists-p sibling))
+                  ;; Uninstalled, Emacs builddir != srcdir.
+                  (setq alternative sibling)
+                ;; Uninstalled, builddir == srcdir
+                (setq alternative source))
+              (if (or (member alternative Info-default-directory-list)
+                      ;; On DOS/NT, we use movable executables always,
+                      ;; and we must always find the Info dir at run time.
+                      (if (memq system-type '(ms-dos windows-nt))
+                          nil
+                        ;; Use invocation-directory for Info
+                        ;; only if we used it for exec-directory also.
+                        (not (string= exec-directory
+                                      (expand-file-name "lib-src/"
+                                                        installation-directory))))
+                      (not (file-exists-p alternative)))
+                  Info-default-directory-list
+                ;; `alternative' contains the Info files that came with this
+                ;; version, so we should look there first.  `Info-insert-dir'
+                ;; currently expects to find `alternative' first on the list.
+                (cons alternative
+                      (reverse (cdr (reverse Info-default-directory-list)))))))))))
 
 ;;;###autoload
 (defun info-other-window (&optional file)
@@ -1008,16 +1009,17 @@ If FORK is a string, it is the name to use for the new buffer."
          (setq hl nil))                ;terminate the while at next iter
       (setq hl (cdr hl)))))
 \f
-(defvar Info-last-search nil
-  "Default regexp for \\<Info-mode-map>\\[Info-search] command to search for.")
+(defvar Info-search-history nil
+  "The history list for `Info-search'.")
 
 (defun Info-search (regexp)
   "Search for REGEXP, starting from point, and select node it's found in."
-  (interactive "sSearch (regexp): ")
-  (if transient-mark-mode (deactivate-mark))
-  (if (equal regexp "")
-      (setq regexp Info-last-search)
-    (setq Info-last-search regexp))
+  (interactive (list (read-string "Regexp search: "
+                                 nil 'Info-search-history)))
+  (when transient-mark-mode
+    (deactivate-mark))
+  (when (equal regexp "")
+    (setq regexp (car Info-search-history)))
   (when regexp
     (let ((found ()) current
          (onode Info-current-node)
@@ -1917,37 +1919,38 @@ If no reference to follow, moves to the next node, or up if none."
       (Info-extract-pointer item)
     (error nil)))
 
-(easy-menu-define Info-mode-menu Info-mode-map
-                 "Menu for info files."
-                 '("Info"
-                   ["Up" Info-up (Info-check-pointer "up")
-                    :help "Go up in the Info tree"]
-                   ["Next" Info-next (Info-check-pointer "next")
-                    :help "Go to the next node"]
-                   ["Previous" Info-prev (Info-check-pointer "prev[ious]*")
-                    :help "Go to the previous node"]
-                   ["Backward" Info-backward-node t
-                    :help "Go backward one node, considering all as a sequence"]
-                   ["Forward" Info-forward-node t
-                    :help "Go forward one node, considering all as a sequence"]
-                   ["Top" Info-top-node t
-                    :help "Go to top node of file"]
-                   ["Final node" Info-final-node t
-                    :help "Go to final node in this file"]
-                   ("Menu item" ["You should never see this" report-emacs-bug t])
-                   ("Reference" ["You should never see this" report-emacs-bug t])
-                   ["Search..." Info-search t
-                    :help "Search for regular expression in this Info file"]
-                   ["Goto node..." Info-goto-node t
-                    :help "Go to a named node]"]
-                   ["Last" Info-last Info-history
-                    :help "Go to the last node you were at"]
-                   ("Index..."
-                    ["Lookup a String" Info-index t
-                     :help "Look for a string in the index items"]
-                    ["Next Matching Item" Info-index-next t
-                     :help "Look for another occurrence of previous item"])
-                   ["Exit" Info-exit t]))
+(easy-menu-define
+ Info-mode-menu Info-mode-map
+ "Menu for info files."
+ '("Info"
+   ["Up" Info-up :active (Info-check-pointer "up")
+    :help "Go up in the Info tree"]
+   ["Next" Info-next :active (Info-check-pointer "next")
+    :help "Go to the next node"]
+   ["Previous" Info-prev :active (Info-check-pointer "prev[ious]*")
+    :help "Go to the previous node"]
+   ["Backward" Info-backward-node
+    :help "Go backward one node, considering all as a sequence"]
+   ["Forward" Info-forward-node
+    :help "Go forward one node, considering all as a sequence"]
+   ["Top" Info-top-node
+    :help "Go to top node of file"]
+   ["Final Node" Info-final-node
+    :help "Go to final node in this file"]
+   ("Menu Item" ["You should never see this" report-emacs-bug t])
+   ("Reference" ["You should never see this" report-emacs-bug t])
+   ["Search..." Info-search
+    :help "Search for regular expression in this Info file"]
+   ["Goto Node..." Info-goto-node
+    :help "Go to a named node"]
+   ["Last" Info-last Info-history
+    :help "Go to the last node you were at"]
+   ("Index..."
+    ["Lookup a String" Info-index
+     :help "Look for a string in the index items"]
+    ["Next Matching Item" Info-index-next
+     :help "Look for another occurrence of previous item"])
+   ["Exit" Info-exit t]))
 
 (defvar Info-menu-last-node nil)
 ;; Last node the menu was created for.
@@ -1980,7 +1983,7 @@ If no reference to follow, moves to the next node, or up if none."
              (setq entries (cons ["Other..." Info-menu t] entries)))
          (or entries
              (setq entries (list ["No menu" nil nil])))
-         (easy-menu-change '("Info") "Menu item" (nreverse entries)))
+         (easy-menu-change '("Info") "Menu Item" (nreverse entries)))
        ;; Update reference menu.  Code stolen from `Info-follow-reference'.
        (let ((items nil)
              str i entries current
@@ -2256,7 +2259,7 @@ Interactively, if the binding is `execute-extended-command', a command is read.
 The command is found by looking up in Emacs manual's Command Index
 or in another manual found via COMMAND's `info-file' property or
 the variable `Info-file-list-for-emacs'."
-  (interactive "kFind documentation for key:")
+  (interactive "kFind documentation for key: ")
   (let ((command (key-binding key)))
     (cond ((null command)
           (message "%s is undefined" (key-description key)))
@@ -2282,15 +2285,6 @@ the variable `Info-file-list-for-emacs'."
   "Face for Info titles at level 3."
   :group 'info)
 
-(defcustom Info-title-face-alist
-  '((?* (face (variable-pitch bold) display (height (+ 4))))
-    (?= (face (variable-pitch bold) display (height (+ 3))))
-    (?- (face (variable-pitch bold) display (height (+ 2)))))
-  "*Alist of face or list of faces to use for pseudo-underlined titles.
-The alist key is the character the title is underlined with (?*, ?= or ?-)."
-  :type '(repeat (list character face face))
-  :group 'info)
-
 (defun Info-fontify-node ()
   (save-excursion
     (let ((buffer-read-only nil)