unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* grep-program and grep-command
@ 2007-01-25 16:23 Lennart Borgman (gmail)
  2007-01-26  3:09 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-25 16:23 UTC (permalink / raw)
  To: Emacs Devel

The grep-command is a defcustom, but grep-program is a defvar. 
grep-command is computed by Emacs if its value is nil.

This seems a bit akward to me. It tells the user to customize 
grep-command if things does not work by default. Would it not be better 
if they instead set grep-program and let Emacs compute grep-command?

But since we want them to use customize we then should make grep-program 
into a defcustom. I suggest that grep-program is defined something like 
this (unfinished, and I I have renamed it to grep-program1 just for 
testing):


(defcustom grep-program1
   ;; Currently zgrep has trouble.  It runs egrep instead of grep,
   ;; and it doesn't pass along long options right.
   "grep"
   ;; (if (equal (condition-case nil	; in case "zgrep" isn't in exec-path
   ;; 		 (call-process "zgrep" nil nil nil
   ;; 			       "foo" null-device)
   ;; 	       (error nil))
   ;; 	     1)
   ;;     "zgrep"
   ;;   "grep")
   "The default grep program for `grep-command' and `grep-find-command'.
This variable's value takes effect when `grep-compute-defaults' is called."
   :type 'file
   :set (lambda(sym val)
          (unless (string= grep-command
                           (car (get 'grep-command 'customized-value)))
            (setq grep-command nil))
          ;; Add similar checks above for other computed values that
          ;; depends on this variable ...
          (set-default sym val))
   :group 'grep)

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

* Re: grep-program and grep-command
  2007-01-25 16:23 grep-program and grep-command Lennart Borgman (gmail)
@ 2007-01-26  3:09 ` Richard Stallman
  2007-01-26  8:37   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-01-26  3:09 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: emacs-devel

    The grep-command is a defcustom, but grep-program is a defvar. 
    grep-command is computed by Emacs if its value is nil.

Let's not mess with this.

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

* Re: grep-program and grep-command
  2007-01-26  3:09 ` Richard Stallman
@ 2007-01-26  8:37   ` Lennart Borgman (gmail)
  2007-01-27  0:46     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2007-01-26  8:37 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

Richard Stallman wrote:
>     The grep-command is a defcustom, but grep-program is a defvar. 
>     grep-command is computed by Emacs if its value is nil.
> 
> Let's not mess with this.

This is a problem mostly on w32.  I have seen that users change 
grep-command instead of changing grep-program and therefore gets into 
trouble.

Maybe mention grep-program in the doc string of grep-command?

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

* Re: grep-program and grep-command
  2007-01-26  8:37   ` Lennart Borgman (gmail)
@ 2007-01-27  0:46     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-01-27  0:46 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: emacs-devel

    Maybe mention grep-program in the doc string of grep-command?

Ok, please do that.

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

end of thread, other threads:[~2007-01-27  0:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 16:23 grep-program and grep-command Lennart Borgman (gmail)
2007-01-26  3:09 ` Richard Stallman
2007-01-26  8:37   ` Lennart Borgman (gmail)
2007-01-27  0:46     ` Richard Stallman

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).