Commit graph

500 commits

Author SHA1 Message Date
Juri Linkov
0ef84fc806 * replace.el (occur-accumulate-lines): Move occur-engine related
functions `occur-accumulate-lines' and `occur-engine-add-prefix'
to be located after `occur-engine'.
2010-03-30 19:38:45 +03:00
Juri Linkov
dc2d2590b2 Make occur handle multi-line matches cleanly with context.
http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01280.html

* replace.el (occur-accumulate-lines): Add optional arg `pt'.
(occur-engine): Add local variables `ret', `prev-after-lines',
`prev-lines'.  Use more arguments for `occur-context-lines'.
Set first elem of its returned list to `data', and the second elem
to `prev-after-lines'.  Don't print the separator line.
In the end, print remaining context after-lines.
(occur-context-lines): Add new arguments `begpt', `endpt',
`lines', `prev-lines', `prev-after-lines'.  Rewrite to combine
after-lines of the previous match with before-lines of the
current match and not overlap them.  Return a list with two
values: the output line and the list of context after-lines.

* search.texi (Other Repeating Search): Remove line that `occur'
can not handle multiline matches.

* occur-testsuite.el (occur-tests): Add tests for context lines.
2010-03-30 19:03:08 +03:00
Juri Linkov
47c88c067f * replace.el (occur-accumulate-lines): Fix a bug where the first
context line at the beginning of the buffer was missing.
2010-03-30 18:44:50 +03:00
Juri Linkov
774642e549 Implement Occur multi-line matches.
http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01044.html

* replace.el (occur): Doc fix.
(occur-engine): Set `begpt' to the beginning of the first line.
Set `endpt' to the end of the last match line.  At first, count
line numbers between `origpt' and `begpt'.  Split out code from
`out-line' variable to new let-bindings `match-prefix' and
`match-str'.  In `out-line' add non-numeric prefix to all
non-first lines of multi-line matches.  Finally, count lines
between `begpt' and `endpt' and add to `lines'.
2010-03-23 18:09:45 +02:00
Juri Linkov
53e87c57be * replace.el (occur-engine-line): Add optional arg `keep-props'.
(occur-accumulate-lines, occur-engine): Add arg `keep-props'.
2010-03-23 17:48:09 +02:00
Juri Linkov
f14d1172a2 * replace.el (occur-accumulate-lines, occur-engine):
Use `occur-engine-line' instead of duplicate code.
(occur-engine-line): New function created from duplicate code
in `occur-accumulate-lines' and `occur-engine'.
2010-03-23 09:16:57 +02:00
Juri Linkov
d66ecdbb4a Fix message of multi-line occur regexps and multi-buffer header lines.
http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00457.html

