summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-05-07 18:40:10 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-05-07 18:40:55 -0700
commite8bda380bb491eba325e78827eb33c4a0abfbdda (patch)
tree78cb41b3b13df6be8688296d76cf57fb23488b2c /lisp/eshell
parent4c175a6af5f7935582208e197105cf67aa1b12bd (diff)
downloademacs-e8bda380bb491eba325e78827eb33c4a0abfbdda.tar.gz
Prefer grep -E/-F to egrep/fgrep
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.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-unix.el11
-rw-r--r--lisp/eshell/esh-var.el2
2 files changed, 9 insertions, 4 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el
index c27c18c52ba..e40dbded60b 100644
--- a/lisp/eshell/em-unix.el
+++ b/lisp/eshell/em-unix.el
@@ -748,7 +748,12 @@ external command."
(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)))))
@@ -757,11 +762,11 @@ external command."
(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)
- "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)
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 7213ad70e84..5915efbac1e 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -530,7 +530,7 @@ Integers imply a direct index, and names, an associate lookup using
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)