comparison lisp/progmodes/grep.el @ 56828:5ed31ed85a8e

(grep-default-command): Use find-tag-default. (grep-tag-default): Function deleted.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Aug 2004 15:31:20 +0000
parents 7e766b87637b
children 4be25baf31b5
comparison
equal deleted inserted replaced
56827:12cc6bc5d550 56828:5ed31ed85a8e
382 382
383 (defun grep-default-command () 383 (defun grep-default-command ()
384 (let ((tag-default 384 (let ((tag-default
385 (funcall (or find-tag-default-function 385 (funcall (or find-tag-default-function
386 (get major-mode 'find-tag-default-function) 386 (get major-mode 'find-tag-default-function)
387 ;; We use grep-tag-default instead of 387 'find-tag-default)))
388 ;; find-tag-default, to avoid loading etags.
389 'grep-tag-default)))
390 (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") 388 (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)")
391 (grep-default (or (car grep-history) grep-command))) 389 (grep-default (or (car grep-history) grep-command)))
392 ;; Replace the thing matching for with that around cursor. 390 ;; Replace the thing matching for with that around cursor.
393 (when (or (string-match 391 (when (or (string-match
394 (concat "[^ ]+\\s +\\(?:-[^ ]+\\s +\\)*" 392 (concat "[^ ]+\\s +\\(?:-[^ ]+\\s +\\)*"
454 (setq grep-last-buffer (current-buffer)) 452 (setq grep-last-buffer (current-buffer))
455 (set (make-local-variable 'compilation-error-face) 453 (set (make-local-variable 'compilation-error-face)
456 grep-hit-face) 454 grep-hit-face)
457 (set (make-local-variable 'compilation-error-regexp-alist) 455 (set (make-local-variable 'compilation-error-regexp-alist)
458 grep-regexp-alist)) 456 grep-regexp-alist))
459
460 ;; This is a copy of find-tag-default from etags.el.
461 ;;;###autoload
462 (defun grep-tag-default ()
463 (save-excursion
464 (while (looking-at "\\sw\\|\\s_")
465 (forward-char 1))
466 (when (or (re-search-backward "\\sw\\|\\s_"
467 (save-excursion (beginning-of-line) (point))
468 t)
469 (re-search-forward "\\(\\sw\\|\\s_\\)+"
470 (save-excursion (end-of-line) (point))
471 t))
472 (goto-char (match-end 0))
473 (buffer-substring (point)
474 (progn (forward-sexp -1)
475 (while (looking-at "\\s'")
476 (forward-char 1))
477 (point))))))
478 457
479 ;;;###autoload 458 ;;;###autoload
480 (defun grep-find (command-args) 459 (defun grep-find (command-args)
481 "Run grep via find, with user-specified args COMMAND-ARGS. 460 "Run grep via find, with user-specified args COMMAND-ARGS.
482 Collect output in a buffer. 461 Collect output in a buffer.