[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r105658: Grep related fixes.
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r105658: Grep related fixes. |
Date: |
Mon, 05 Sep 2011 11:20:02 +0300 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 105658
fixes bug(s): http://debbugs.gnu.org/9408
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Mon 2011-09-05 11:20:02 +0300
message:
Grep related fixes.
* etc/grep.txt: Add `eval' to the Local Variables section that
emulates `grep-filter'.
* lisp/progmodes/grep.el (grep-filter): Avoid incomplete processing by
keeping point where processing of grep matches begins, and
continue to delete remaining escape sequences from the same point.
(grep-filter): Make leading zero optional in "0?1;31m" because
git-grep emits "\033[1;31m" escape sequences unlike expected
"\033[01;31m" as GNU Grep does.
(grep-process-setup): Replace obsolete "ml=" with newer "sl=".
modified:
etc/ChangeLog
etc/grep.txt
lisp/ChangeLog
lisp/progmodes/grep.el
=== modified file 'etc/ChangeLog'
--- a/etc/ChangeLog 2011-08-30 05:52:05 +0000
+++ b/etc/ChangeLog 2011-09-05 08:20:02 +0000
@@ -1,3 +1,8 @@
+2011-09-05 Juri Linkov <address@hidden>
+
+ * grep.txt: Add `eval' to the Local Variables section that
+ emulates `grep-filter'.
+
2011-08-30 Paul Eggert <address@hidden>
* MACHINES: Remove obsolete info and update a bit (Bug#9404).
=== modified file 'etc/grep.txt'
--- a/etc/grep.txt 2011-01-25 04:08:28 +0000
+++ b/etc/grep.txt 2011-09-05 08:20:02 +0000
@@ -103,5 +103,6 @@
;;; Local Variables:
+;;; eval: (let ((inhibit-read-only t) (compilation-filter-start (point-min)))
(save-excursion (goto-char (point-max)) (grep-filter) (set-buffer-modified-p
nil)))
;;; buffer-read-only: t
;;; End:
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-09-05 08:05:01 +0000
+++ b/lisp/ChangeLog 2011-09-05 08:20:02 +0000
@@ -1,5 +1,15 @@
2011-09-05 Juri Linkov <address@hidden>
+ * progmodes/grep.el (grep-filter): Avoid incomplete processing by
+ keeping point where processing of grep matches begins, and
+ continue to delete remaining escape sequences from the same point.
+ (grep-filter): Make leading zero optional in "0?1;31m" because
+ git-grep emits "\033[1;31m" escape sequences unlike expected
+ "\033[01;31m" as GNU Grep does (bug#9408).
+ (grep-process-setup): Replace obsolete "ml=" with newer "sl=".
+
+2011-09-05 Juri Linkov <address@hidden>
+
* subr.el (y-or-n-p): Capitalize "yes".
2011-09-04 Michael Albinus <address@hidden>
=== modified file 'lisp/progmodes/grep.el'
--- a/lisp/progmodes/grep.el 2011-08-22 09:54:38 +0000
+++ b/lisp/progmodes/grep.el 2011-09-05 08:20:02 +0000
@@ -459,7 +459,7 @@
;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions
(setenv "GREP_COLOR" "01;31")
;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
- (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne"))
+ (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:sl=:cx=:ne"))
(set (make-local-variable 'compilation-exit-message-function)
(lambda (status code msg)
(if (eq status 'exit)
@@ -480,20 +480,21 @@
This function is called from `compilation-filter-hook'."
(save-excursion
(forward-line 0)
- (let ((end (point)))
+ (let ((end (point)) beg)
(goto-char compilation-filter-start)
(forward-line 0)
+ (setq beg (point))
;; Only operate on whole lines so we don't get caught with part of an
;; escape sequence in one chunk and the rest in another.
(when (< (point) end)
(setq end (copy-marker end))
;; Highlight grep matches and delete marking sequences.
- (while (re-search-forward "\033\\[01;31m\\(.*?\\)\033\\[[0-9]*m" end 1)
+ (while (re-search-forward "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m" end
1)
(replace-match (propertize (match-string 1)
'face nil 'font-lock-face grep-match-face)
t t))
;; Delete all remaining escape sequences
- (goto-char compilation-filter-start)
+ (goto-char beg)
(while (re-search-forward "\033\\[[0-9;]*[mK]" end 1)
(replace-match "" t t))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r105658: Grep related fixes.,
Juri Linkov <=