GNU bug report logs - #5928
grep.el: Incorrect processing of host-default settings in grep-compute-defaults

Previous Next

Package: emacs;

Reported by: Christoph <cschol2112 <at> googlemail.com>

Date: Sun, 11 Apr 2010 17:02:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5928 in the body.
You can then email your comments to 5928 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5928; Package emacs. (Sun, 11 Apr 2010 17:02:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph <cschol2112 <at> googlemail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 11 Apr 2010 17:02:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christoph <cschol2112 <at> googlemail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: grep.el: Incorrect processing of host-default settings in
	grep-compute-defaults
Date: Sun, 11 Apr 2010 10:59:20 -0600
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








Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5928; Package emacs. (Wed, 14 Apr 2010 15:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 5928 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Christoph <cschol2112 <at> googlemail.com>
Cc: 5928 <at> debbugs.gnu.org
Subject: Re: grep.el: Incorrect processing of host-default settings in
	grep-compute-defaults
Date: Wed, 14 Apr 2010 11:34:42 -0400
> 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.




bug closed, send any further explanations to Christoph <cschol2112 <at> googlemail.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Wed, 14 Apr 2010 15:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 May 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.