aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-06-03 05:44:48 +0300
committerDmitry Gutov2015-06-03 05:45:15 +0300
commitc6ee95ddeefc17410e15090539d0cb220ab6947c (patch)
tree6e899d28a439298551f946871ea515ab4cf10b24
parent0a9e3248af3bab4f35da1473a6330292f5857ccd (diff)
downloademacs-c6ee95ddeefc17410e15090539d0cb220ab6947c.tar.gz
emacs-c6ee95ddeefc17410e15090539d0cb220ab6947c.zip
Restore <D> instead of '.' in grep-find-template
* lisp/cedet/semantic/symref/grep.el (semantic-symref-grep-use-template): Update a comment. * lisp/progmodes/grep.el (grep-compute-defaults): Restore <D> instead of '.' in grep-find-template (bug#20719). (rgrep): Pass nil as the directory to rgrep-default-command. * lisp/progmodes/grep.el (grep-expand-keywords): Use '.' as the default value for DIR. * lisp/progmodes/xref.el (xref-collect-matches): Drop the workaround.
-rw-r--r--lisp/cedet/semantic/symref/grep.el2
-rw-r--r--lisp/progmodes/grep.el12
-rw-r--r--lisp/progmodes/xref.el5
3 files changed, 7 insertions, 12 deletions
diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el
index 6325eb4a396..cea6d4f07cd 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -125,7 +125,7 @@ GREPPATTERN is the pattern used by grep."
125 greppattern 125 greppattern
126 filepattern 126 filepattern
127 rootdir))) 127 rootdir)))
128 ;; For some reason, my default has no <D> in it. 128 ;; http://debbugs.gnu.org/20719
129 (when (string-match "find \\(\\.\\)" cmd) 129 (when (string-match "find \\(\\.\\)" cmd)
130 (setq cmd (replace-match rootdir t t cmd 1))) 130 (setq cmd (replace-match rootdir t t cmd 1)))
131 ;;(message "New command: %s" cmd) 131 ;;(message "New command: %s" cmd)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6981d38ee5f..68852f7b558 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -633,17 +633,17 @@ This function is called from `compilation-filter-hook'."
633 (format "%s " null-device) 633 (format "%s " null-device)
634 ""))) 634 "")))
635 (cond ((eq grep-find-use-xargs 'gnu) 635 (cond ((eq grep-find-use-xargs 'gnu)
636 (format "%s . <X> -type f <F> -print0 | \"%s\" -0 %s" 636 (format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
637 find-program xargs-program gcmd)) 637 find-program xargs-program gcmd))
638 ((eq grep-find-use-xargs 'exec) 638 ((eq grep-find-use-xargs 'exec)
639 (format "%s . <X> -type f <F> -exec %s {} %s%s" 639 (format "%s <D> <X> -type f <F> -exec %s {} %s%s"
640 find-program gcmd null 640 find-program gcmd null
641 (shell-quote-argument ";"))) 641 (shell-quote-argument ";")))
642 ((eq grep-find-use-xargs 'exec-plus) 642 ((eq grep-find-use-xargs 'exec-plus)
643 (format "%s . <X> -type f <F> -exec %s %s{} +" 643 (format "%s <D> <X> -type f <F> -exec %s %s{} +"
644 find-program gcmd null)) 644 find-program gcmd null))
645 (t 645 (t
646 (format "%s . <X> -type f <F> -print | \"%s\" %s" 646 (format "%s <D> <X> -type f <F> -print | \"%s\" %s"
647 find-program xargs-program gcmd)))))))) 647 find-program xargs-program gcmd))))))))
648 648
649 ;; Save defaults for this host. 649 ;; Save defaults for this host.
@@ -792,7 +792,7 @@ easily repeat a find command."
792 792
793(defconst grep-expand-keywords 793(defconst grep-expand-keywords
794 '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i")) 794 '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
795 ("<D>" . dir) 795 ("<D>" . (or dir "."))
796 ("<F>" . files) 796 ("<F>" . files)
797 ("<N>" . null-device) 797 ("<N>" . null-device)
798 ("<X>" . excl) 798 ("<X>" . excl)
@@ -992,7 +992,7 @@ to specify a command to run."
992 grep-find-command))) 992 grep-find-command)))
993 (compilation-start regexp 'grep-mode)) 993 (compilation-start regexp 'grep-mode))
994 (setq dir (file-name-as-directory (expand-file-name dir))) 994 (setq dir (file-name-as-directory (expand-file-name dir)))
995 (let ((command (rgrep-default-command regexp files dir))) 995 (let ((command (rgrep-default-command regexp files nil)))
996 (when command 996 (when command
997 (if confirm 997 (if confirm
998 (setq command 998 (setq command
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index d6f6ba89ab9..f786d4e3ac7 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -757,11 +757,6 @@ tools are used, and when."
757 (buf (get-buffer-create " *xref-grep*")) 757 (buf (get-buffer-create " *xref-grep*"))
758 (grep-re (caar grep-regexp-alist)) 758 (grep-re (caar grep-regexp-alist))
759 hits) 759 hits)
760 ;; http://debbugs.gnu.org/20719
761 ;; We want to pass the exact directory to `find', because then
762 ;; `grep' output features absolute file names.
763 (when (string-match "find \\(\\.\\)" command)
764 (setq command (replace-match (shell-quote-argument dir) t t command 1)))
765 (with-current-buffer buf 760 (with-current-buffer buf
766 (erase-buffer) 761 (erase-buffer)
767 (when (eq (call-process-shell-command command nil t) 0) 762 (when (eq (call-process-shell-command command nil t) 0)