Commit ad6fc8f4 authored by Juri Linkov's avatar Juri Linkov

* progmodes/grep.el (zrgrep): Call `grep-compute-defaults' at the

beginning of interactive spec like all other grep commands do.
Put "all" in front of "gz".  (Bug#5260)
parent 5bcc9931
2010-01-31 Juri Linkov <juri@jurta.org>
* progmodes/grep.el (zrgrep): Call `grep-compute-defaults' at the
beginning of interactive spec like all other grep commands do.
Put "all" in front of "gz". (Bug#5260)
2010-01-29 Dan Nicolaescu <dann@ics.uci.edu> 2010-01-29 Dan Nicolaescu <dann@ics.uci.edu>
* vc-bzr.el (vc-bzr-after-dir-status): Match another renaming indicator. * vc-bzr.el (vc-bzr-after-dir-status): Match another renaming indicator.
......
...@@ -996,26 +996,34 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]." ...@@ -996,26 +996,34 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
Like `rgrep' but uses `zgrep' for `grep-program', sets the default Like `rgrep' but uses `zgrep' for `grep-program', sets the default
file name to `*.gz', and sets `grep-highlight-matches' to `always'." file name to `*.gz', and sets `grep-highlight-matches' to `always'."
(interactive (interactive
(let ((grep-program "zgrep") (progn
(grep-find-template nil) ; output of `grep-compute-defaults' ;; Compute standard default values.
(grep-find-command nil)
(grep-host-defaults-alist nil)
(grep-files-aliases '(("*.gz" . "*.gz") ; for `grep-read-files'
("all" . "* .*"))))
;; Recompute defaults using let-bound values above.
(grep-compute-defaults) (grep-compute-defaults)
(cond ;; Compute the default zrgrep command by running `grep-compute-defaults'
((and grep-find-command (equal current-prefix-arg '(16))) ;; for grep program "zgrep", but not changing global values.
(list (read-from-minibuffer "Run: " grep-find-command (let ((grep-program "zgrep")
nil nil 'grep-find-history))) ;; Don't change global values for variables computed
((not grep-find-template) ;; by `grep-compute-defaults'.
(error "grep.el: No `grep-find-template' available")) (grep-find-template nil)
(t (let* ((regexp (grep-read-regexp)) (grep-find-command nil)
(files (grep-read-files regexp)) (grep-host-defaults-alist nil)
(dir (read-directory-name "Base directory: " ;; Use for `grep-read-files'
nil default-directory t)) (grep-files-aliases '(("all" . "* .*")
(confirm (equal current-prefix-arg '(4)))) ("gz" . "*.gz"))))
(list regexp files dir confirm grep-find-template)))))) ;; Recompute defaults using let-bound values above.
(grep-compute-defaults)
(cond
((and grep-find-command (equal current-prefix-arg '(16)))
(list (read-from-minibuffer "Run: " grep-find-command
nil nil 'grep-find-history)))
((not grep-find-template)
(error "grep.el: No `grep-find-template' available"))
(t (let* ((regexp (grep-read-regexp))
(files (grep-read-files regexp))
(dir (read-directory-name "Base directory: "
nil default-directory t))
(confirm (equal current-prefix-arg '(4))))
(list regexp files dir confirm grep-find-template)))))))
;; Set `grep-highlight-matches' to `always' ;; Set `grep-highlight-matches' to `always'
;; since `zgrep' puts filters in the grep output. ;; since `zgrep' puts filters in the grep output.
(let ((grep-highlight-matches 'always)) (let ((grep-highlight-matches 'always))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment