Set `isearch-lazy-highlight-start' and `isearch-lazy-highlight-end'
to `isearch-other-end' if it is not nil.
* lisp/replace.el (replace-highlight): Let-bind `isearch-other-end'
to `match-beg'.
* lisp/textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
Let-bind `isearch-other-end' to `start', `isearch-forward' to t
and `isearch-error' to nil.
Fixes: debbugs:13402
variables deeper to the loop that searches for the next match.
Add bindings for `isearch-nonincremental' and `isearch-adjusted'.
Use `isearch-search-fun-default' instead of `isearch-search-fun'.
* lisp/isearch.el (isearch-search-fun-default): Check for null
first element of isearch-cmds as a precaution when it's used
with inactive isearch.
Fixes: debbugs:13579
* doc/emacs/maintaining.texi (Tags Search): Change link "Replace" to
"Query Replace".
* lisp/replace.el (query-replace-help): Mention multi-buffer replacement
keys in the Help message.
Fixes: debbugs:12655
(query-replace-read-from): Add the last incremental search string
to the list of default values accessible via M-n.
(map-query-replace-regexp): Use `read-regexp'.
(query-replace, query-replace-regexp, query-replace-regexp-eval)
(map-query-replace-regexp, replace-string, replace-regexp):
Fix docstrings to replace mentions of `query-replace-interactive'
with alternatives.
Fixes: debbugs:12526
of `read-from-minibuffer' when `regexp-flag' is non-nil.
(occur-read-primary-args): Use `read-regexp' instead of
`read-string'.
(multi-occur-in-matching-buffers): Use `read-regexp' instead of
`read-from-minibuffer'.
* lisp/isearch.el (isearch-occur): Use `read-regexp' instead of
`read-string'.
* lisp/dired.el (dired-read-regexp): Use `read-regexp' instead of
`read-from-minibuffer'.
* lisp/progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead
of `read-string'.
Fixes: debbugs:7567
(replace-lax-whitespace, query-replace-regexp)
(query-replace-regexp-eval, replace-regexp): Doc fix.
(perform-replace, replace-highlight): Let-bind
isearch-lax-whitespace to replace-lax-whitespace and
isearch-regexp-lax-whitespace to replace-regexp-lax-whitespace.
* lisp/isearch.el (isearch-query-replace): Let-bind
replace-lax-whitespace to isearch-lax-whitespace and
replace-regexp-lax-whitespace to
isearch-regexp-lax-whitespace.
Fixes: debbugs:10885
* lisp/replace.el (query-replace-map): Bind four new symbols for
requesting window scrolling.
* lisp/subr.el (y-or-n-p): Handle the window-scrolling bindings in
query-replace-map.
* lisp/custom.el (custom-theme-load-confirm): Use y-or-n-p.
* lisp/window.el (scroll-other-window-down): Make the arg optional.
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys
since they are now in query-replace-map.
* doc/lispref/minibuf.texi (Yes-or-No Queries): Document recentering and
scrolling in y-or-n-p. Remove gratuitous example.
* doc/lispref/searching.texi (Search and Replace): Document window scrolling
entries in query-replace-map.
Fixes: debbugs:8948
(query-replace, query-replace-regexp, query-replace-regexp-eval)
(replace-string, replace-regexp): Mention it in docstrings.
(perform-replace, replace-highlight): Let-bind
isearch-lax-whitespace and isearch-regexp-lax-whitespace according
to the values of replace-lax-whitespace and regexp-flag.
Don't let-bind search-whitespace-regexp.
* lisp/isearch.el (isearch-query-replace): Let-bind
replace-lax-whitespace instead of let-binding
replace-search-function and replace-re-search-function.
(isearch-lazy-highlight-search): Let-bind isearch-lax-whitespace
and isearch-regexp-lax-whitespace to lazy-highlight variables.
(isearch-toggle-symbol): Set isearch-regexp to nil
in isearch-word mode (like in isearch-toggle-word).
Fixes: debbugs:10885
* lisp/replace.el (replace-search-function)
(replace-re-search-function): Set default values to nil.
(perform-replace): Let-bind isearch-related variables based on
replace-related values, call `isearch-search-fun' and let-bind
the result to `search-function'. Remove code that sets
`search-function' and `search-string' separately for
`delimited-flag'.
(replace-highlight): Add new argument `delimited-flag' and
rename other arguments to the names used in `perform-replace'.
Let-bind `isearch-word' to the argument `delimited-flag'.
* lisp/loadup.el (purify-flag): Pre-grow the hash-table to reduce the
memory use.
* lisp/bindings.el (bindings--define-key): New function.
* lisp/vc/vc-hooks.el, lisp/replace.el, lisp/menu-bar.el:
* lisp/international/mule-cmds.el, lisp/emacs-lisp/lisp-mode.el:
* lisp/buff-menu.el, lisp/bookmark.el:
* bindings.el: Use it to purecopy define-key bindings.
* src/fns.c (maybe_resize_hash_table): Output message when growing the
purify-hashtable.
* doc/lispref/searching.texi (Regexp Functions, Regexp Search):
(Simple Match Data, Saving Match Data, Standard Regexps): Copyedits.
(Regexp Functions): Mention regexp-opt is not guaranteed.
Mention regexp-opt-charset.
(Regexp Search): Recommend against looking-back.
(Search and Replace): Use Texinfo recommended quote convention.
Add more query-replace-map items. List multi-query-replace-map items.
* lisp/replace.el (query-replace-map): Doc fix.
* admin/FOR-RELEASE: Related markup.
(occur-edit-mode-map): Bind C-c C-c to occur-cease-edit and C-o to
occur-mode-display-occurrence.
(occur-edit-mode): Add usage message.
(occur-cease-edit): New command.
(occur-after-change-function): Use text properties to find the
position of the prefix text.
(occur-engine): Set stickiness of prefix text properties.
Fixes: debbugs:8463
to avoid using special-display-* and same-window-* variables.
* lisp/buff-menu.el (Buffer-menu-switch-other-window): Use second arg
of display-buffer.
(Buffer-menu-2-window): Use switch-to-buffer-other-window.
* lisp/replace.el (occur-mode-goto-occurrence)
(occur-mode-display-occurrence) Use second arg of pop-to-buffer
and display-buffer.
* lisp/window.el (display-buffer-alist): Add *Python*.
* lisp/mail/reporter.el (reporter-submit-bug-report): Use second arg of
display-buffer.
* lisp/mail/sendmail.el (sendmail-user-agent-compose): Don't bind the
special-display and same-window variables.
(mail-other-window): Use switch-to-buffer-other-window.
(mail-other-frame): USe switch-to-buffer-other-frame.
* lisp/progmodes/gdb-mi.el (gdb-frame-gdb-buffer): Use
display-buffer-other-frame.
(gdb-display-gdb-buffer): Use pop-to-buffer.
* lisp/progmodes/gud.el (gud-goto-info): Use info-other-window.
* lisp/progmodes/python.el: Don't set same-window-buffer-names.
* lisp/textmodes/bibtex.el (bibtex-search-entry): Use switch-to-buffer.
* lisp/replace.el (occur-menu-map, occur-edit-mode-map): New vars.
(occur-mode-map): Bind occur-edit-mode. Use occur-menu-map.
(occur-edit-mode): New major mode (Bug#8463).
(occur-after-change-function): New function.
(occur-engine): Give Occur tags a read-only property.
(occur-collect-regexp-history): New var.
(occur-read-primary-args): Return a replace string for nlines, if needed.
(occur): Extend the meaning of nlines.
* replace.el (replace-highlight): Bind isearch-forward and
isearch-error, ensuring that highlighting is updated if the user
switches the search direction (Bug#6808).
* isearch.el (isearch-lazy-highlight-forward): New var.
(isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search):
(isearch-lazy-highlight-update): Use it.
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.
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'.
Use `occur-engine-line' instead of duplicate code.
(occur-engine-line): New function created from duplicate code
in `occur-accumulate-lines' and `occur-engine'.