/[emacs]/emacs/lisp/progmodes/grep.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/grep.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by jurta, Tue Sep 7 03:55:28 2004 UTC revision 1.23 by jurta, Tue Sep 7 18:10:49 2004 UTC
# Line 65  will be parsed and highlighted as soon a Line 65  will be parsed and highlighted as soon a
65    :group 'grep)    :group 'grep)
66    
67  (defcustom grep-highlight-matches 'auto-detect  (defcustom grep-highlight-matches 'auto-detect
68    "*If t, use special markers to highlight grep matches.    "If t, use special markers to highlight grep matches.
69    
70  Some grep programs are able to surround matches with special  Some grep programs are able to surround matches with special
71  markers in grep output.  Such markers can be used to highlight  markers in grep output.  Such markers can be used to highlight
# Line 74  matches in grep mode. Line 74  matches in grep mode.
74  This option sets the environment variable GREP_COLOR to specify  This option sets the environment variable GREP_COLOR to specify
75  markers for highlighting and GREP_OPTIONS to add the --color  markers for highlighting and GREP_OPTIONS to add the --color
76  option in front of any explicit grep options before starting  option in front of any explicit grep options before starting
77  the grep."  the grep.
78    
79    The default value of this variable is set up by `grep-compute-defaults';
80    call that function before using this variable in your program."
81    :type '(choice (const :tag "Do not highlight matches with grep markers" nil)    :type '(choice (const :tag "Do not highlight matches with grep markers" nil)
82                   (const :tag "Highlight matches with grep markers" t)                   (const :tag "Highlight matches with grep markers" t)
83                   (other :tag "Not Set" auto-detect))                   (other :tag "Not Set" auto-detect))
# Line 334  This variable's value takes effect when Line 337  This variable's value takes effect when
337  (defun grep-process-setup ()  (defun grep-process-setup ()
338    "Setup compilation variables and buffer for `grep'.    "Setup compilation variables and buffer for `grep'.
339  Set up `compilation-exit-message-function' and run `grep-setup-hook'."  Set up `compilation-exit-message-function' and run `grep-setup-hook'."
340    (when grep-highlight-matches    (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
341        (grep-compute-defaults))
342      (when (eq grep-highlight-matches t)
343      ;; Modify `process-environment' locally bound in `compilation-start'      ;; Modify `process-environment' locally bound in `compilation-start'
344      (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always"))      (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always"))
345      (setenv "GREP_COLOR" "01;41"))      (setenv "GREP_COLOR" "01;41"))
# Line 420  Set up `compilation-exit-message-functio Line 425  Set up `compilation-exit-message-functio
425    (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))    (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
426      (setq grep-highlight-matches      (setq grep-highlight-matches
427            (with-temp-buffer            (with-temp-buffer
428              (and (equal (condition-case nil              (and (equal (condition-case nil
429                              (call-process grep-program nil t nil "--help")                              (call-process grep-program nil t nil "--help")
430                            (error nil))                            (error nil))
431                          0)                          0)
432                   (progn                   (progn
433                     (goto-char (point-min))                     (goto-char (point-min))
434                     (search-forward "--color" nil t))                     (search-forward "--color" nil t))
435                   t)))))                   t)))))
436    
437  (defun grep-default-command ()  (defun grep-default-command ()
438    (let ((tag-default    (let ((tag-default

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26