* replace.el (occur-1): Don't display regexp if it is longer
than window-width.  Use `query-replace-descr' to display regexp.
(occur-engine): Don't display regexp in the buffer header for
multi-buffer occur.  Display a separate header line with total
match count and regexp for multi-buffer occur.
Use `query-replace-descr' to display regexp.
2010-03-21 12:52:51 +02:00
Glenn Morris
84d0a5f881 Use query-replace-{from,to}-history-variable in more places.
* replace.el (query-replace-history): Give it a doc string.
(map-query-replace-regexp): Use query-replace-from-history-variable
and query-replace-to-history-variable.
2010-03-17 23:44:36 -07:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Juri Linkov
2952b1ae04 (perform-replace): Let-bind recenter-last-op to nil.
For def=recenter, replace `recenter' with `recenter-top-bottom'
that is called with `this-command' and `last-command' let-bound
to `recenter-top-bottom'.  When the last `def' was not `recenter',
set `recenter-last-op' to nil.  (Bug#4981)
2009-11-30 16:05:47 +00:00
Dan Nicolaescu
6d341a2a09 * textmodes/ispell.el (ispell-skip-region-alist):
* textmodes/css-mode.el (auto-mode-alist):
* progmodes/compile.el (auto-mode-alist):
* international/mule.el (ctext-non-standard-encodings-alist)
(ctext-non-standard-encodings-regexp):
* simple.el (shell-command-switch, text-read-only):
* replace.el (occur-mode-map):
* paths.el (rmail-file-name):
* jka-cmpr-hook.el (jka-compr-build-file-regexp):
* find-file.el (ff-special-constructs):
* files.el (file-name-handler-alist):
* composite.el: Purecopy strings.
2009-11-12 06:55:39 +00:00
Dan Nicolaescu
a3c20c832c * subr.el (menu-bar-separator): New defconst.
* replace.el (occur-mode-map):
* menu-bar.el (menu-bar-file-menu, menu-bar-search-menu)
(menu-bar-edit-menu, menu-bar-goto-menu, menu-bar-edit-menu)
(menu-bar-custom-menu, menu-bar-showhide-menu)
(menu-bar-options-menu, menu-bar-tools-menu)
(menu-bar-encryption-decryption-menu, menu-bar-describe-menu)
(menu-bar-search-documentation-menu, menu-bar-manuals-menu)
(menu-bar-help-menu):
* ediff-hook.el (menu-bar-ediff-menu, menu-bar-ediff-merge-menu):
* buff-menu.el (Buffer-menu-mode-map): Use menu-bar-separator.
2009-11-11 05:57:51 +00:00
Dan Nicolaescu
8f43cbf352 * puresize.h (BASE_PURESIZE): Increase to 1430000.
* term/tty-colors.el (msdos-color-values): Remove declaration, unused.
(color-name-rgb-alist, tty-standard-colors)
(tty-color-mode-alist): Change to defconst.

* simple.el (mark-inactive): Purecopy message.

* menu-bar.el (menu-bar-make-mm-toggle, menu-bar-make-toggle): Fix macro.
(global-map, yank-menu):
* textmodes/ispell.el (ispell-menu-map):
* net/eudc.el (eudc-tools-menu):
* international/mule-cmds.el (describe-language-environment-map)
(setup-language-environment-map, set-coding-system-map)
(mule-menu-keymap):
* vc-hooks.el (vc-menu-entry, vc-menu-map):
* replace.el (occur-mode-map):
* pcvs-defs.el (cvs-global-menu): Purecopy names and tooltips.

* bindings.el (propertized-buffer-identification): Purecopy
tooltip text.
2009-10-23 05:15:26 +00:00
Juri Linkov
99910cf46a (read-regexp): Return empty string when `default-value' is nil.
(keep-lines-read-args): Don't use empty string as the
default value for `read-regexp'.  (Bug#2495)
2009-08-12 20:56:25 +00:00
Chong Yidong
c4bf8039f5 (keep-lines-read-args): Use empty string as default (Bug#2495). 2009-02-27 15:31:36 +00:00
Glenn Morris
1e4bd40da2 Replace last-input-char with last-input-event. 2009-01-09 05:00:56 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Lute Kamstra
9201cc281b * align.el:
* allout.el:
* apropos.el:
* arc-mode.el:
* autoinsert.el:
* avoid.el:
* battery.el:
* bookmark.el:
* buff-menu.el:
* calculator.el:
* chistory.el:
* cmuscheme.el:
* comint.el:
* compare-w.el:
* dabbrev.el:
* delim-col.el:
* desktop.el:
* diff-mode.el:
* diff.el:
* dired-aux.el:
* dired-x.el:
* dired.el:
* dos-vars.el:
* ediff-diff.el:
* ediff-help.el:
* ediff-init.el:
* ediff-merg.el:
* ediff-mult.el:
* ediff-ptch.el:
* ediff-vers.el:
* ediff-wind.el:
* ediff.el:
* emerge.el:
* facemenu.el:
* faces.el:
* ffap.el:
* filecache.el:
* find-dired.el:
* font-core.el:
* font-lock.el:
* forms.el:
* fringe.el:
* help-at-pt.el:
* hippie-exp.el:
* ido.el:
* image-file.el:
* imenu.el:
* indent.el:
* info.el:
* isearchb.el:
* iswitchb.el:
* jit-lock.el:
* jka-compr.el:
* log-edit.el:
* lpr.el:
* ls-lisp.el:
* man.el:
* menu-bar.el:
* midnight.el:
* mouse-sel.el:
* mouse.el:
* msb.el:
* outline.el:
* paren.el:
* pcmpl-cvs.el:
* pcmpl-gnu.el:
* pcomplete.el:
* pcvs-info.el:
* pcvs-parse.el:
* printing.el:
* ps-mule.el:
* ps-print.el:
* replace.el:
* ruler-mode.el:
* saveplace.el:
* sb-image.el:
* scroll-bar.el:
* sha1.el:
* shadowfile.el:
* shell.el:
* sort.el:
* speedbar.el:
* strokes.el:
* tempo.el:
* term.el:
* terminal.el:
* time-stamp.el:
* time.el:
* tree-widget.el:
* type-break.el:
* vc-cvs.el:
* vc-hg.el:
* vc-mcvs.el:
* vc-rcs.el:
* vc-sccs.el:
* vc.el:
* view.el:
* w32-vars.el:
* whitespace.el:
* wid-edit.el: Remove leading * from docstrings of defcustoms,
deffaces, defconsts and defuns.
2008-12-03 05:48:14 +00:00
Juanma Barranquero
3f2372cbcb * replace.el (how-many): Fix typo in docstring.
Reported by Leo Liu <sdl.web@gmail.com>.
2008-10-22 11:11:01 +00:00
Juri Linkov
04ff2deeb3 (query-replace, query-replace-regexp)
(replace-string, replace-regexp, perform-replace): Add "word"
indicatiors to the prompt for word delimited replacements.
2008-10-19 22:34:35 +00:00
Juri Linkov
10965505b4 (read-regexp): Rename arg default' to default-value'. Doc fix. 2008-10-19 22:04:59 +00:00
Chong Yidong
f2e7b9ef88 (perform-replace): Don't set inhibit-read-only using
query-replace-skip-read-only (bug#956).
2008-09-12 00:37:41 +00:00
Juri Linkov
714da75728 (read-regexp): Add second arg `default'. Doc fix.
(occur-read-primary-args): Use `(car regexp-history)'
as the second arg of `read-regexp'.
2008-07-29 14:44:35 +00:00
Juri Linkov
b591f3387a (multi-query-replace-map): New variable.
(perform-replace): Add processing of new multi-buffer keys bound
to `automatic-all' and `exit-current'.  Set `query-flag' to nil
if last input char was `automatic-all'.  Set new local variable
`multi-buffer' to t when one of new two keys were typed.  Return
non-nil value of `multi-buffer' that tells to calling functions
to continue replacement on the next file.
2008-07-23 01:18:39 +00:00
Juri Linkov
96f606c5e6 (read-regexp): New function.
(keep-lines-read-args, occur-read-primary-args):
Call `read-regexp' instead of code moved to new function.
(keep-lines, flush-lines, how-many): Remove parenthesis and colon
from the end of prompt.
(replace-re-search-function): Doc fix.
2008-06-29 16:10:11 +00:00
Chong Yidong
c35a09fc44 (replace-search-function, replace-re-search-function): New vars.
(perform-replace): Use them.
2008-06-06 20:32:11 +00:00
Glenn Morris
eb3fa2cfcf Switch to recommended form of GPLv3 permissions notice. 2008-05-06 08:06:51 +00:00
Juri Linkov
360289a661 (occur-read-primary-args): Set default to the car of
regexp-history and display it in the prompt, but don't add to the
list of minibuffer defaults.  Bind history-add-new-input to nil to
not add automatically `default'.  For empty input return `default'.
Otherwise, add `input' to regexp-history and return it.
(occur-1): Signal an error for the empty regexp.
2008-05-01 23:55:44 +00:00
Dan Nicolaescu
a22f42ace8 (occur-mode-map): Add :help. 2008-03-21 06:12:35 +00:00
Carsten Dominik
8e62d5e855 * replace.el (occur-mode-find-occurrence-hook): New hook that can
be used to reveal or highlight the location of a match.
	(occur-mode-goto-occurrence)
	(occur-mode-goto-occurrence-other-window)
	(occur-mode-display-occurrence): Run
	`occur-mode-find-occurrence-hook'.
