diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-11 09:07:16 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-11 09:07:16 -0700 |
commit | 435da5d2955ce35be4785b7d46566ed9b42ea9fb (patch) | |
tree | 581fac64374d0997e53bba0ae3cbd4968fa55121 /lisp/progmodes/grep.el | |
parent | 7c9e6254bbac949aa5493ab1741d2523a7d595b7 (diff) | |
parent | b134c206bc07dbbb9e74b3be2db269c4f1196e40 (diff) | |
download | emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.tar.gz emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.tar.bz2 emacs-435da5d2955ce35be4785b7d46566ed9b42ea9fb.zip |
Merge from origin/emacs-25
b134c20 Sync with gnulib
bb30fa9 Fix last change on 2016-01-02
488a72f ; Spelling fixes
9b1aab9 Port run-prolog EMACS to SWI-Prolog 7.2.3
0e7bcec Avoid crashes due to unreasonably large or small text scaling
85f257c Improve documentation of 'with-eval-after-load'
668c7bc Improve handling of non-ASCII characters in Git log messages
b570769 Remove undefined behavior in OS X dumper.
97211f3 Fix clipping of xwidgets
e87fbc0 Improve Lisp-level documentation of tooltips
9f1786e Faces names should not end in "-face".
3283271 * src/xsmfns.c (syms_of_xsmfns): Remove stray "s in doc strings.
a1f221b Comint and compile no longer set EMACS
5c28890 * lisp/subr.el (read-key): Don't let the prompt linger (bug#2...
a75b9a6 Merge branch 'emacs-25' of git.savannah.gnu.org:/srv/git/emac...
c93ae7a Allow to customize names of executables used by grep.el
f6497c6 Set locale encoding to UTF-8 when run from OS X GUI.
7ad1d07 Avoid signaling errors in 'M-n' at the 'C-x C-f' prompt
a3f1ac2 Avoid infinite loop in 'studlify-word'
f36df4b Don’t recommend obsolete EMACS env var
fb0b531 * lisp/emacs-lisp/package.el: Change from a few days ago need...
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r-- | lisp/progmodes/grep.el | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 2b44b58f245..a478c95eb4f 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -427,21 +427,34 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies This gets tacked on the end of the generated expressions.") ;;;###autoload -(defvar grep-program (purecopy "grep") +(defcustom grep-program (purecopy "grep") "The default grep program for `grep-command' and `grep-find-command'. -This variable's value takes effect when `grep-compute-defaults' is called.") +This variable's value takes effect when `grep-compute-defaults' is called." + :type 'string + :version "25.1" + :group 'grep) ;;;###autoload -(defvar find-program (purecopy "find") +(defcustom grep-find-program (purecopy "find") "The default find program. This is used by commands like `grep-find-command', `find-dired' -and others.") +and others." + :type 'string + :version "25.1" + :group 'grep) + +(define-obsolete-variable-alias 'find-program 'grep-find-program "25.1") ;;;###autoload -(defvar xargs-program (purecopy "xargs") +(defcustom grep-xargs-program (purecopy "xargs") "The default xargs program for `grep-find-command'. See `grep-find-use-xargs'. -This variable's value takes effect when `grep-compute-defaults' is called.") +This variable's value takes effect when `grep-compute-defaults' is called." + :type 'string + :version "25.1" + :group 'grep) + +(define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1") ;;;###autoload (defvar grep-find-use-xargs nil @@ -611,13 +624,14 @@ This function is called from `compilation-filter-hook'." (unless grep-find-use-xargs (setq grep-find-use-xargs (cond - ((grep-probe find-program + ((grep-probe grep-find-program `(nil nil nil ,null-device "-exec" "echo" "{}" "+")) 'exec-plus) ((and - (grep-probe find-program `(nil nil nil ,null-device "-print0")) - (grep-probe xargs-program `(nil nil nil "-0" "echo"))) + (grep-probe grep-find-program + `(nil nil nil ,null-device "-print0")) + (grep-probe grep-xargs-program `(nil nil nil "-0" "echo"))) 'gnu) (t 'exec)))) @@ -628,10 +642,11 @@ This function is called from `compilation-filter-hook'." ;; after the pipe symbol be quoted if they use ;; forward slashes as directory separators. (format "%s . -type f -print0 | \"%s\" -0 %s" - find-program xargs-program grep-command)) + grep-find-program grep-xargs-program + grep-command)) ((memq grep-find-use-xargs '(exec exec-plus)) (let ((cmd0 (format "%s . -type f -exec %s" - find-program grep-command)) + grep-find-program grep-command)) (null (if grep-use-null-device (format "%s " null-device) ""))) @@ -643,7 +658,8 @@ This function is called from `compilation-filter-hook'." (1+ (length cmd0))))) (t (format "%s . -type f -print | \"%s\" %s" - find-program xargs-program grep-command))))) + grep-find-program grep-xargs-program + grep-command))))) (unless grep-find-template (setq grep-find-template (let ((gcmd (format "%s <C> %s <R>" @@ -653,17 +669,17 @@ This function is called from `compilation-filter-hook'." ""))) (cond ((eq grep-find-use-xargs 'gnu) (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s" - find-program xargs-program gcmd)) + grep-find-program grep-xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) (format "%s <D> <X> -type f <F> -exec %s {} %s%s" - find-program gcmd null + grep-find-program gcmd null (shell-quote-argument ";"))) ((eq grep-find-use-xargs 'exec-plus) (format "%s <D> <X> -type f <F> -exec %s %s{} +" - find-program gcmd null)) + grep-find-program gcmd null)) (t (format "%s <D> <X> -type f <F> -print | \"%s\" %s" - find-program xargs-program gcmd)))))))) + grep-find-program grep-xargs-program gcmd)))))))) ;; Save defaults for this host. (setq grep-host-defaults-alist |