emacs-devel
[Top][All Lists]
Advanced

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

"(setq grep-find-command ...)" broken, no documented replacement


From: Bob Rogers
Subject: "(setq grep-find-command ...)" broken, no documented replacement
Date: Sun, 22 Jul 2007 12:47:41 -0400

   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/




reply via email to

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