From: Thien-Thi Nguyen Date: Wed, 3 Nov 2004 11:45:20 +0000 (+0000) Subject: (grep-default-command): Take empty string X-Git-Tag: ttn-vms-21-2-B4~4219 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=02b73b974f58f937c09ac318fd40d32c9a157c8b;p=emacs.git (grep-default-command): Take empty string for tag if all other methods yield nil. Shell-quote the tag. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d47e404cf0e..a7c72f3bd68 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2004-11-03 Thien-Thi Nguyen + * progmodes/grep.el (grep-default-command): Take empty string + for tag if all other methods yield nil. Shell-quote the tag. + * vc.el (vc-annotate-display-autoscale): Add prefix-arg spec in `interactive' form, and mention it in the docstring. 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'." (defun grep-default-command () (let ((tag-default - (funcall (or find-tag-default-function - (get major-mode 'find-tag-default-function) - 'find-tag-default))) + (shell-quote-argument + (or (funcall (or find-tag-default-function + (get major-mode 'find-tag-default-function) + 'find-tag-default)) + ""))) (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") (grep-default (or (car grep-history) grep-command))) ;; Replace the thing matching for with that around cursor. @@ -460,7 +462,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." 0 (match-beginning 2)) " *." (file-name-extension buffer-file-name)))) - (replace-match (or tag-default "") t t grep-default 1)))) + (replace-match tag-default t t grep-default 1)))) ;;;###autoload (defun grep (command-args &optional highlight-regexp)