diff options
author | Juri Linkov <juri@jurta.org> | 2014-01-13 10:04:09 +0200 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2014-01-13 10:04:09 +0200 |
commit | 3c0c4562d178819ee3f82f6876c19d61d281358a (patch) | |
tree | b4919024da5fd00369ba291bcd5fe2e1b190f7bf /lisp/info.el | |
parent | 25a700d0fd5ef89458259ebc5f3c2aa117557c29 (diff) | |
download | emacs-3c0c4562d178819ee3f82f6876c19d61d281358a.tar.gz |
* lisp/info.el (Info-find-file): Go to DIR before displaying the error
about a nonexistent file if no previous Info file is visited.
Use `user-error' instead of `error' for "Info file %s does not exist".
(Info-find-node-2): In case of a nonexistent node in unwind forms
go to the Top node if there is no previous node to revert to.
Fixes: debbugs:16405
Diffstat (limited to 'lisp/info.el')
-rw-r--r-- | lisp/info.el | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/info.el b/lisp/info.el index 74bdef5b050..78e0dda7cf7 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -925,7 +925,10 @@ just return nil (no error)." (setq filename found) (if noerror (setq filename nil) - (error "Info file %s does not exist" filename))) + ;; If there is no previous Info file, go to the directory. + (unless Info-current-file + (Info-directory)) + (user-error "Info file %s does not exist" filename))) filename)))) (defun Info-find-node (filename nodename &optional no-going-back strict-case) @@ -1245,12 +1248,14 @@ is non-nil)." (Info-find-index-name Info-point-loc) (setq Info-point-loc nil)))))) ;; If we did not finish finding the specified node, - ;; go back to the previous one. - (or Info-current-node no-going-back (null Info-history) - (let ((hist (car Info-history))) - (setq Info-history (cdr Info-history)) - (Info-find-node (nth 0 hist) (nth 1 hist) t) - (goto-char (nth 2 hist)))))) + ;; go back to the previous one or to the Top node. + (unless (or Info-current-node no-going-back) + (if Info-history + (let ((hist (car Info-history))) + (setq Info-history (cdr Info-history)) + (Info-find-node (nth 0 hist) (nth 1 hist) t) + (goto-char (nth 2 hist))) + (Info-find-node Info-current-file "Top" t))))) ;; Cache the contents of the (virtual) dir file, once we have merged ;; it for the first time, so we can save time subsequently. |