2008-01-23 10:49:31 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
409cc4a3ea Add 2008 to copyright years. 2008-01-07 02:45:14 +00:00
Richard M. Stallman
f8edc67ee2 (occur-context-lines): New subroutine, broken out of occur-engine.
(occur-engine): Call it.
2008-01-03 09:52:45 +00:00
Miles Bader
b17f53abc2 Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-966
2007-12-28 22:26:14 +00:00
Eli Zaretskii
fae97ed8b8 (regexp-history): Add reference to `history-length' in the doc string. 2007-12-22 17:10:17 +00:00
Juri Linkov
3be42fcdfb (keep-lines, flush-lines, how-many): Doc fix.
Check search-upper-case before calling isearch-no-upper-case-p
to set case-fold-search.
(occur): Doc fix.
(occur-1, perform-replace): Check search-upper-case before calling
isearch-no-upper-case-p to set case-fold-search.
2007-12-09 23:47:04 +00:00
Dan Nicolaescu
85ea5b19e4 (occur-mode-map): Add a major mode menu with entries
for all occur operations.
2007-11-22 03:01:36 +00:00
Juanma Barranquero
0ae03f1a09 (map-query-replace-regexp): Doc fix (revert part of 2000-05-21T17:04:47Z!fx@gnu.org
made with no ChangeLog entry).
2007-11-19 12:47:03 +00:00
Juanma Barranquero
d8f1d2f3a3 (map-query-replace-regexp): Doc fix (revert part of 2000-05-21T17:04:47Z!fx@gnu.org
made on 2000-05-21 with no ChangeLog entry).
2007-11-19 12:10:41 +00:00
Juri Linkov
7dc5b46da5 (keep-lines-read-args, occur-read-primary-args):
Use a list of default values for DEFAULT arg of read-from-minibuffer.
2007-11-16 01:20:20 +00:00
Juri Linkov
7abe68aa19 (query-replace-show-replacement): New defcustom.
(perform-replace): Use `match-substitute-replacement' if
`query-replace-show-replacement' is non-nil.
2007-11-10 21:49:19 +00:00
Miles Bader
9aecacd08a Merge from emacs--rel--22
Patches applied:

 * emacs--rel--22  (patch 70-73)

   - Update from CVS

2007-07-25  Glenn Morris  <rgm@gnu.org>

   * Relicense all FSF files to GPLv3 or later.

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-828
2007-07-26 05:28:10 +00:00
Glenn Morris
b4aa60262c Switch license to GPLv3 or later. 2007-07-25 04:50:21 +00:00
Stefan Monnier
26cc71affc (perform-replace): Use isearch-no-upper-case-p. 2007-07-23 21:32:32 +00:00
Dan Nicolaescu
5183d4c9a9 * replace.el (match): Use yellow1 instead of yellow.
* progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of
red.

* pcvs-info.el (cvs-unknown): Likewise.
2007-07-13 02:50:19 +00:00
David Kastrup
fc6a22502e * NEWS: Mention `query-replace-regexp-eval' being deprecated.
* replace.el (query-replace-regexp-eval): Deprecate.
2007-04-17 23:24:13 +00:00
Stefan Monnier
084c41ca0a (occur-next-error): *Occur* might not be displayed in the
selected frame.  Reported by David Hansen <david.hansen@gmx.net>.
2007-03-26 15:09:52 +00:00
Richard M. Stallman
330167fce8 (match): Use yellow background on light-bg terminals. 2007-03-11 23:53:38 +00:00
Chong Yidong
8121414a6a (occur-engine): buffer-undo-list binding moved...
(occur-1): ...to here.
2007-03-08 15:17:42 +00:00
Kim F. Storm
cde6fe5cd0 2007-03-01 Lennart Borgman <lennart.borgman.073@student.lu.se>
* replace.el (perform-replace): Propertize message.
2007-03-01 13:43:48 +00:00