changeset 35240:da44bbe7fde5

(Info-setup-header-line): If the node header includes either Next: or Prev: links, don't show the File: and Node: parts in the header line.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 11 Jan 2001 16:39:49 +0000
parents a4e73c75cbca
children 5d83c58bea03
files lisp/info.el
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Thu Jan 11 16:10:23 2001 +0000
+++ b/lisp/info.el	Thu Jan 11 16:39:49 2001 +0000
@@ -984,11 +984,21 @@
 ;; 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))))
 
 ;; Go to an info node specified with a filename-and-nodename string
 ;; of the sort that is found in pointers in nodes.