* lisp/replace.el (query-replace-read-args): Split a non-negative arg
and a negative arg into separate elements.
(query-replace, query-replace-regexp, replace-string)
(replace-regexp): Add arg `backward'. Doc fix.
(replace-match-maybe-edit): When new arg `backward' is non-nil,
move point to the beginning of the match.
(replace-search, replace-highlight): Use new arg `backward'
to set the value of `isearch-forward'.
(perform-replace): Add arg `backward' and use it to perform
replacement backward.
* lisp/isearch.el (isearch-query-replace): Use a negative prefix arg
to call `perform-replace' with a non-nil arg `backward'.
Fixes: debbugs:14979
(isearch-mode): Set it to the initial value of `overriding-terminal-local-map'.
(isearch-pre-command-hook): Compare `overriding-terminal-local-map'
with `isearch--saved-overriding-local-map'.
Fixes: debbugs:16035
in add-hook and remove-hook for multi-buffer search.
* doc/lispref/searching.texi (Search and Replace): Fix `unread-command-events'
and add ref.
Fixes: debbugs:16035
to isearch-other-control-char.
(isearch-mode): Add isearch-pre-command-hook to pre-command-hook
and isearch-post-command-hook to post-command-hook.
(isearch-done): Remove isearch-pre-command-hook from pre-command-hook
and isearch-post-command-hook from post-command-hook.
(isearch-unread-key-sequence)
(isearch-reread-key-sequence-naturally)
(isearch-lookup-scroll-key, isearch-other-control-char)
(isearch-other-meta-char): Remove functions.
(isearch-pre-command-hook, isearch-post-command-hook):
New functions based on isearch-other-meta-char rewritten
relying on the new behavior of overriding-terminal-local-map
that does not replace the local keymaps any more.
Fixes: debbugs:15200
arg DONT-DOWNCASE-LAST of `read-key-sequence'.
(isearch-other-meta-char): Handle an undefined shifted printing
character by downshifting it.
Fixes: debbugs:15200
Rely on add-function instead.
* lisp/loadup.el: Preload nadvice.
* lisp/isearch.el (isearch-filter-predicates): Rename it back to
isearch-filter-predicate.
(isearch-message-prefix): Use advice-function-mapc and advice
properties to get the isearch-message-prefix.
(isearch-search, isearch-lazy-highlight-search): Revert to funcall
instead of run-hook-with-args-until-failure.
(isearch-filter-visible): Not obsolete any more.
* lisp/replace.el (perform-replace): Revert to funcall
instead of run-hook-with-args-until-failure.
* lisp/wdired.el (wdired-change-to-wdired-mode): Use add-function.
* lisp/dired-aux.el (dired-isearch-filenames-mode): Rename from
dired-isearch-filenames-toggle; make it into a proper minor mode.
Use add/remove-function.
(dired-isearch-filenames-setup, dired-isearch-filenames-end):
Call the minor-mode rather than add/remove-hook.
(dired-isearch-filter-filenames):
Remove isearch-message-prefix property.
* lisp/info.el (Info--search-loop): New function, extracted from Info-search.
Funcall isearch-filter-predicate instead of
run-hook-with-args-until-failure isearch-filter-predicates.
(Info-search): Use it.
(Info-mode): Use isearch-filter-predicate instead of
isearch-filter-predicates.
* src/lisp.mk (lisp): Add nadvice.elc.
* lib-src/makefile.w32-in (lisp2): Add nadvice.elc.
Fixes: debbugs:14714
possible search modes from `isearch-message-prefix' to the prompt.
(isearch-occur): Use `with-isearch-suspended' to not exit Isearch
when reading a regexp to collect.
* lisp/replace.el (perform-replace): Display "symbol " and other search
modes from `isearch-message-prefix' in the *Help* buffer.
string begins or ends in whitespace. The LAX arg is applied to
both ends of the search string. Use `regexp-quote' and explicit
\< and \> instead of \b. Use \` and \' instead of ^ and $.
(isearch-symbol-regexp): Sync with `word-search-regexp' where word
boundaries are replaced with symbol boundaries, and characters
between symbols match non-word non-symbol syntax.
Fixes: debbugs:14602
(isearch-other-meta-char): don't exit isearch when a prefix
argument is typed whilst `isearch-allow-prefix' is non-nil.
* search.texi (Isearch Scroll): Rename to "Not Exiting Isearch".
(Net Exiting Isearch): Document new user option
`isearch-allow-prefix'.
* etc/NEWS. Entry for this change.
* doc/emacs/display.texi (Highlight Interactively): Add global keybindings
with the key prefix `M-s h'. Document old command `highlight-phrase'.
Document new command `highlight-symbol-at-point'.
* lisp/bindings.el (search-map): Bind `highlight-symbol-at-point' to
`M-s h .'.
* lisp/hi-lock.el (highlight-symbol-at-point): New alias for the new
command `hi-lock-face-symbol-at-point'.
(hi-lock-face-symbol-at-point): New command.
(hi-lock-map): Bind `highlight-symbol-at-point' to `C-x w .'.
(hi-lock-menu): Add `highlight-symbol-at-point'.
(hi-lock-mode): Doc fix.
* lisp/isearch.el (isearch-forward-symbol-at-point): New command.
(search-map): Bind `isearch-forward-symbol-at-point' to `M-s .'.
(isearch-highlight-regexp): Add a regexp which matches
words/symbols for word/symbol mode.
* lisp/subr.el (find-tag-default-bounds): New function with the body
mostly moved from `find-tag-default'.
(find-tag-default): Move most code to `find-tag-default-bounds',
call it and apply `buffer-substring-no-properties' afterwards.
Fixes: debbugs:14427
(isearch-invisible): New variable.
(isearch-forward): Doc fix.
(isearch-mode): Set `isearch-invisible'
to the value of `search-invisible'.
(isearch-toggle-case-fold): Doc fix.
(isearch-toggle-invisible): New command.
(isearch-query-replace): Let-bind `search-invisible'
to the value of `isearch-invisible'.
(isearch-search): Use `isearch-invisible' instead of
`search-invisible'. Let-bind `search-invisible'
to the value of `isearch-invisible'.
Fixes: debbugs:11378
Doc fix.
(isearch-message-prefix): Display text from the property
`isearch-message-prefix' of the currently active filters.
(isearch-search): Don't compare `isearch-filter-predicate' with
`isearch-filter-visible'. Call `run-hook-with-args-until-failure'
on `isearch-filter-predicates'. Also check `search-invisible' for t
or call `isearch-range-invisible'.
(isearch-filter-visible): Make obsolete.
(isearch-lazy-highlight-search):
Call `run-hook-with-args-until-failure' on
`isearch-filter-predicates' and use `isearch-range-invisible'.
* lisp/info.el (Info-search): Call `run-hook-with-args-until-failure' on
`isearch-filter-predicates' instead of `funcall'ing
`isearch-filter-predicate'.
(Info-mode): Set `Info-isearch-filter' to
`isearch-filter-predicates' instead of `isearch-filter-predicate'.
* lisp/dired-aux.el (dired-isearch-filter-predicate-orig): Remove variable.
(dired-isearch-filenames-toggle, dired-isearch-filenames-setup)
(dired-isearch-filenames-end): Add and remove
`dired-isearch-filter-filenames' in `isearch-filter-predicates'
instead of changing the value of `isearch-filter-predicate'.
Rebind `dired-isearch-filenames-toggle' from "\M-sf" to "\M-sff".
(dired-isearch-filter-filenames): Don't use `isearch-filter-visible'.
Put property `isearch-message-prefix' to "filename " on
`dired-isearch-filter-filenames'.
* lisp/wdired.el (wdired-change-to-wdired-mode):
Add `isearch-filter-predicates' to `wdired-isearch-filter-read-only'
locally instead of changing `isearch-filter-predicate'.
(wdired-isearch-filter-read-only): Don't use `isearch-filter-visible'.
Fixes: debbugs:11378
instead of `isearch-nonincremental-exit-minibuffer'.
(isearch-edit-string): Remove mention of
`isearch-nonincremental-exit-minibuffer' from docstring.
(isearch-nonincremental-exit-minibuffer): Mark as obsolete.
(isearch-forward-exit-minibuffer)
(isearch-reverse-exit-minibuffer): Add docstring. (Bug#13348)
* doc/emacs/search.texi (Repeat Isearch): Mention key `RET' to finish
editing the string.
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
`isearch-insert-char-by-name'.
(with-isearch-suspended): New defmacro with body mostly from
`isearch-edit-string' except the part that sets
`isearch-new-string' and `isearch-new-message'.
(isearch-edit-string): Use new macro `with-isearch-suspended' with
body that sets `isearch-new-string' and `isearch-new-message'.
(isearch-insert-char-by-name): New command.
* lisp/international/mule-cmds.el (read-char-by-name): Let-bind
`enable-recursive-minibuffers' to t.
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00234.html
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
(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
http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00008.html
* lisp/isearch.el (search-whitespace-regexp): Doc fix.
Remove cons cell customization.
(isearch-mode-map): Bind "\M-s " to isearch-toggle-lax-whitespace.
(isearch-lax-whitespace, isearch-regexp-lax-whitespace):
New variables.
(isearch-forward, isearch-forward-regexp): Doc fix.
(isearch-toggle-lax-whitespace): New command.
(search-forward-lax-whitespace, search-backward-lax-whitespace)
(re-search-forward-lax-whitespace)
(re-search-backward-lax-whitespace): New functions.
(isearch-whitespace-regexp): Remove function.
(isearch-query-replace): Let-bind replace-search-function and
replace-re-search-function.
(isearch-occur): Let-bind search-spaces-regexp according to the
value of isearch-lax-whitespace and isearch-regexp-lax-whitespace.
(isearch-quote-char): Check isearch-regexp-lax-whitespace in the
condition for C-q SPC.
(isearch-search-fun-default): Use new functions mentioned above.
(isearch-search-forward, isearch-search-backward): Remove functions.
(isearch-search): Don't let-bind search-spaces-regexp.
(isearch-lazy-highlight-space-regexp): Remove variable.
(isearch-lazy-highlight-lax-whitespace)
(isearch-lazy-highlight-regexp-lax-whitespace): New variables.
(isearch-lazy-highlight-new-loop): Use them.
(isearch-lazy-highlight-search): Don't let-bind search-spaces-regexp.
* lisp/isearch.el (search-whitespace-regexp): Make string and nil
values apply to both ordinary and regexp search. Allow a cons
cell value to distinguish between the two.
(isearch-whitespace-regexp, isearch-search-forward)
(isearch-search-backward): New functions.
(isearch-occur, isearch-search-fun-default, isearch-search)
(isearch-lazy-highlight-new-loop): Use them.
(isearch-forward, isearch-forward-regexp): Doc fix.