diff options
| author | Thien-Thi Nguyen | 2004-11-03 11:45:20 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2004-11-03 11:45:20 +0000 |
| commit | 02b73b974f58f937c09ac318fd40d32c9a157c8b (patch) | |
| tree | 3cc90d7a8c44475bbb95280073cdb494011d7e8a | |
| parent | 2e73435333f50845d845633664161d26d55afd51 (diff) | |
| download | emacs-02b73b974f58f937c09ac318fd40d32c9a157c8b.tar.gz emacs-02b73b974f58f937c09ac318fd40d32c9a157c8b.zip | |
(grep-default-command): Take empty string
for tag if all other methods yield nil. Shell-quote the tag.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d47e404cf0e..a7c72f3bd68 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2004-11-03 Thien-Thi Nguyen <ttn@gnu.org> | 1 | 2004-11-03 Thien-Thi Nguyen <ttn@gnu.org> |
| 2 | 2 | ||
| 3 | * progmodes/grep.el (grep-default-command): Take empty string | ||
| 4 | for tag if all other methods yield nil. Shell-quote the tag. | ||
| 5 | |||
| 3 | * vc.el (vc-annotate-display-autoscale): Add prefix-arg | 6 | * vc.el (vc-annotate-display-autoscale): Add prefix-arg |
| 4 | spec in `interactive' form, and mention it in the docstring. | 7 | spec in `interactive' form, and mention it in the docstring. |
| 5 | Also, make sure point is at bol after calling `annotate-time'. | 8 | Also, make sure point is at bol after calling `annotate-time'. |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 71927642a96..7a13ddba6ed 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -436,9 +436,11 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 436 | 436 | ||
| 437 | (defun grep-default-command () | 437 | (defun grep-default-command () |
| 438 | (let ((tag-default | 438 | (let ((tag-default |
| 439 | (funcall (or find-tag-default-function | 439 | (shell-quote-argument |
| 440 | (get major-mode 'find-tag-default-function) | 440 | (or (funcall (or find-tag-default-function |
| 441 | 'find-tag-default))) | 441 | (get major-mode 'find-tag-default-function) |
| 442 | 'find-tag-default)) | ||
| 443 | ""))) | ||
| 442 | (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") | 444 | (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") |
| 443 | (grep-default (or (car grep-history) grep-command))) | 445 | (grep-default (or (car grep-history) grep-command))) |
| 444 | ;; Replace the thing matching for with that around cursor. | 446 | ;; Replace the thing matching for with that around cursor. |
| @@ -460,7 +462,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 460 | 0 (match-beginning 2)) | 462 | 0 (match-beginning 2)) |
| 461 | " *." | 463 | " *." |
| 462 | (file-name-extension buffer-file-name)))) | 464 | (file-name-extension buffer-file-name)))) |
| 463 | (replace-match (or tag-default "") t t grep-default 1)))) | 465 | (replace-match tag-default t t grep-default 1)))) |
| 464 | 466 | ||
| 465 | ;;;###autoload | 467 | ;;;###autoload |
| 466 | (defun grep (command-args &optional highlight-regexp) | 468 | (defun grep (command-args &optional highlight-regexp) |