* 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.
* printing.el (pr-file-list): Comment out bindings of
pop-up-windows and pop-up-frames.
* mail/reporter.el (reporter-submit-bug-report): Use
pop-to-buffer-other-window and display specifiers.
* mail/sendmail.el (mail-bury): Do something similar to
quit-restore-window.
(top-level): Don't change same-window-buffer-names via add-hook
any more.
(mail): Use pop-to-buffer-same-window.
(mail-other-window): Use pop-to-buffer-other-window.
(mail-other-frame): Use pop-to-buffer-other-frame.
* simple.el (display-message-or-buffer): Rename argument FRAME
to IGNORE because it's ignored. Change call to display-buffer
accordingly.
(sendmail-user-agent-compose): Remove let bindings around call
to switch-function; the latter should have been bound to an
appropriate function already.
(clone-buffer): Call pop-to-buffer-other-window.
(clone-indirect-buffer): New semantices of display-flag
argument.
(clone-indirect-buffer-other-window): Interactively set
display-flag to 'other-window.
* calendar/solar.el (sunrise-sunset): Use with-help-window instead
of with-output-to-temp-buffer.
* textmodes/bibtex.el (bibtex-search-entry): Use
pop-to-buffer-same-window.
* cmuscheme.el (run-scheme): Use pop-to-buffer-same-window.
(top-level): Remove autoloaded add-hook for
same-window-buffer-names.
* eshell/eshell.el (eshell-add-to-window-buffer-names)
(eshell-remove-from-window-buffer-names): Remove.
(eshell-unload-hook): Don't call
eshell-remove-from-window-buffer-names.
(eshell-buffer-name): Don't call
eshell-remove-from-window-buffer-names and
eshell-add-to-window-buffer-names.
(top-level): Remove eshell-deftest call to check for
same-window-buffer-names.
(eshell): Call pop-to-buffer-same-window.
* files.el (display-buffer-other-frame): Remove.
* ielm.el (top-level): Remove autoloaded add-hook for
same-window-buffer-names.
(ielm): Use pop-to-buffer-same-window.
* progmodes/inf-lisp.el (inferior-lisp): Use
pop-to-buffer-same-window.
(top-level): Remove autoloaded add-hook for
same-window-buffer-names.
(switch-to-lisp): Use pop-to-buffer with tailored specifiers.
* replace.el (occur-mode-goto-occurrence): Use
pop-to-buffer-other-window.
(occur-mode-display-occurrence): Use
display-buffer-other-window.
* shell.el (shell): Use pop-to-buffer-same-window.
(top-level): Remove autoloaded add-hook for
same-window-buffer-names.
* net/rlogin.el: (top-level): Remove autoloaded add-hook for
same-window-regexps.
(rlogin): Use pop-to-buffer-same-window.
* net/telnet.el (top-level): Remove two autoloaded add-hooks for
same-window-regexps.
(telnet, rsh): Use pop-to-buffer-same-window.
* 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'.
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.
* 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.
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)
(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.
(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.