From: Jari Aalto <jari.aalto@cante.net>
Cc: emacs-devel@gnu.org
Subject: Re: compile.el::grep-program - should it use egrep instead of grep?
Date: Thu, 08 Sep 2005 08:54:32 +0300 [thread overview]
Message-ID: <E1EDFMm-0000IT-4z@cante> (raw)
In-Reply-To: r7c1fjdi.fsf@cante.net
| There is
|
| (defvar grep-program "egrep" ...)
|
| in compile.el,
|
| No there isn't. The default value of grep-program is "grep" or "zgrep".
| What version are you looking at?
21.3 + 21.4[1] use plain grep [2] in compile.el. The zgrep has
been commented out.
| but in some systems the grep is the old one, which does
| not provide the extended syntax. Would it be possible to set this by
| default to 'egrep'?
|
| Sorry, no. Emacs's regexp syntax is based on the grep syntax rather
| than the egrep syntax.
I was referring to the calls of the external processes:
M-x grep RET
Run grep (like this): grep -n -e .....
or
M-x find-grep-dired RET
...
find . \( -type f -exec grep -q "*xyz" {} \; \) -exec ls -ld {} \;
or
M-x grep-find
Run find (like this): find . -type f -print0 | xargs -0 -e grep -n -e
The use of grep(1) command in all of there is not optimal. So my question
was wheather there were any *nix OS that did not define egrep(1) and thus
would prevent using "egrep" as a default value. The problem with standard
grep(1) is that is does not allow extended syntax:
.... grep -n '(this|that)'
E.g in SunOS. The standard "grep" isn't very useful default
for serious searching.
Jari
------------------------------
[1]
(emacs-version)
"GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2005-03-17 on trouble, modified by Debian"
[1]
(defvar grep-program
;; 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.")
next prev parent reply other threads:[~2005-09-08 5:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-07 7:05 compile.el::grep-program - should it use egrep instead of grep? Jari Aalto
2005-09-08 2:41 ` Richard M. Stallman
2005-09-08 5:54 ` Jari Aalto [this message]
2005-09-08 17:55 ` Richard M. Stallman
2005-09-12 14:31 ` Jari Aalto
2005-09-12 15:07 ` Andreas Schwab
2005-09-12 15:58 ` Jari Aalto
2005-09-12 16:30 ` Andreas Schwab
2005-09-12 18:08 ` Stefan Monnier
2005-09-13 15:54 ` Richard M. Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1EDFMm-0000IT-4z@cante \
--to=jari.aalto@cante.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.