emacs-diffs
[Top][All Lists]
Advanced

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

master 9fd9c9c: Make the Man completion code work better if man -k fails


From: Lars Ingebrigtsen
Subject: master 9fd9c9c: Make the Man completion code work better if man -k fails
Date: Fri, 25 Sep 2020 07:39:32 -0400 (EDT)

branch: master
commit 9fd9c9c2c00a95640b32b63dc20041ec6d512f0b
Author: Noam Postavsky <npostavs@users.sourceforge.net>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make the Man completion code work better if man -k fails
    
    * lisp/man.el (Man-completion-table): Check the return code for
    "man -k" and assume it failed if there's a non-zero exit code
    (bug#16722).
---
 lisp/man.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/lisp/man.el b/lisp/man.el
index 5ee60ca..bd55d7e 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -927,15 +927,18 @@ foo(sec)[, bar(sec) [, ...]] [other stuff] - description"
             ;; run differently in Man-getpage-in-background, an error
             ;; here may not necessarily mean that we'll also get an
             ;; error later.
-           (ignore-errors
-             (call-process manual-program nil '(t nil) nil
-                           "-k" (concat (when (or Man-man-k-use-anchor
-                                                  (string-equal prefix ""))
-                                          "^")
-                                        prefix))))
-         (setq table (Man-parse-man-k)))
+            (when (eq 0
+                      (ignore-errors
+                        (call-process
+                         manual-program nil '(t nil) nil
+                         "-k" (concat (when (or Man-man-k-use-anchor
+                                                (string-equal prefix ""))
+                                        "^")
+                                      prefix))))
+              (setq table (Man-parse-man-k)))))
        ;; Cache the table for later reuse.
-       (setq Man-completion-cache (cons prefix table)))
+        (when table
+          (setq Man-completion-cache (cons prefix table))))
       ;; The table may contain false positives since the match is made
       ;; by "man -k" not just on the manpage's name.
       (if section



reply via email to

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