]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-find-node): Don't record previous node if have none.
authorRichard M. Stallman <rms@gnu.org>
Thu, 5 Jan 2006 16:05:49 +0000 (16:05 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 5 Jan 2006 16:05:49 +0000 (16:05 +0000)
(info): Go to directory only if history is empty.

lisp/info.el

index e3ca18e0edeb8a2b8781aff6a48e8280e3f683e7..386f549d3e23d8fa617c8e96b46ef8c90a3632e1 100644 (file)
@@ -568,8 +568,10 @@ in all the directories in that path."
        (if (and (stringp file-or-node) (string-match "(.*)" file-or-node))
            file-or-node
          (concat "(" file-or-node ")")))
-    (if (zerop (buffer-size))
-        (Info-directory))))
+    (if (and (zerop (buffer-size))
+            (null Info-history))
+       ;; If we just created the Info buffer, go to the directory.
+       (Info-directory))))
 
 ;;;###autoload
 (defun info-emacs-manual ()
@@ -688,11 +690,12 @@ it says do not attempt further (recursive) error recovery."
   (setq filename (Info-find-file filename))
   ;; Go into Info buffer.
   (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
-  ;; Record the node we are leaving.
-  (if (not no-going-back)
-      (setq Info-history
-            (cons (list Info-current-file Info-current-node (point))
-                  Info-history)))
+  ;; Record the node we are leaving, if we were in one.
+  (and (not no-going-back)
+       Info-current-file
+       (setq Info-history
+            (cons (list Info-current-file Info-current-node (point))
+                  Info-history)))
   (Info-find-node-2 filename nodename no-going-back))
 
 ;;;###autoload