view etc/grep.txt @ 64509:9a66028f1658

(grep-regexp-alist) (grep-mode-font-lock-keywords, grep-process-setup): Use default GNU grep match color "01;31m" instead of "01;41m". (grep-regexp-alist, grep-mode-font-lock-keywords): Use `\\[[0-9]*m' instead of `\\[00m'. (grep-regexp-alist): Move `\\(?:\033\\[K\\)?' from sgr_end to sgr_start where its handling is more important. Use the real length of sgr_start instead of constant 8. (grep-mode-font-lock-keywords): Don't delete `\\(?:\033\\[K\\)?' specially. Delete all remaining escape sequences. (grep-process-setup): Set "GREP_COLORS" for GNU grep 2.5.1-cvs. (grep-regexp-alist): Make hyperlink only for binary file name instead of the whole line. (grep-mode-map): Bind `backtab' to `compilation-previous-file'. (grep-mode): Add autoload.
author Juri Linkov <juri@jurta.org>
date Tue, 19 Jul 2005 14:21:23 +0000
parents fab6aeab9e8d
children 4fc385f4c685
line wrap: on
line source

* Introduction  -*-grep-*-

This shows the different kinds of messages grep recognizes by default and
how they are rendered.  It is intended both to help you decide which matchers
you need and as a test of the matchers.  Move the mouse over a colored part
to see how much text was actually matched.

Please do not edit this file in grep-mode, it may lose escape
sequences on saving.  Visit this file literally for editing.


* GNU grep 2.5.1

grep -nH -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1 with default colors

grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1-cvs with specified minimal colors

GREP_COLORS='mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne' grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1-cvs with default colors

grep -nH --color=always -e "INFO tree" ../info/*
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree

* GNU grep 2.5.1 on lines starting with a number and colon

grep -nH -e "Universal Time" ../lispref/*
../lispref/os.texi:1010:0:00 January 1, 1970 UTC (Coordinated Universal Time)

* GNU grep 2.5.1 with context lines

grep -C 2 -nH --color=always -e "INFO tree" ../info/*
../info/dir-4-looking at that node, which is (dir)Top.
../info/dir-5-
../info/dir:6:File: dir	Node: Top	This is the top of the INFO tree
../info/dir-7-
../info/dir-8-The Info Directory

* GNU grep 2.5.1 on files recognized as binary

Binary file emacs-7 matches
Binary file 2005-06 matches

* GNU grep 2.5.1: other messages

grep: ../info/dirinfo: No such file or directory
Grep exited abnormally with code 2 at Tue Jul 19 15:42:32
Grep finished with no matches found at Tue Jul 19 15:43:12
Grep finished (matches found) at Tue Jul 19 15:45:15

* agrep

agrep -n "INFO tree" ../info/*
../info/dir: 6: File: dir	Node: Top	This is the top of the INFO tree

* unknown greps

grep -nH -e "xyzxyz" ../info/*
../info/emacs-2:1205:10:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2:1205:10-15:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2:1205.10-1205.15:inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205.10-15 inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205.10-1205.15 inserts `xyzxyzxyzxyz' in the current buffer.
../info/emacs-2 1205 inserts `xyzxyzxyzxyz' in the current buffer.

;;; Local Variables:
;;; buffer-read-only: t
;;; End: