emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105528: * lisp/progmodes/grep.el (gr


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105528: * lisp/progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'
Date: Mon, 22 Aug 2011 12:54:38 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105528
fixes bug(s): http://debbugs.gnu.org/9226
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Mon 2011-08-22 12:54:38 +0300
message:
  * lisp/progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'
  to check for empty output.
modified:
  lisp/ChangeLog
  lisp/progmodes/grep.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-08-22 03:38:30 +0000
+++ b/lisp/ChangeLog    2011-08-22 09:54:38 +0000
@@ -1,3 +1,8 @@
+2011-08-22  Juri Linkov  <address@hidden>
+
+       * progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'
+       to check for empty output (bug#9226).
+
 2011-08-22  Chong Yidong  <address@hidden>
 
        * progmodes/scheme.el (scheme-mode-syntax-table): Don't use

=== modified file 'lisp/progmodes/grep.el'
--- a/lisp/progmodes/grep.el    2011-08-17 17:11:49 +0000
+++ b/lisp/progmodes/grep.el    2011-08-22 09:54:38 +0000
@@ -463,9 +463,12 @@
   (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"))
                   (t
                    (cons msg code)))


reply via email to

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