diff options
| author | Lars Ingebrigtsen | 2021-05-06 11:24:39 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-05-06 11:24:39 +0200 |
| commit | f0648fef35e1923f477aef44b2d75e41e3d15d92 (patch) | |
| tree | 183c77d64ede18f761644f7dec4b0b8e34c5ed73 | |
| parent | b61c828ea37f6d875f9c2672a262482af5efedb4 (diff) | |
| download | emacs-f0648fef35e1923f477aef44b2d75e41e3d15d92.tar.gz emacs-f0648fef35e1923f477aef44b2d75e41e3d15d92.zip | |
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).
| -rw-r--r-- | lisp/info.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/info.el b/lisp/info.el index 67d27c78988..2757ed57826 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1882,10 +1882,17 @@ the Top node in FILENAME." | |||
| 1882 | (or (cdr (assoc filename Info-file-completions)) | 1882 | (or (cdr (assoc filename Info-file-completions)) |
| 1883 | (with-temp-buffer | 1883 | (with-temp-buffer |
| 1884 | (Info-mode) | 1884 | (Info-mode) |
| 1885 | (Info-goto-node (format "(%s)Top" filename)) | 1885 | (condition-case nil |
| 1886 | (Info-build-node-completions-1) | 1886 | (Info-goto-node (format "(%s)Top" filename)) |
| 1887 | (push (cons filename Info-current-file-completions) Info-file-completions) | 1887 | ;; `Info-goto-node' signals a `user-error' when there |
| 1888 | Info-current-file-completions)) | 1888 | ;; are no nodes in the file in question (for instance, |
| 1889 | ;; if it's not actually an Info file). | ||
| 1890 | (user-error nil) | ||
| 1891 | (:success | ||
| 1892 | (Info-build-node-completions-1) | ||
| 1893 | (push (cons filename Info-current-file-completions) | ||
| 1894 | Info-file-completions) | ||
| 1895 | Info-current-file-completions)))) | ||
| 1889 | (or Info-current-file-completions | 1896 | (or Info-current-file-completions |
| 1890 | (Info-build-node-completions-1)))) | 1897 | (Info-build-node-completions-1)))) |
| 1891 | 1898 | ||