[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep can no longer find files with matches
From: |
Juri Linkov |
Subject: |
Re: grep can no longer find files with matches |
Date: |
Sat, 13 Aug 2005 09:14:28 +0300 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
> After the 2005-08-12 change to compile.el, M-x grep can no longer
> automatically find files that have matches in them. I just get the
> following prompt when I hit "C-x `":
>
> Find this error in: (default Grep started at Sat Aug 13 04) ~/Mail/
>
> This is caused by the second line of the *grep* buffer which reads
> something like:
>
> Grep started at Sat Aug 13 04:45:07
>
> Which causes the next-error to try to find a match in the file "Grep
> started at Sat Aug 13 04:45".
Funny, grep.el interprets colons in the time as separators between the
file name and line number.
Below is a patch that fixes this. It also improves readability in the
compilation and grep buffers:
- adds a newline after the header (there is already a newline before
the footer);
- removes highlighting from the starting message because it's
unnecessary. Highlighting in the finishing message is still necessary
to show the exit status with colors;
- highlights only the exit status string in the compilation buffer,
doesn't highlight the word "Compilaition" (this is like grep.el
already does in the grep buffer);
- highlights the number of the exit code;
- uses exactly the same time stamp format as the finishing message.
Index: lisp/progmodes/grep.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.45
diff -c -r1.45 grep.el
*** lisp/progmodes/grep.el 9 Aug 2005 21:37:34 -0000 1.45
--- lisp/progmodes/grep.el 13 Aug 2005 06:05:47 -0000
***************
*** 287,292 ****
--- 298,304 ----
(": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or
directory\\|device or address\\)\\)$"
1 grep-error-face)
;; remove match from grep-regexp-alist before fontifying
+ ("^Grep started .*" (0 '(face nil message nil help-echo nil mouse-face
nil) t))
("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches
found\\)\\).*"
(0 '(face nil message nil help-echo nil mouse-face nil) t)
(1 compilation-info-face nil t)
Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.371
diff -c -r1.371 compile.el
*** lisp/progmodes/compile.el 12 Aug 2005 10:17:17 -0000 1.371
--- lisp/progmodes/compile.el 13 Aug 2005 06:05:55 -0000
***************
*** 382,389 ****
("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
(1 font-lock-function-name-face) (3 compilation-line-face nil t))
(" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
! ("^Compilation \\(finish\\|start\\)ed" . compilation-info-face)
! ("^Compilation exited abnormally" . compilation-error-face))
"Additional things to highlight in Compilation mode.
This gets tacked on the end of the generated expressions.")
--- 382,392 ----
("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
(1 font-lock-function-name-face) (3 compilation-line-face nil t))
(" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
! ("^Compilation \\(finished\\)"
! (1 compilation-info-face))
! ("^Compilation \\(exited abnormally\\)\\(?:.*with code \\([0-9]+\\)\\)?"
! (1 compilation-error-face)
! (2 compilation-error-face nil t)))
"Additional things to highlight in Compilation mode.
This gets tacked on the end of the generated expressions.")
***************
*** 971,979 ****
(insert "-*- mode: " name-of-mode
"; default-directory: " (prin1-to-string default-directory)
" -*-\n"
! (format "%s started at %s\n"
! (capitalize name-of-mode)
! (format-time-string "%a %b %d %H:%M:%S"))
command "\n")
(setq thisdir default-directory))
(set-buffer-modified-p nil))
--- 974,982 ----
(insert "-*- mode: " name-of-mode
"; default-directory: " (prin1-to-string default-directory)
" -*-\n"
! (format "%s started at %s\n\n"
! mode-name
! (substring (current-time-string) 0 19))
command "\n")
(setq thisdir default-directory))
(set-buffer-modified-p nil))
--
Juri Linkov
http://www.jurta.org/emacs/