]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-select-node): If Info-use-header-line is nil, set
authorEli Zaretskii <eliz@gnu.org>
Fri, 21 Dec 2001 19:09:21 +0000 (19:09 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 21 Dec 2001 19:09:21 +0000 (19:09 +0000)
header-line-format to nil.
(Info-fontify-node): Don't put a keymap text property on the
heading if we are not going to display the header line.  Remove
any such text properties left over from past visits to this node.

lisp/ChangeLog
lisp/info.el

index 136e76c28143d5208c8e277835bf016e99d6ed06..00eb1f1f577089d4abd699ba1606523c9df3f6aa 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-21  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * info.el (Info-select-node): If Info-use-header-line is nil, set
+       header-line-format to nil.
+       (Info-fontify-node): Don't put a keymap text property on the
+       heading if we are not going to display the header line.  Remove
+       any such text properties left over from past visits to this node.
+
 2001-12-21  Richard M. Stallman  <rms@gnu.org>
 
        * emacs-lisp/easy-mmode.el (define-minor-mode): 
index 1f9644de80b7bfca97c8e231019c5868cab32089..75ba1f1e0cf96607949944c3c33bcb3a74520cd3 100644 (file)
@@ -1000,7 +1000,8 @@ Bind this in case the user sets it to nil."
        (if Info-fontify (Info-fontify-node))
        (if Info-use-header-line
            (Info-setup-header-line)
-         (setq Info-header-line nil))
+         (setq Info-header-line nil)
+         (setq header-line-format nil)) ; so the header line isn't displayed
        (run-hooks 'Info-selection-hook)))))
 
 (defun Info-set-mode-line ()
@@ -2573,15 +2574,24 @@ the variable `Info-file-list-for-emacs'."
                                 'help-echo
                                 (concat "Go to node "
                                         (buffer-substring nbeg nend)))
-             (let ((fun (cdr (assoc tag '(("Prev" . Info-prev)
-                                          ("Next" . Info-next)
-                                          ("Up" . Info-up))))))
-               (when fun
-                 (let ((keymap (make-sparse-keymap)))
-                   (define-key keymap [header-line down-mouse-1] fun)
-                   (define-key keymap [header-line down-mouse-2] fun)
-                   (put-text-property tbeg nend 'local-map keymap))))
-             ))))
+               ;; Don't bind mouse events on the header line if we
+               ;; aren't going to display the header line.
+               (when Info-use-header-line
+                 (let ((fun (cdr (assoc tag '(("Prev" . Info-prev)
+                                              ("Next" . Info-next)
+                                              ("Up" . Info-up))))))
+                   (when fun
+                     (let ((keymap (make-sparse-keymap)))
+                       (define-key keymap [header-line down-mouse-1] fun)
+                       (define-key keymap [header-line down-mouse-2] fun)
+                       (put-text-property tbeg nend 'local-map keymap)))))
+               (if (not Info-use-header-line)
+                   ;; In case they switched Info-use-header-line off
+                   ;; in the middle of an Info session, some text
+                   ;; properties may have been left lying around from
+                   ;; past visits of this node.  Remove them.
+                   (remove-text-properties tbeg nend '(local-map nil)))
+                 ))))
       (goto-char (point-min))
       (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
                                nil t)