emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f0648fe: Make Info completion more robust


From: Lars Ingebrigtsen
Subject: master f0648fe: Make Info completion more robust
Date: Thu, 6 May 2021 05:24:48 -0400 (EDT)

branch: master
commit f0648fef35e1923f477aef44b2d75e41e3d15d92
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make Info completion more robust
    
    * lisp/info.el (Info-build-node-completions): Don't signal an
    error if there are no nodes in the file we're computing
    completions over (bug#47771).
---
 lisp/info.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lisp/info.el b/lisp/info.el
index 67d27c7..2757ed5 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1882,10 +1882,17 @@ the Top node in FILENAME."
       (or (cdr (assoc filename Info-file-completions))
          (with-temp-buffer
            (Info-mode)
-           (Info-goto-node (format "(%s)Top" filename))
-           (Info-build-node-completions-1)
-           (push (cons filename Info-current-file-completions) 
Info-file-completions)
-           Info-current-file-completions))
+            (condition-case nil
+               (Info-goto-node (format "(%s)Top" filename))
+              ;; `Info-goto-node' signals a `user-error' when there
+              ;; are no nodes in the file in question (for instance,
+              ;; if it's not actually an Info file).
+              (user-error nil)
+              (:success
+              (Info-build-node-completions-1)
+              (push (cons filename Info-current-file-completions)
+                     Info-file-completions)
+              Info-current-file-completions))))
     (or Info-current-file-completions
        (Info-build-node-completions-1))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]