From: Eli Zaretskii Date: Thu, 11 Jan 2001 16:41:38 +0000 (+0000) Subject: (Info-setup-header-line): If the node header includes X-Git-Tag: emacs-pretest-21.0.96~345 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6e961dcde2fdad36006f4e17df4b7d41d531cefd;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59e408c7e22..04549011028 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2001-01-11 Eli Zaretskii + + * info.el (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. + 2001-01-11 Gerd Moellmann * comint.el (comint-goto-process-mark): Don't print a message diff --git a/lisp/info.el b/lisp/info.el index a298607785d..dc9a7b7dea9 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -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)))) ;; Go to an info node specified with a filename-and-nodename string ;; of the sort that is found in pointers in nodes.