POSIX marked egrep and fgrep as legacy apps in SUSv2 (1997) and
withdrew them in SUSv3 (2001), and these days grep -E and grep -F
are probably more portable.
* lib-src/etags.c (main):
* lisp/eshell/em-unix.el (eshell-grep, eshell/egrep)
(eshell/fgrep):
* lisp/cedet/semantic/symref.el (semantic-symref-find-text):
* lisp/eshell/esh-var.el (eshell-apply-indices):
* lisp/progmodes/ada-xref.el (ada-xref-search-with-egrep)
(ada-find-in-src-path):
* lisp/textmodes/ispell.el (ispell-grep-command):
(ispell-lookup-words):
Use or document grep -E and grep -F instead of egrep and fgrep.
* lisp/textmodes/ispell.el (ispell-grep-options):
Use -Ei on all platforms, not just MS-Windows.
{
char *cmd =
xmalloc (strlen (tagfile) + whatlen_max +
{
char *cmd =
xmalloc (strlen (tagfile) + whatlen_max +
- sizeof "mv..OTAGS;fgrep -v '\t\t' OTAGS >;rm OTAGS");
+ sizeof "mv..OTAGS;grep -Fv '\t\t' OTAGS >;rm OTAGS");
for (i = 0; i < current_arg; ++i)
{
switch (argbuffer[i].arg_type)
for (i = 0; i < current_arg; ++i)
{
switch (argbuffer[i].arg_type)
}
char *z = stpcpy (cmd, "mv ");
z = stpcpy (z, tagfile);
}
char *z = stpcpy (cmd, "mv ");
z = stpcpy (z, tagfile);
- z = stpcpy (z, " OTAGS;fgrep -v '\t");
+ z = stpcpy (z, " OTAGS;grep -Fv '\t");
z = stpcpy (z, argbuffer[i].what);
z = stpcpy (z, "\t' OTAGS >");
z = stpcpy (z, tagfile);
z = stpcpy (z, argbuffer[i].what);
z = stpcpy (z, "\t' OTAGS >");
z = stpcpy (z, tagfile);
Refers to `semantic-symref-tool', to determine the reference tool to use
for the current buffer.
Returns an object of class `semantic-symref-result'."
Refers to `semantic-symref-tool', to determine the reference tool to use
for the current buffer.
Returns an object of class `semantic-symref-result'."
- (interactive "sEgrep style Regexp: ")
+ (interactive "sGrep -E style Regexp: ")
(let* ((inst (semantic-symref-instantiate
:searchfor text
:searchtype 'regexp
(let* ((inst (semantic-symref-instantiate
:searchfor text
:searchtype 'regexp
(cmd (progn
(set-text-properties 0 (length args)
'(invisible t) args)
(cmd (progn
(set-text-properties 0 (length args)
'(invisible t) args)
- (format "%s -n %s" command args)))
+ (format "%s -n %s"
+ (pcase command
+ ("egrep" "grep -E")
+ ("fgrep" "grep -F")
+ (x x))
+ args)))
compilation-scroll-output)
(grep cmd)))))
compilation-scroll-output)
(grep cmd)))))
(eshell-grep "grep" args t))
(defun eshell/egrep (&rest args)
(eshell-grep "grep" args t))
(defun eshell/egrep (&rest args)
- "Use Emacs grep facility instead of calling external egrep."
+ "Use Emacs grep facility instead of calling external grep -E."
(eshell-grep "egrep" args t))
(defun eshell/fgrep (&rest args)
(eshell-grep "egrep" args t))
(defun eshell/fgrep (&rest args)
- "Use Emacs grep facility instead of calling external fgrep."
+ "Use Emacs grep facility instead of calling external grep -F."
(eshell-grep "fgrep" args t))
(defun eshell/agrep (&rest args)
(eshell-grep "fgrep" args t))
(defun eshell/agrep (&rest args)
For example, to retrieve the second element of a user's record in
'/etc/passwd', the variable reference would look like:
For example, to retrieve the second element of a user's record in
'/etc/passwd', the variable reference would look like:
- ${egrep johnw /etc/passwd}[: 2]"
+ ${grep johnw /etc/passwd}[: 2]"
(while indices
(let ((refs (car indices)))
(when (stringp value)
(while indices
(let ((refs (car indices)))
(when (stringp value)
:type 'boolean :group 'ada)
(defcustom ada-xref-search-with-egrep t
:type 'boolean :group 'ada)
(defcustom ada-xref-search-with-egrep t
- "If non-nil, use egrep to find the possible declarations for an entity.
+ "If non-nil, use grep -E to find the possible declarations for an entity.
This alternate method is used when the exact location was not found in the
information provided by GNAT. However, it might be expensive if you have a lot
of sources, since it will search in all the files in your project."
This alternate method is used when the exact location was not found in the
information provided by GNAT. However, it might be expensive if you have a lot
of sources, since it will search in all the files in your project."
exist.
This function attempts to find the possible declarations for the identifier
anywhere in the object path.
exist.
This function attempts to find the possible declarations for the identifier
anywhere in the object path.
-This command requires the external `egrep' program to be available.
+This command requires the external `grep' program to be available.
This works well when one is using an external library and wants to find
the declaration and documentation of the subprograms one is using."
This works well when one is using an external library and wants to find
the declaration and documentation of the subprograms one is using."
(defcustom ispell-grep-command
(defcustom ispell-grep-command
- ;; MS-Windows/MS-DOS have `egrep' as a Unix shell script, so they
- ;; cannot invoke it. Use "grep -E" instead (see ispell-grep-options
- ;; below).
- (if (memq system-type '(windows-nt ms-dos)) "grep" "egrep")
"Name of the grep command for search processes."
:type 'string
:group 'ispell)
(defcustom ispell-grep-options
"Name of the grep command for search processes."
:type 'string
:group 'ispell)
(defcustom ispell-grep-options
- (if (memq system-type '(windows-nt ms-dos)) "-Ei" "-i")
"String of options to use when running the program in `ispell-grep-command'.
"String of options to use when running the program in `ispell-grep-command'.
-Should probably be \"-i\" or \"-e\".
-Some machines (like the NeXT) don't support \"-i\"."
+Should probably be \"-Ei\"."
:type 'string
:group 'ispell)
:type 'string
:group 'ispell)
(defun ispell-lookup-words (word &optional lookup-dict)
"Look up WORD in optional word-list dictionary LOOKUP-DICT.
A `*' serves as a wild card. If no wild cards, `look' is used if it exists.
(defun ispell-lookup-words (word &optional lookup-dict)
"Look up WORD in optional word-list dictionary LOOKUP-DICT.
A `*' serves as a wild card. If no wild cards, `look' is used if it exists.
-Otherwise the variable `ispell-grep-command' contains the command used to
-search for the words (usually egrep).
+Otherwise the variable `ispell-grep-command' contains the command
+\(usually \"grep\") used to search for the words.
Optional second argument contains the dictionary to use; the default is
`ispell-alternate-dictionary', overridden by `ispell-complete-word-dict'
Optional second argument contains the dictionary to use; the default is
`ispell-alternate-dictionary', overridden by `ispell-complete-word-dict'