* lisp/isearch.el (minibuffer-lazy-highlight-setup): Modify hooks
buffer-locally, so that recursive minibuffers are not affected by the
special behavior of lazy-highlight. Also make
'isearch-filter-predicate' buffer-local, so that isearch in the
minibuffer is not affected by the region filter (bug#55110).
* doc/emacs/killing.texi (Secondary Selection): Document it.
* lisp/isearch.el (isearch-mouse-2): Make isearch respond to
mouse-yank-at-point (bug#7787).
* lisp/mouse.el (mouse-yank-at-point): Mention it.
The new API was discussed in bug#53126. It's more robust and easier
to use in complex cases like that of 'query-replace'.
* etc/NEWS: Amend the feature announcement
* lisp/isearch.el (isearch-edit-string): Use new API.
(minibuffer-lazy-highlight-transform,
minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count,
minibuffer-lazy-highlight--after-change,
minibuffer-lazy-highlight--exit) Remove helper functions, which are
now kept together with the lazy highlight configuration variables
within a closure.
(minibuffer-lazy-highlight-setup): This function now takes the lazy
highlighting configuration variables as argument, and returns a
closure that is intended to run as part of the minibuffer setup.
* lisp/dired-aux.el (dired-isearch-filenames-mode): Use
dired-isearch-search-filenames on isearch-search-fun-function
instead of dired-isearch-filter-filenames on isearch-filter-predicate.
(dired-isearch-filter-filenames): Remove function.
(dired-isearch-search-filenames): Add function.
* lisp/isearch.el (isearch-message-prefix): Add isearch-search-fun-function
to the list of supported advice-functions along with isearch-filter-predicate.
* lisp/replace.el (replace-search): Add comment.
* lisp/wdired.el (wdired-search-replace-filenames): New defcustom.
(wdired-isearch-filter-read-only): Remove function.
(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
Add and remove dired-isearch-search-filenames on isearch-search-fun-function
instead of wdired-isearch-filter-read-only on isearch-filter-predicate.
Also set/unset replace-search-function and replace-re-search-function.
Remove and restore isearch-mode-hook with dired-isearch-filenames-setup.
The problem is that dired-isearch-filenames-setup adds
dired-isearch-filenames-end to isearch-mode-end-hook that removes
dired-isearch-search-filenames added to isearch-search-fun-function
in wdired-change-to-wdired-mode. Then replace-highlight can't use
dired-isearch-search-filenames.
* lisp/isearch.el (isearch-lazy-highlight-buffer-update): Run
'isearch-lazy-count-update-hook' outside of save-excursion, so point
is at the current match.
* lisp/isearch.el (isearch-yank-char-in-minibuffer): Select the
original window in order to restore point. This is needed when
minibuffer lazy highlight is in effect.
* lisp/isearch.el (minibuffer-lazy-highlight-setup): New function, can
be added to 'minibuffer-setup-hook' to enable lazy highlight and count
while reading from minibuffer.
(minibuffer-lazy-count-format, minibuffer-lazy-highlight-transform,
minibuffer-lazy-highlight--overlay, minibuffer-lazy-highlight--count,
minibuffer-lazy-highlight--after-change,
minibuffer-lazy-highlight--exit): Auxiliary variables and functions
implementing the lazy highlight functionality while reading from
minibuffer.
* lisp/isearch.el (lazy-count-update-hook): New hook allowing to
display the lazy count in special ways.
(isearch-lazy-highlight-new-loop,
isearch-lazy-highlight-buffer-update): Run `lazy-count-update-hook' at
appropriate times.
* lisp/comint.el (comint-history-isearch-setup,
comint-history-isearch-end): Make sure no lazy count is displayed.
* lisp/simple.el (minibuffer-history-isearch-setup): Make sure no lazy
count is displayed.
* lisp/isearch.el (isearch-menu-bar-map, isearch-emoji-by-name):
Fix wording of documentation.
* etc/NEWS: Fix wording of the 'isearch-emoji-by-name' entry.
* doc/emacs/search.texi (Special Isearch): Fix wording of the
documentation of 'isearch-emoji-by-name'; move it out of the
enumeration that deals with non-ASCII characters in general.
* lisp/isearch.el (isearch-emoji-by-name): Add a new command to insert
Emoji characters into incremental search strings. (Bug#52605)
(isearch-mode-map): Bind it to 'C-x 8 e RET'.
(isearch-menu-bar-map): Add it to the menu bar.
* doc/emacs/search.texi (Special Isearch): Update the documentation to
mention the new command.
* etc/NEWS: And advertise it.
* lisp/isearch.el (isearch-message-prefix): Display "Pending"
only when isearch-adjusted is 't' (bug#52356).
(isearch-define-mode-toggle):
Set isearch-adjusted to 'toggle' instead of 't'.
(isearch-search-fun-default):
Set isearch-adjusted to 'lax' instead of 't'.
(isearch-filter-visible): Move text-property-not-all higher
to not call isearch-range-invisible on inhibit-isearch text.
Remove min/max since arguments are always in the right order.
* lisp/help.el (help--analyze-key): Use posn-set-point instead of
mouse-set-point that runs the hook mouse-leave-buffer-hook via
mouse-minibuffer-check. Using posn-set-point also unnecessitates
extra conditions added in bug#51421.
* lisp/isearch.el (isearch-describe-key, isearch-describe-mode):
Add precautions to not call isearch-update when the executed
command exited isearch-mode (bug#51173).
* doc/lispref/text.texi (Special Properties): Mention it.
* lisp/image.el (insert-image): Make `C-s' skip over the image data.
* lisp/isearch.el (isearch--search-skip-inhibited): New function.
(isearch-search-string): Use it.
(isearch--invisible-p): New function.
(isearch-range-invisible): Use it.
* lisp/isearch.el (beginning-of-buffer, end-of-buffer)
(scroll-up-command, scroll-down-command): Evaluate the lambdas
inside the isearch-motion properties of these commands.
* lisp/isearch.el: Add recenter to 'isearch-motion' property of
'end-of-buffer' to maximize the number of search hits on the screen.
In 'isearch-motion' property of 'scroll-up-command' use 'recenter 0'
for the first line of the screen.
(isearch-beginning-of-buffer)
(isearch-end-of-buffer): Sync logic from 'isearch-allow-motion' part
of isearch-pre-command-hook. Direct users to isearch-allow-motion
in the docstrings.
(isearch-pre-command-hook): Don't override shifted 'isearch-yank-on-move'
in 'isearch-allow-motion'.
* lisp/isearch.el (isearch-allow-motion,
isearch-motion-changes-direction): New user options.
(isearch-pre-command-hook): Handle the new options.
* etc/NEWS: Mention the new user options.
* doc/emacs/search.texi: Document the new user options.
* lisp/isearch.el (isearch-beginning-of-buffer)
(isearch-end-of-buffer): Fix their behavior when
isearch-repeat-on-direction-change is non-nil (bug#50466).
* lisp/isearch.el (search-whitespace-regexp): Change the default
to always exclude newlines from the set (bug#21278). It used to
be mode-dependent whether newlines were included or not, and this
was confusing as a user interface.
* lisp/isearch.el (isearch-search): Move (= (match-beginning 0) (match-end 0))
and (bobp)/(eobp) outside the call to isearch-filter-predicate.
Use forward-char 1/-1 on empty matches only when going to retry search.
(isearch-lazy-highlight-search): Remove (= (point) bound),
but leave (= (match-beginning 0) (match-end 0)) since empty matches
make no sense in lazy-highlighting.