aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorPaul Eggert2016-05-07 18:40:10 -0700
committerPaul Eggert2016-05-07 18:40:55 -0700
commite8bda380bb491eba325e78827eb33c4a0abfbdda (patch)
tree78cb41b3b13df6be8688296d76cf57fb23488b2c /lisp/eshell
parent4c175a6af5f7935582208e197105cf67aa1b12bd (diff)
downloademacs-e8bda380bb491eba325e78827eb33c4a0abfbdda.tar.gz
emacs-e8bda380bb491eba325e78827eb33c4a0abfbdda.zip
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."
748 (cmd (progn 748 (cmd (progn
749 (set-text-properties 0 (length args) 749 (set-text-properties 0 (length args)
750 '(invisible t) args) 750 '(invisible t) args)
751 (format "%s -n %s" command args))) 751 (format "%s -n %s"
752 (pcase command
753 ("egrep" "grep -E")
754 ("fgrep" "grep -F")
755 (x x))
756 args)))
752 compilation-scroll-output) 757 compilation-scroll-output)
753 (grep cmd))))) 758 (grep cmd)))))
754 759
@@ -757,11 +762,11 @@ external command."
757 (eshell-grep "grep" args t)) 762 (eshell-grep "grep" args t))
758 763
759(defun eshell/egrep (&rest args) 764(defun eshell/egrep (&rest args)
760 "Use Emacs grep facility instead of calling external egrep." 765 "Use Emacs grep facility instead of calling external grep -E."
761 (eshell-grep "egrep" args t)) 766 (eshell-grep "egrep" args t))
762 767
763(defun eshell/fgrep (&rest args) 768(defun eshell/fgrep (&rest args)
764 "Use Emacs grep facility instead of calling external fgrep." 769 "Use Emacs grep facility instead of calling external grep -F."
765 (eshell-grep "fgrep" args t)) 770 (eshell-grep "fgrep" args t))
766 771
767(defun eshell/agrep (&rest args) 772(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
530For example, to retrieve the second element of a user's record in 530For example, to retrieve the second element of a user's record in
531'/etc/passwd', the variable reference would look like: 531'/etc/passwd', the variable reference would look like:
532 532
533 ${egrep johnw /etc/passwd}[: 2]" 533 ${grep johnw /etc/passwd}[: 2]"
534 (while indices 534 (while indices
535 (let ((refs (car indices))) 535 (let ((refs (car indices)))
536 (when (stringp value) 536 (when (stringp value)