diff options
| author | Eli Zaretskii | 2016-04-21 05:08:29 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-04-21 05:08:29 +0300 |
| commit | 1ba947f275b9675e4c2802cfca52468ff84cfc5e (patch) | |
| tree | b90cb0c2e17da0e4513f4f2778b66d76b39417c5 | |
| parent | 570e0fa357eabb76babf87343d5b9c8ae13e9e53 (diff) | |
| download | emacs-1ba947f275b9675e4c2802cfca52468ff84cfc5e.tar.gz emacs-1ba947f275b9675e4c2802cfca52468ff84cfc5e.zip | |
Revert "Allow to customize names of executables used by grep.el"
This reverts commit c93ae7a1e5a94541189a8f36984014344d561ffc.
| -rw-r--r-- | lisp/progmodes/grep.el | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 5d1b68a192d..f04a7226d18 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -411,34 +411,21 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 411 | This gets tacked on the end of the generated expressions.") | 411 | This gets tacked on the end of the generated expressions.") |
| 412 | 412 | ||
| 413 | ;;;###autoload | 413 | ;;;###autoload |
| 414 | (defcustom grep-program (purecopy "grep") | 414 | (defvar grep-program (purecopy "grep") |
| 415 | "The default grep program for `grep-command' and `grep-find-command'. | 415 | "The default grep program for `grep-command' and `grep-find-command'. |
| 416 | This variable's value takes effect when `grep-compute-defaults' is called." | 416 | This variable's value takes effect when `grep-compute-defaults' is called.") |
| 417 | :type 'string | ||
| 418 | :version "25.1" | ||
| 419 | :group 'grep) | ||
| 420 | 417 | ||
| 421 | ;;;###autoload | 418 | ;;;###autoload |
| 422 | (defcustom grep-find-program (purecopy "find") | 419 | (defvar find-program (purecopy "find") |
| 423 | "The default find program. | 420 | "The default find program. |
| 424 | This is used by commands like `grep-find-command', `find-dired' | 421 | This is used by commands like `grep-find-command', `find-dired' |
| 425 | and others." | 422 | and others.") |
| 426 | :type 'string | ||
| 427 | :version "25.1" | ||
| 428 | :group 'grep) | ||
| 429 | |||
| 430 | (define-obsolete-variable-alias 'find-program 'grep-find-program "25.1") | ||
| 431 | 423 | ||
| 432 | ;;;###autoload | 424 | ;;;###autoload |
| 433 | (defcustom grep-xargs-program (purecopy "xargs") | 425 | (defvar xargs-program (purecopy "xargs") |
| 434 | "The default xargs program for `grep-find-command'. | 426 | "The default xargs program for `grep-find-command'. |
| 435 | See `grep-find-use-xargs'. | 427 | See `grep-find-use-xargs'. |
| 436 | This variable's value takes effect when `grep-compute-defaults' is called." | 428 | This variable's value takes effect when `grep-compute-defaults' is called.") |
| 437 | :type 'string | ||
| 438 | :version "25.1" | ||
| 439 | :group 'grep) | ||
| 440 | |||
| 441 | (define-obsolete-variable-alias 'xargs-program 'grep-xargs-program "25.1") | ||
| 442 | 429 | ||
| 443 | ;;;###autoload | 430 | ;;;###autoload |
| 444 | (defvar grep-find-use-xargs nil | 431 | (defvar grep-find-use-xargs nil |
| @@ -608,14 +595,13 @@ This function is called from `compilation-filter-hook'." | |||
| 608 | (unless grep-find-use-xargs | 595 | (unless grep-find-use-xargs |
| 609 | (setq grep-find-use-xargs | 596 | (setq grep-find-use-xargs |
| 610 | (cond | 597 | (cond |
| 611 | ((grep-probe grep-find-program | 598 | ((grep-probe find-program |
| 612 | `(nil nil nil ,null-device "-exec" "echo" | 599 | `(nil nil nil ,null-device "-exec" "echo" |
| 613 | "{}" "+")) | 600 | "{}" "+")) |
| 614 | 'exec-plus) | 601 | 'exec-plus) |
| 615 | ((and | 602 | ((and |
| 616 | (grep-probe grep-find-program | 603 | (grep-probe find-program `(nil nil nil ,null-device "-print0")) |
| 617 | `(nil nil nil ,null-device "-print0")) | 604 | (grep-probe xargs-program `(nil nil nil "-0" "echo"))) |
| 618 | (grep-probe grep-xargs-program `(nil nil nil "-0" "echo"))) | ||
| 619 | 'gnu) | 605 | 'gnu) |
| 620 | (t | 606 | (t |
| 621 | 'exec)))) | 607 | 'exec)))) |
| @@ -626,11 +612,10 @@ This function is called from `compilation-filter-hook'." | |||
| 626 | ;; after the pipe symbol be quoted if they use | 612 | ;; after the pipe symbol be quoted if they use |
| 627 | ;; forward slashes as directory separators. | 613 | ;; forward slashes as directory separators. |
| 628 | (format "%s . -type f -print0 | \"%s\" -0 %s" | 614 | (format "%s . -type f -print0 | \"%s\" -0 %s" |
| 629 | grep-find-program grep-xargs-program | 615 | find-program xargs-program grep-command)) |
| 630 | grep-command)) | ||
| 631 | ((memq grep-find-use-xargs '(exec exec-plus)) | 616 | ((memq grep-find-use-xargs '(exec exec-plus)) |
| 632 | (let ((cmd0 (format "%s . -type f -exec %s" | 617 | (let ((cmd0 (format "%s . -type f -exec %s" |
| 633 | grep-find-program grep-command)) | 618 | find-program grep-command)) |
| 634 | (null (if grep-use-null-device | 619 | (null (if grep-use-null-device |
| 635 | (format "%s " null-device) | 620 | (format "%s " null-device) |
| 636 | ""))) | 621 | ""))) |
| @@ -642,8 +627,7 @@ This function is called from `compilation-filter-hook'." | |||
| 642 | (1+ (length cmd0))))) | 627 | (1+ (length cmd0))))) |
| 643 | (t | 628 | (t |
| 644 | (format "%s . -type f -print | \"%s\" %s" | 629 | (format "%s . -type f -print | \"%s\" %s" |
| 645 | grep-find-program grep-xargs-program | 630 | find-program xargs-program grep-command))))) |
| 646 | grep-command))))) | ||
| 647 | (unless grep-find-template | 631 | (unless grep-find-template |
| 648 | (setq grep-find-template | 632 | (setq grep-find-template |
| 649 | (let ((gcmd (format "%s <C> %s <R>" | 633 | (let ((gcmd (format "%s <C> %s <R>" |
| @@ -653,17 +637,17 @@ This function is called from `compilation-filter-hook'." | |||
| 653 | ""))) | 637 | ""))) |
| 654 | (cond ((eq grep-find-use-xargs 'gnu) | 638 | (cond ((eq grep-find-use-xargs 'gnu) |
| 655 | (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s" | 639 | (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s" |
| 656 | grep-find-program grep-xargs-program gcmd)) | 640 | find-program xargs-program gcmd)) |
| 657 | ((eq grep-find-use-xargs 'exec) | 641 | ((eq grep-find-use-xargs 'exec) |
| 658 | (format "%s <D> <X> -type f <F> -exec %s {} %s%s" | 642 | (format "%s <D> <X> -type f <F> -exec %s {} %s%s" |
| 659 | grep-find-program gcmd null | 643 | find-program gcmd null |
| 660 | (shell-quote-argument ";"))) | 644 | (shell-quote-argument ";"))) |
| 661 | ((eq grep-find-use-xargs 'exec-plus) | 645 | ((eq grep-find-use-xargs 'exec-plus) |
| 662 | (format "%s <D> <X> -type f <F> -exec %s %s{} +" | 646 | (format "%s <D> <X> -type f <F> -exec %s %s{} +" |
| 663 | grep-find-program gcmd null)) | 647 | find-program gcmd null)) |
| 664 | (t | 648 | (t |
| 665 | (format "%s <D> <X> -type f <F> -print | \"%s\" %s" | 649 | (format "%s <D> <X> -type f <F> -print | \"%s\" %s" |
| 666 | grep-find-program grep-xargs-program gcmd)))))))) | 650 | find-program xargs-program gcmd)))))))) |
| 667 | 651 | ||
| 668 | ;; Save defaults for this host. | 652 | ;; Save defaults for this host. |
| 669 | (setq grep-host-defaults-alist | 653 | (setq grep-host-defaults-alist |