]> git.eshelyaron.com Git - emacs.git/commitdiff
(Man-bgproc-sentinel): When "-k foo" produces no output show error
authorKevin Ryde <user42@zip.com.au>
Sat, 26 Dec 2009 22:00:47 +0000 (22:00 +0000)
committerKevin Ryde <user42@zip.com.au>
Sat, 26 Dec 2009 22:00:47 +0000 (22:00 +0000)
"no matches" rather than "Can't find manpage", as the latter reads
like -k was interpreted as a page name, which is not so.  (My
bug#5431.)

lisp/man.el

index a5d62f3fb817cd9b0bff3fa7a271217ba1fb1107..b34ca7687077d74c89763ee75d15d947aad48f92 100644 (file)
@@ -1197,6 +1197,18 @@ manpage command."
                                                  (progn
                                                    (end-of-line) (point)))
                       delete-buff t))
+
+               ;; "-k foo", successful exit, but no output (from man-db)
+               ;; ENHANCE-ME: share the check for -k with
+               ;; `Man-highlight-references'.  The \\s- bits here are
+               ;; meant to allow for multiple options with -k among them.
+               ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments)
+                     (eq (process-status process) 'exit)
+                     (= (process-exit-status process) 0)
+                     (= (point-min) (point-max)))
+                (setq err-mess (format "%s: no matches" Man-arguments)
+                      delete-buff t))
+
                ((or (stringp process)
                     (not (and (eq (process-status process) 'exit)
                               (= (process-exit-status process) 0))))