# HG changeset patch # User Kevin Ryde # Date 1261864847 0 # Node ID 11605ddedbe6fdb52d2491f1338f355203795777 # Parent bef8989591e3f5cf364ae998395eba7f0fa152f6 (Man-bgproc-sentinel): When "-k foo" produces no output show error "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.) diff -r bef8989591e3 -r 11605ddedbe6 lisp/man.el --- a/lisp/man.el Sat Dec 26 21:32:51 2009 +0000 +++ b/lisp/man.el Sat Dec 26 22:00:47 2009 +0000 @@ -1197,6 +1197,18 @@ (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))))