unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "(setq grep-find-command ...)" broken, no documented replacement
@ 2007-07-22 16:47 Bob Rogers
  2007-07-22 20:05 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Rogers @ 2007-07-22 16:47 UTC (permalink / raw)
  To: emacs-devel

   Some time in the last two weeks (between builds from the trunk), my
.emacs customization of grep-find-command stopped working.  I had just
done a setq of grep-find-command:

	(setq grep-find-command
	      (concat "find . -type f "
		      "| grep -Ev '/\\.?#|~$|/TAGS$|/\.svn/|/CVS/|\.patch$' "
		      "| xargs -e grep -n -e "))

But now this does not work.  There appears to be new customization
mechanism in place, but I cannot find any documention for it.

   In particular, the "Grep Searching" Info node does not mention how to
customize this feature from elisp.  Previously, this wasn't a problem;
it was easy enough to stumble onto grep-find-command via M-x apropos, or
by reading the grep-find source, and then it was obvious how to
customize it.  This is no longer true; the grep-find-command variable
still has the following doc string:

	  "The default find command for \\[grep-find].
	The default value of this variable is set up by `grep-compute-defaults';
	call that function before using this variable in your program."

This is misleading at best; even setting grep-find-command *before*
grep-compute-defaults does not work.  The word "default" in the phrase
"The default value ... is set ..." makes it sound like it ought to be
otherwise.

   So, by reading the code for the new customization mechanism, I
discovered that I now have to do something like this:

	(grep-compute-defaults)
	(rplaca (cdr (assoc 'grep-find-command
			    (assoc 'localhost grep-host-defaults-alist)))
		(concat "find . -type f "
			"| grep -Ev '/\\.?#|~$|/TAGS$|/\.svn/|/CVS/|\.patch$' "
			"| xargs -e grep -n -e "))

But I hope this is not TRT; to me it looks terribly fragile.

   So, could we please restore the original (and straightforward) elisp
customization mechanism back to workingness?  At the very least, the new
customization mechanism needs to be better documented and/or the
documentation for it easier to find.

   And perhaps we ought to have a NEWS entry for the new customization
mechanism?

   TIA,

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

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

* Re: "(setq grep-find-command ...)" broken, no documented replacement
  2007-07-22 16:47 "(setq grep-find-command ...)" broken, no documented replacement Bob Rogers
@ 2007-07-22 20:05 ` Michael Albinus
  2007-07-22 23:04   ` Bob Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2007-07-22 20:05 UTC (permalink / raw)
  To: Bob Rogers; +Cc: emacs-devel

Bob Rogers <rogers-emacs@rgrjr.dyndns.org> writes:

>    Some time in the last two weeks (between builds from the trunk), my
> .emacs customization of grep-find-command stopped working.  I had just
> done a setq of grep-find-command:
>
> 	(setq grep-find-command
> 	      (concat "find . -type f "
> 		      "| grep -Ev '/\\.?#|~$|/TAGS$|/\.svn/|/CVS/|\.patch$' "
> 		      "| xargs -e grep -n -e "))
>
> But now this does not work.  There appears to be new customization
> mechanism in place, but I cannot find any documention for it.

Should be fixed now.

There is indeed an extended mechanism now, which allows you to apply
grep-find also on remote hosts. But the default setting shall be the
same.

Maybe it could be extended for different default customizations on
different hosts, but I don't know whether such fine granular settings
are needed.

>    TIA,

Best regards, Michael.

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

* Re: "(setq grep-find-command ...)" broken, no documented replacement
  2007-07-22 20:05 ` Michael Albinus
@ 2007-07-22 23:04   ` Bob Rogers
  2007-07-24 14:53     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Rogers @ 2007-07-22 23:04 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

   From: Michael Albinus <michael.albinus@gmx.de>
   Date: Sun, 22 Jul 2007 22:05:54 +0200

   Bob Rogers <rogers-emacs@rgrjr.dyndns.org> writes:

   >    Some time in the last two weeks (between builds from the trunk), my
   > .emacs customization of grep-find-command stopped working . . .
   > 
   > There appears to be new customization
   > mechanism in place, but I cannot find any documention for it.

   Should be fixed now.

It is indeed; thank you.

   There is indeed an extended mechanism now, which allows you to apply
   grep-find also on remote hosts. But the default setting shall be the
   same.

   Maybe it could be extended for different default customizations on
   different hosts, but I don't know whether such fine granular settings
   are needed.

Then I don't understand what you are trying to accomplish.  What is the
point of recording grep-* settings for different hosts if they cannot be
customized differently?  Wouldn't they all have the same values?

   Again, it would really help to see some documentation on how all of
this is supposed to work . . .

					-- Bob

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

* Re: "(setq grep-find-command ...)" broken, no documented replacement
  2007-07-22 23:04   ` Bob Rogers
@ 2007-07-24 14:53     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2007-07-24 14:53 UTC (permalink / raw)
  To: Bob Rogers; +Cc: emacs-devel

Bob Rogers <rogers-emacs@rgrjr.dyndns.org> writes:

>    Maybe it could be extended for different default customizations on
>    different hosts, but I don't know whether such fine granular settings
>    are needed.
>
> Then I don't understand what you are trying to accomplish.  What is the
> point of recording grep-* settings for different hosts if they cannot be
> customized differently?  Wouldn't they all have the same values?

`grep-compute-defaults' returns different results for variables like
`grep-command'. In my use case, it is either "grep -nH -e " or "grep
-n -e ", depending on the host.

What I have in mind is to reuse the different values of `grep-command'
in `grep-find-template'. Currently, one can only expand <D>, <X>, <F>,
<C> and <R>.

>    Again, it would really help to see some documentation on how all of
> this is supposed to work . . .

Agreed.

> 					-- Bob

Best regards, Michael.

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

end of thread, other threads:[~2007-07-24 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-22 16:47 "(setq grep-find-command ...)" broken, no documented replacement Bob Rogers
2007-07-22 20:05 ` Michael Albinus
2007-07-22 23:04   ` Bob Rogers
2007-07-24 14:53     ` Michael Albinus

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