Commit graph

296 commits

Author SHA1 Message Date
Juri Linkov
46c5cf6650 * lisp/progmodes/grep.el (grep-process-setup): Don't check code for 1
because `zgrep' returns 1 for successful matches.

Fixes: debbugs:9226
2011-09-18 23:20:08 +03:00
Juri Linkov
bfe5d7f0e3 (grep-regexp-alist): Move dangling comment to the previous rule. 2011-09-08 15:07:52 +03:00
Juri Linkov
0527e251e5 * lisp/progmodes/grep.el (grep-regexp-alist): Calculate column positions
based on text properties put by `grep-filter' instead of matching
escape sequences.
(grep-mode): Set buffer-local `compilation-error-screen-columns'
to the value of `grep-error-screen-columns'.

Fixes: debbugs:9438
2011-09-07 15:00:52 +03:00
Oleksandr Gavenko
453de99fd0 * lisp/progmodes/grep.el (rgrep): Add "-type d".
Fixes: debbugs:9414
2011-09-05 12:55:11 +03:00
Juri Linkov
904399061f * lisp/progmodes/grep.el (grep-process-setup): Fix comments.
Fixes: debbugs:8084
2011-09-05 12:48:26 +03:00
Juri Linkov
f62bd84655 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=".

Fixes: debbugs:9408
2011-09-05 11:20:02 +03:00
Juri Linkov
262a14396d * lisp/progmodes/grep.el (grep-process-setup): Use `buffer-modified-p'
to check for empty output.

Fixes: debbugs:9226
2011-08-22 12:54:38 +03:00
Juri Linkov
02b404de99 * lisp/progmodes/grep.el (rgrep): Handle the case when `grep-find-command'
is a cons cell.

Fixes: debbugs:9278
2011-08-17 20:11:49 +03:00
Juri Linkov
ac8cf6e698 * lisp/progmodes/grep.el (rgrep): Don't bind `process-connection-type'.
This finishes incomplete reversion of 2011-06-30T01:09:13Z!larsi@gnus.org (2011-06-30)
intended by 2011-07-06T15:49:19Z!larsi@gnus.org (2011-07-06).
2011-08-10 21:29:31 +03:00
Lars Magne Ingebrigtsen
12b167347f * progmodes/grep.el (rgrep): Don't bind `process-connection-type', because that makes the colours go away. 2011-07-06 17:49:19 +02:00
Lars Magne Ingebrigtsen
bb6177177b (rgrep): Bind `process-connection-type' to nil, because using a pty is apparently too slow (bug #895). 2011-06-30 03:09:13 +02:00
Stefan Monnier
79106a44d3 * lisp/progmodes/grep.el (grep-mode): Fix it for good!
Fixes: debbugs:8684
2011-05-22 14:19:24 -03:00
Stefan Monnier
b7cf2c79c7 * lisp/progmodes/grep.el (grep-mode): Fix last change.
Fixes: debbugs:8684
2011-05-21 20:18:22 -03:00
Stefan Monnier
1d99a745e2 * lisp/progmodes/grep.el (grep-mode): Disable default
compilation-directory-matcher setting.

Fixes: debbugs:8684
2011-05-17 15:14:30 -03:00
Stefan Monnier
c89be45f2e * lisp/progmodes/grep.el (grep-filter): Don't trip on partial lines. 2011-05-12 12:10:17 -03:00
Chong Yidong
d9c54a06a0 Perform grep-mode's buffer modifications in a process filter (Bug#7952)
* progmodes/grep.el (grep-mode-font-lock-keywords): Remove
buffer-changing entries.
(grep-filter): New function.
(grep-mode): Add it to compilation-filter-hook.

* progmodes/compile.el (compilation-filter-hook)
(compilation-filter-start): New defvars.
(compilation-filter): Call compilation-filter-hook prior to
updating the process mark.
2011-05-08 01:17:17 -04:00
Glenn Morris
f3ca7378c1 Use find -exec with '+' for grep-find if supported.
* lisp/progmodes/grep.el (grep-find-use-xargs): Doc fix.
(grep-compute-defaults): Check for `-exec COMMAND +' support.
Set grep-find-use-xargs, grep-find-command, and grep-find-template
accordingly.  Don't add the null-device if not needed.
2011-04-02 11:52:08 -07:00
Glenn Morris
a915d7a1e5 grep.el fix for bug#8084.
* lisp/progmodes/grep.el (grep-highlight-matches): Doc fix.
(grep-process-setup): No highlighting without font-lock.
2011-03-02 22:39:11 -08:00
Stefan Monnier
1a0a6cefcf * lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Adjust to
`message' -> `compilation-message' rename.

