Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c89be45f
Commit
c89be45f
authored
May 12, 2011
by
Stefan Monnier
Browse files
* lisp/progmodes/grep.el (grep-filter): Don't trip on partial lines.
parent
914a0ae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
lisp/ChangeLog
lisp/ChangeLog
+2
-0
lisp/progmodes/grep.el
lisp/progmodes/grep.el
+16
-10
No files found.
lisp/ChangeLog
View file @
c89be45f
2011-05-12 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/grep.el (grep-filter): Don't trip on partial lines.
* shell.el (shell-completion-vars): New function.
(shell-mode):
* simple.el (read-shell-command): Use it.
...
...
lisp/progmodes/grep.el
View file @
c89be45f
...
...
@@ -476,17 +476,23 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
"Handle match highlighting escape sequences inserted by the grep process.
This function is called from `compilation-filter-hook'."
(
save-excursion
(
let
((
end
(
point-marker
))
)
;; Highlight grep matches and delete marking sequences.
(
forward-line
0
)
(
let
((
end
(
point
)))
(
goto-char
compilation-filter-start
)
(
while
(
re-search-forward
"\033\\[01;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
)
(
while
(
re-search-forward
"\033\\[[0-9;]*[mK]"
end
1
)
(
replace-match
""
t
t
)))))
(
forward-line
0
)
;; 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
)
(
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
)
(
while
(
re-search-forward
"\033\\[[0-9;]*[mK]"
end
1
)
(
replace-match
""
t
t
))))))
(
defun
grep-probe
(
command
args
&optional
func
result
)
(
let
(
process-file-side-effects
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment