X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/0273a428450950cf846767982cdb77cc9937a1f3..3ab49e2cb045fbcf903b50dceebec165c2c5b7bd:/lisp/progmodes/grep.el diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 1e152c6d75..3c7f936446 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1,10 +1,10 @@ ;;; grep.el --- run `grep' and display the results -;; Copyright (C) 1985-1987, 1993-1999, 2001-2013 Free Software +;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software ;; Foundation, Inc. ;; Author: Roland McGrath -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: tools, processes ;; This file is part of GNU Emacs. @@ -410,7 +410,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t) (1 grep-error-face) (2 grep-error-face nil t)) - ("^.+?-[0-9]+-.*\n" (0 grep-context-face))) + ;; "filename-linenumber-" format is used for context lines in GNU grep, + ;; "filename=linenumber=" for lines with function names in "git grep -p". + ("^.+?[-=][0-9]+[-=].*\n" (0 grep-context-face))) "Additional things to highlight in grep output. This gets tacked on the end of the generated expressions.") @@ -421,8 +423,9 @@ This variable's value takes effect when `grep-compute-defaults' is called.") ;;;###autoload (defvar find-program (purecopy "find") - "The default find program for `grep-find-command'. -This variable's value takes effect when `grep-compute-defaults' is called.") + "The default find program. +This is used by commands like `grep-find-command', `find-dired' +and others.") ;;;###autoload (defvar xargs-program (purecopy "xargs") @@ -817,12 +820,7 @@ substitution string. Note dynamic scoping of variables.") (defun grep-read-regexp () "Read regexp arg for interactive grep." - (let ((default (grep-tag-default))) - (read-regexp - (concat "Search for" - (if (and default (> (length default) 0)) - (format " (default \"%s\"): " default) ": ")) - default 'grep-regexp-history))) + (read-regexp "Search for" 'grep-tag-default 'grep-regexp-history)) (defun grep-read-files (regexp) "Read files arg for interactive grep." @@ -993,8 +991,6 @@ to specify a command to run." (compilation-start regexp 'grep-mode)) (setq dir (file-name-as-directory (expand-file-name dir))) (require 'find-dired) ; for `find-name-arg' - ;; In Tramp, there could be problems if the command line is too - ;; long. We escape it, therefore. (let ((command (grep-expand-template grep-find-template regexp @@ -1003,7 +999,7 @@ to specify a command to run." (mapconcat #'shell-quote-argument (split-string files) - (concat "\\\n" " -o " find-name-arg " ")) + (concat " -o " find-name-arg " ")) " " (shell-quote-argument ")")) dir @@ -1024,7 +1020,7 @@ to specify a command to run." (concat "*/" (cdr ignore))))))) grep-find-ignored-directories - "\\\n -o -path ") + " -o -path ") " " (shell-quote-argument ")") " -prune -o ")) @@ -1042,7 +1038,7 @@ to specify a command to run." (shell-quote-argument (cdr ignore)))))) grep-find-ignored-files - "\\\n -o -name ") + " -o -name ") " " (shell-quote-argument ")") " -prune -o "))))))