Fixes: debbugs:8004
2011-02-10 14:13:31 -05:00
Stefan Monnier
07b741a76a Minor cleanup for compile.el and grep.el.
* lisp/progmodes/compile.el: Cleanup text-properties namespace by using
`compilation-message' instead of `message', `compilation-directory'
instead of `directory', and `compilation-debug' instead of `debug'.
(compilation-last-buffer, compilation-parsing-end)
(compilation-error-list, compilation-old-error-list): Move to the
compatibility part of the code.
(compilation-error-properties): If `file' is a function, let it return
a file name.
(compilation-mode-font-lock-keywords): Be more conservative with the
omake "^ *" pattern prefix, to try and minimize the risk of
pathologically slow regexp matching.
(compilation-start): Use inhibit-read-only.
(compilation--unsetup): New function.
(compilation-shell-minor-mode, compilation-minor-mode): Use it.
(compilation-filter): Minor tweaks.
(compilation-next-error-function): Try and avoid abusing variable names.
(compilation--flush-file-structure): New fun.
(compilation-fake-loc): Use it for cleaner behavior when file is reused.
(debug-ignored-errors): Add "Moved past last ...".
(compilation--compat-error-properties)
(compilation--compat-parse-errors): Rename by doubling the "-".

* lisp/progmodes/grep.el (grep-regexp-alist): Tighten regexp.
(grep-mode-font-lock-keywords): Remove regexp that seems like
a left-over from before we used compile.el.
(grep-mode-font-lock-keywords): Call syntax-ppss-flush-cache when
modifying the buffer within with-silent-modifications.
2011-01-28 16:11:19 -05:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Glenn Morris
362b9d483c Merge from emacs-23 branch. 2011-01-15 12:03:38 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Stefan Monnier
c04f2ac063 * lisp/progmodes/grep.el (grep-regexp-alist): Tighten the regexp.
Fixes: debbugs:7378
2010-11-17 09:54:15 -05:00
Juri Linkov
df9db1517e * progmodes/grep.el (grep-read-files): Fix multi-pattern aliases.
Remove "all" from grep-files-aliases.  Split grep-files-aliases by
whitespace, call wildcard-to-regexp on substrings and concat them
with "\\|".  (Bug#6114)
2010-05-21 23:43:04 +03:00
Chong Yidong
7860d2e357 * progmodes/grep.el (grep-compute-defaults): Fix handling of host
default settings (Bug#5928).
2010-04-14 11:33:42 -04:00
Juri Linkov
ad6fc8f44e * progmodes/grep.el (zrgrep): Call `grep-compute-defaults' at the
beginning of interactive spec like all other grep commands do.
Put "all" in front of "gz".  (Bug#5260)
2010-01-31 23:47:47 +02:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Juri Linkov
9136e89523 (grep-read-files): Use `completing-read'
instead of `read-string'.  Set its `collection' arg to
`read-file-name-internal'.  (Bug#4301)
2009-12-07 17:35:47 +00:00
Juri Linkov
a601d31340 Search recursively in gzipped files. (Bug#4982)
(grep-highlight-matches): Add new options
`always' and `auto'.  Doc fix.
(grep-process-setup): Check `grep-highlight-matches' for
`auto-detect' to determine the need to compute grep defaults.
Move Windows/DOS specific --colors settings handling
to `grep-compute-defaults'.  Check `grep-highlight-matches'
to get the value of "--color=".
(grep-compute-defaults): Compute `grep-highlight-matches' when it
has the value `auto-detect'.  Move Windows/DOS specific settings
from `grep-process-setup'.
(zrgrep): New command with alias `rzgrep'.
2009-11-25 17:23:45 +00:00
Juri Linkov
da205913b7 * find-dired.el (find-name-arg): Remove autoload. (Bug#4387)
* progmodes/grep.el (rgrep): Require `find-dired' for `find-name-arg'.
2009-11-19 17:37:22 +00:00
Dan Nicolaescu
2f7f4beee9 * progmodes/grep.el (grep-regexp-alist):
* international/mule-cmds.el (iso-2022-control-alist):
* emacs-lisp/timer.el (timer-duration-words):
* subr.el (version-separator, version-regexp-alist):
* minibuffer.el (completion-styles-alist):
* faces.el (face-attribute-name-alist, list-faces-sample-text):
Change defvars to defconsts.
2009-11-11 06:36:41 +00:00
Dan Nicolaescu
6bdad9ae02 * term/x-win.el (x-gtk-stock-map):
* progmodes/vera-mode.el (auto-mode-alist):
* progmodes/inf-lisp.el (inferior-lisp-filter-regexp)
(inferior-lisp-program, inferior-lisp-load-command):
* progmodes/hideshow.el (hs-special-modes-alist):
* progmodes/gud.el (same-window-regexps):
* progmodes/grep.el (grep-program, find-program, xargs-program):
* net/telnet.el (same-window-regexps):
* net/rlogin.el (same-window-regexps):
* language/ethiopic.el (font-ccl-encoder-alist):
* vc-sccs.el (vc-sccs-master-templates):
* vc-rcs.el (vc-rcs-master-templates):
* subr.el (cl-assertion-failed):
* simple.el (next-error-overlay-arrow-position):
* lpr.el (lpr-command):
* locate.el (locate-ls-subdir-switches):
* info.el (same-window-regexps, info)
(Info-goto-emacs-command-node, Info-goto-emacs-key-command-node):
* image-mode.el (image-mode, auto-mode-alist):
* hippie-exp.el (hippie-expand-ignore-buffers):
* format.el (format-alist):
* find-dired.el (find-ls-subdir-switches, find-grep-options)
(find-name-arg):
* facemenu.el (facemenu-keybindings):
* dired.el (dired-listing-switches, dired-chown-program):
* diff.el (diff-switches, diff-command):
* cus-edit.el (same-window-regexps):
* bindings.el (mode-line-mule-info)
(mode-line-buffer-identification): Purecopy strings.
2009-11-11 05:49:09 +00:00
Juanma Barranquero
5a0c3f568d Fix typos.
* allout.el
* dired-aux.el
* dired-x.el
* epa-file.el
* ps-print.el
* shell.el
* vc-hooks.el
* vc-rcs.el
* vc-sccs.el
* vc.el
* view.el
* wdired.el
* emacs-lisp/authors.el
* net/dig.el
* net/socks.el
* net/zeroconf.el
* obsolete/vc-mcvs.el
* progmodes/gdb-mi.el
* progmodes/grep.el
* progmodes/idlw-help.el
* progmodes/idlw-shell.el
* progmodes/idlwave.el
* progmodes/inf-lisp.el
* textmodes/bibtex.el
* textmodes/ispell.el
* textmodes/reftex-toc.el
2009-09-24 01:37:14 +00:00
Juri Linkov
7ae624301e (grep-template): Add "<X>" to docstring.
(grep-files-aliases): Add "all".  Move "el" and "ch" to the top of
the list.  Move "asm" to the bottom.
(grep-find-ignored-directories): Add `choice' with nil value
to empty the list easily.
(grep-find-ignored-files): New option.
(grep-files-history): Set to nil by default instead of '("ch" "el").
(grep-compute-defaults): Add "<X>" to `grep-template'.
(grep-read-files): Bind new local variables `default-alias' and
`default-extension'.  Use a list of default values for the file prompt.
(lgrep): Add `--exclude=' command line options composed from
`grep-find-ignored-files'.
(rgrep): Add `-name' command line options composed from
`grep-find-ignored-files'.  (Bug#4301)
2009-09-10 00:58:15 +00:00
Juri Linkov
6830f44933 (grep-read-files): Strip trailing <N> from buffer names
not visiting a file (e.g. cloned buffers).
2009-08-30 23:47:11 +00:00
Michael Albinus
458c8d31e4 * progmodes/grep.el (grep-probe): Let-bind `process-file-side-effects' with nil. 2009-08-25 10:11:08 +00:00
Juri Linkov
32a2cf25a7 (lgrep, rgrep): At the beginning
set `dir' to `default-directory' unless `dir' is a non-nil
readable directory.  (Bug#4052)
(lgrep, rgrep): Change a weird way to report an error
from using `read-string' to using `error'.
Instead of using interactive arguments in the function body,
add new argument `confirm'.
2009-08-22 00:17:56 +00:00
Juri Linkov
770f36f8bd (lgrep): Ensure that `default-directory' is always non-nil. (Bug#4052) 2009-08-12 20:54:46 +00:00
Sam Steingold
49405d0e1b (rgrep): Allow grep-find-ignored-directories
to be a cons cell (test . ignored-directory) to selectively ignore
some directories depending on the location of the search.
2009-07-08 14:23:57 +00:00
Chong Yidong
d4bbd646f4 * progmodes/grep.el (grep-compute-defaults): Simplify how settings
are looked up.
(grep-apply-setting): New function.
(grep-highlight-matches, grep-command, grep-template)
(grep-use-null-device, grep-find-command, grep-find-template):
Clarify role of grep-compute-defaults in docstrings.  Use
grep-apply-setting to apply changes (Bug#3343).
2009-05-23 00:11:53 +00:00
Eli Zaretskii
8f0e19afc8 (grep-process-setup) [windows-nt msdos]: Use "--color=always". 2009-02-28 17:26:00 +00:00
Juri Linkov
5d91db30c6 (grep-mode-map): Put grep-find before grep and
change its title from "Recursive grep..." to "Grep via Find...".
Add menu items for lgrep and rgrep.
2009-01-25 00:55:22 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Chong Yidong
30b724916f (grep-mode-tool-bar-map): Check if tool-bar-map has been initialized
before setting it up.
2008-10-12 13:46:13 +00:00
Chong Yidong
ecad93d232 (grep-mode-tool-bar-map): Initialize it unconditionally. 2008-10-11 19:58:49 +00:00
Dan Nicolaescu
01623c2898 (grep-files-aliases): Improve the C++ source
pattern and add patterns for C++ header files.
2008-07-11 02:44:10 +00:00
Sam Steingold
86c7460fae (compilation-minor-mode-map, compilation-mode-map):
Bind "g" to recompile and "q" to quit-window.
(grep-mode-map): Use `set-keymap-parent' to connect it
to `compilation-minor-mode-map' (instead of an explicit `cons').
2008-05-08 17:28:05 +00:00