unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5928: grep.el: Incorrect processing of host-default settings in grep-compute-defaults
@ 2010-04-11 16:59 Christoph
  2010-04-14 15:34 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph @ 2010-04-11 16:59 UTC (permalink / raw)
  To: 5928

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










^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#5928: grep.el: Incorrect processing of host-default settings in grep-compute-defaults
  2010-04-11 16:59 bug#5928: grep.el: Incorrect processing of host-default settings in grep-compute-defaults Christoph
@ 2010-04-14 15:34 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2010-04-14 15:34 UTC (permalink / raw)
  To: Christoph; +Cc: 5928

> 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:

Thanks.  The patch looks clearly correct, and I've committed it.






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-14 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-11 16:59 bug#5928: grep.el: Incorrect processing of host-default settings in grep-compute-defaults Christoph
2010-04-14 15:34 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).