2004-11-03 Thien-Thi Nguyen <ttn@gnu.org>
+ * 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'.
(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.
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)