Commit 262a1439 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'

to check for empty output.

Fixes: debbugs:9226
parent f13f86fb
2011-08-22 Juri Linkov <>
* progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'
to check for empty output (bug#9226).
2011-08-22 Chong Yidong <>
* progmodes/scheme.el (scheme-mode-syntax-table): Don't use
......@@ -463,9 +463,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
(set (make-local-variable 'compilation-exit-message-function)
(lambda (status code msg)
(if (eq status 'exit)
(cond ((zerop code)
;; This relies on the fact that `compilation-start'
;; sets buffer-modified to nil before running the command,
;; so the buffer is still unmodified if there is no output.
(cond ((and (zerop code) (buffer-modified-p))
'("finished (matches found)\n" . "matched"))
((= code 1)
((or (= code 1) (not (buffer-modified-p)))
'("finished with no matches found\n" . "no match"))
(cons msg code)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment