# HG changeset patch # User Thien-Thi Nguyen # Date 1099482216 0 # Node ID a4ed247d476fe0e80804e8fd5643c9beaeb7cae4 # Parent 436b42c6582814fc46a688bb5df63a2520e0a3fa (grep-default-command): Take empty string for tag if all other methods yield nil. Shell-quote the tag. diff -r 436b42c65828 -r a4ed247d476f lisp/progmodes/grep.el --- a/lisp/progmodes/grep.el Wed Nov 03 10:41:46 2004 +0000 +++ b/lisp/progmodes/grep.el Wed Nov 03 11:43:36 2004 +0000 @@ -436,9 +436,11 @@ (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 @@ 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)