changeset 106649:11605ddedbe6

(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.)
author Kevin Ryde <user42@zip.com.au>
date Sat, 26 Dec 2009 22:00:47 +0000
parents bef8989591e3
children 8caf4b7cfaab
files lisp/man.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))))