aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
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
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')
-rw-r--r--lisp/cedet/semantic/symref.el2
-rw-r--r--lisp/eshell/em-unix.el11
-rw-r--r--lisp/eshell/esh-var.el2
-rw-r--r--lisp/progmodes/ada-xref.el4
-rw-r--r--lisp/textmodes/ispell.el14
5 files changed, 17 insertions, 16 deletions
diff --git a/lisp/cedet/semantic/symref.el b/lisp/cedet/semantic/symref.el
index 516a4f30414..8b3196a3982 100644
--- a/lisp/cedet/semantic/symref.el
+++ b/lisp/cedet/semantic/symref.el
@@ -271,7 +271,7 @@ Optional SCOPE specifies which file set to search. Defaults to `project'.
271Refers to `semantic-symref-tool', to determine the reference tool to use 271Refers to `semantic-symref-tool', to determine the reference tool to use
272for the current buffer. 272for the current buffer.
273Returns an object of class `semantic-symref-result'." 273Returns an object of class `semantic-symref-result'."
274 (interactive "sEgrep style Regexp: ") 274 (interactive "sGrep -E style Regexp: ")
275 (let* ((inst (semantic-symref-instantiate 275 (let* ((inst (semantic-symref-instantiate
276 :searchfor text 276 :searchfor text
277 :searchtype 'regexp 277 :searchtype 'regexp
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)
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index 8518163a1b7..b3248d3f13b 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -174,7 +174,7 @@ If GVD is not the debugger used, nothing happens."
174 :type 'boolean :group 'ada) 174 :type 'boolean :group 'ada)
175 175
176(defcustom ada-xref-search-with-egrep t 176(defcustom ada-xref-search-with-egrep t
177 "If non-nil, use egrep to find the possible declarations for an entity. 177 "If non-nil, use grep -E to find the possible declarations for an entity.
178This alternate method is used when the exact location was not found in the 178This alternate method is used when the exact location was not found in the
179information provided by GNAT. However, it might be expensive if you have a lot 179information provided by GNAT. However, it might be expensive if you have a lot
180of sources, since it will search in all the files in your project." 180of sources, since it will search in all the files in your project."
@@ -2013,7 +2013,7 @@ This function should be used when the standard algorithm that parses the
2013exist. 2013exist.
2014This function attempts to find the possible declarations for the identifier 2014This function attempts to find the possible declarations for the identifier
2015anywhere in the object path. 2015anywhere in the object path.
2016This command requires the external `egrep' program to be available. 2016This command requires the external `grep' program to be available.
2017 2017
2018This works well when one is using an external library and wants to find 2018This works well when one is using an external library and wants to find
2019the declaration and documentation of the subprograms one is using." 2019the declaration and documentation of the subprograms one is using."
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 284fea4acd5..0ed6c689429 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -396,19 +396,15 @@ Always stores Fcc copy of message when nil."
396 396
397 397
398(defcustom ispell-grep-command 398(defcustom ispell-grep-command
399 ;; MS-Windows/MS-DOS have `egrep' as a Unix shell script, so they 399 "grep"
400 ;; cannot invoke it. Use "grep -E" instead (see ispell-grep-options
401 ;; below).
402 (if (memq system-type '(windows-nt ms-dos)) "grep" "egrep")
403 "Name of the grep command for search processes." 400 "Name of the grep command for search processes."
404 :type 'string 401 :type 'string
405 :group 'ispell) 402 :group 'ispell)
406 403
407(defcustom ispell-grep-options 404(defcustom ispell-grep-options
408 (if (memq system-type '(windows-nt ms-dos)) "-Ei" "-i") 405 "-Ei"
409 "String of options to use when running the program in `ispell-grep-command'. 406 "String of options to use when running the program in `ispell-grep-command'.
410Should probably be \"-i\" or \"-e\". 407Should probably be \"-Ei\"."
411Some machines (like the NeXT) don't support \"-i\"."
412 :type 'string 408 :type 'string
413 :group 'ispell) 409 :group 'ispell)
414 410
@@ -2678,8 +2674,8 @@ SPC: Accept word this time.
2678(defun ispell-lookup-words (word &optional lookup-dict) 2674(defun ispell-lookup-words (word &optional lookup-dict)
2679 "Look up WORD in optional word-list dictionary LOOKUP-DICT. 2675 "Look up WORD in optional word-list dictionary LOOKUP-DICT.
2680A `*' serves as a wild card. If no wild cards, `look' is used if it exists. 2676A `*' serves as a wild card. If no wild cards, `look' is used if it exists.
2681Otherwise the variable `ispell-grep-command' contains the command used to 2677Otherwise the variable `ispell-grep-command' contains the command
2682search for the words (usually egrep). 2678\(usually \"grep\") used to search for the words.
2683 2679
2684Optional second argument contains the dictionary to use; the default is 2680Optional second argument contains the dictionary to use; the default is
2685`ispell-alternate-dictionary', overridden by `ispell-complete-word-dict' 2681`ispell-alternate-dictionary', overridden by `ispell-complete-word-dict'