2000-05-31 Karl M. Hegbloom <karlheg@debian.org>
[bpt/emacs.git] / lisp / info.el
index 21e32e7..dc9a7b7 100644 (file)
@@ -984,11 +984,21 @@ Bind this in case the user sets it to nil."
 ;; should be called when the node is already narrowed.
 (defun Info-setup-header-line ()
   (goto-char (point-min))
-  (forward-line 1)
-  (set (make-local-variable 'Info-header-line)
-       (buffer-substring (point-min) (1- (point))))
-  (setq header-line-format 'Info-header-line)
-  (narrow-to-region (point) (point-max)))
+  (let* ((case-fold-search t)
+        (header-end (save-excursion (forward-line 1) (1- (point))))
+        ;; If we find neither Next: nor Prev: link, show the entire
+        ;; node header.  Otherwise, don't show the File: and Node:
+        ;; parts, to avoid wasting precious space on information that
+        ;; is available in the mode line.
+        (header-beg (if (re-search-forward
+                         "\\(next\\|prev[ious]*\\): "
+                         header-end t)
+                        (match-beginning 1)
+                      (point))))
+    (set (make-local-variable 'Info-header-line)
+        (buffer-substring header-beg header-end))
+    (setq header-line-format 'Info-header-line)
+    (narrow-to-region (1+ header-end) (point-max))))
 \f
 ;; Go to an info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.
@@ -1097,8 +1107,12 @@ If FORK is a string, it is the name to use for the new buffer."
 
 (defun Info-search (regexp)
   "Search for REGEXP, starting from point, and select node it's found in."
-  (interactive (list (read-string "Regexp search: "
-                                 nil 'Info-search-history)))
+  (interactive (list (read-string
+                     (if Info-search-history
+                         (format "Regexp search (default `%s'): "
+                                 (car Info-search-history))
+                       "Regexp search: ")
+                     nil 'Info-search-history)))
   (when transient-mark-mode
     (deactivate-mark))
   (when (equal regexp "")
@@ -2369,7 +2383,7 @@ The locations are of the format used in `Info-history', i.e.
 ;;;###autoload
 (defun Info-goto-emacs-command-node (command)
   "Go to the Info node in the Emacs manual for command COMMAND.
-The command is found by looking up in Emacs manual's Command Index
+The command is found by looking up in Emacs manual's indices
 or in another manual found via COMMAND's `info-file' property or
 the variable `Info-file-list-for-emacs'."
   (interactive "CFind documentation for command: ")
@@ -2405,9 +2419,10 @@ the variable `Info-file-list-for-emacs'."
 
 ;;;###autoload
 (defun Info-goto-emacs-key-command-node (key)
-  "Go to the Info node in the Emacs manual the command bound to KEY, a string.
+  "Go to the node in the Emacs manual which describes the command bound to KEY.
+KEY is a string.
 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
+The command is found by looking up in Emacs manual's indices
 or in another manual found via COMMAND's `info-file' property or
 the variable `Info-file-list-for-emacs'."
   (interactive "kFind documentation for key: ")
@@ -2510,9 +2525,11 @@ the variable `Info-file-list-for-emacs'."
        ;; This is a serious problem for trying to handle multiple
        ;; frame types at once.  We want this text to be invisible
        ;; on frames that can display the font above.
-       (if (memq (framep (selected-frame)) '(x pc w32 mac))
-           (add-text-properties (match-end 1) (match-end 2)
-                                '(invisible t intangible t))))
+       (when (memq (framep (selected-frame)) '(x pc w32 mac))
+         (add-text-properties (match-end 1) (match-end 2)
+                              '(invisible t intangible t))
+         (add-text-properties (1- (match-end 1)) (match-end 2)
+                              '(intangible t))))
       (goto-char (point-min))
       (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t)
        (if (= (char-after (1- (match-beginning 0))) ?\") ; hack