bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#5928: grep.el: Incorrect processing of host-default settings in grep


From: Christoph
Subject: bug#5928: grep.el: Incorrect processing of host-default settings in grep-compute-defaults
Date: Sun, 11 Apr 2010 10:59:20 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

grep.el, bzr revision 99871, line 515:

(set setting
     (or (cadr (assq setting host-defaults))
         (cadr (assq setting defaults)))))

Value of host-defaults can be nil, e.g. for grep-use-null-device. In this case, cadr returns nil and the other branch of the or is executed, assigning the value from defaults to the setting and effectively discarding the value from host-defaults.

The following patch fixes this issue:

=== modified file 'lisp/progmodes/grep.el'
--- lisp/progmodes/grep.el      2010-01-31 21:47:47 +0000
+++ lisp/progmodes/grep.el      2010-04-08 00:11:28 +0000
@@ -513,8 +513,8 @@
                       grep-find-template grep-find-use-xargs
                       grep-highlight-matches))
       (set setting
-          (or (cadr (assq setting host-defaults))
-              (cadr (assq setting defaults)))))
+          (cadr (or (assq setting host-defaults)
+                    (assq setting defaults)))))

     (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
       (setq grep-use-null-device










reply via email to

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