* 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.
* lisp/isearch.el (isearch-update): When we start hscrolled,
consider also the case that point ends up being to the left of the
hscrolled window's edge. (Bug#46316)
* lisp/isearch.el (isearch-direction-change-changes-match):
New user option (bug#47599).
(isearch-repeat): Use the new option.
(isearch-repeat-forward, isearch-repeat-backward): Adapt to the
new option.
* etc/NEWS: Mention the new user option.
* doc/emacs/search.texi: Document the new user option.
* lisp/comint.el (comint-history-isearch-wrap):
* lisp/simple.el (minibuffer-history-isearch-wrap):
Don't set isearch-success to t, so isearch-repeat won't skip the
beginning of the wrapped match with (forward-char (if isearch-forward 1 -1)).
* lisp/faces.el (help-key-binding): New face.
* lisp/help.el
(help-for-help): Rename from 'help-for-help-internal'. Use
'substitute-command-keys' syntax.
(help): Make into alias for 'help-for-help'.
(help-for-help-internal): Make into obsolete alias for
'help-for-help'.
(help--key-description-fontified): New function to add the
'help-key-binding' face.
(help-key-description, substitute-command-keys)
(describe-map-tree, help--describe-command)
(help--describe-translation, describe-map):
* lisp/help-fns.el (help-fns--key-bindings, describe-mode):
Use above new function.
* lisp/isearch.el (isearch-help-for-help-internal): Use
`substitute-command-keys' syntax.
* lisp/help-macro.el (make-help-screen): Use
'substitute-command-keys' and 'help--key-description-fontified'.
Simplify.
* src/keymap.c (describe_key_maybe_fontify): New function to add
the 'help-key-binding' face to keybindings.
(describe_vector): Use above new keybinding.
(syms_of_keymap) <Qfont_lock_face, Qhelp_key_binding>: New
DEFSYMs.
(fontify_key_properties): New static variable.
* lisp/tooltip.el (tooltip-show): Avoid overriding faces in
specified tooltip text.
* test/lisp/help-tests.el (with-substitute-command-keys-test):
Don't test for text properties.
(help-tests-substitute-command-keys/add-key-face)
(help-tests-substitute-command-keys/add-key-face-listing):
New tests.
* lisp/isearch.el (isearch-menu-bar-yank-map)
(isearch-menu-bar-map, isearch-mode-map): Move menu definition
from here...
(isearch-menu-bar-map): ...to here, and convert to easymenu.
* lisp/loadup.el ("emacs-lisp/easymenu"): Move before isearch.el.
The value of point is now read after a potential change of buffer.
* lisp/isearch.el (isearch-lazy-highlight-buffer-update): Move call
to `point' after `select-window'.
Copyright-paperwork-exempt: yes
Lazy highlighting now happens immediately when the search string is at
least as long as the value of the new custom variable
`lazy-highlight-no-delay-length`. Also avoid updating the lazy
count in the echo area too often.
* isearch.el (lazy-highlight-no-delay-length): New defcustom.
* isearch.el (lazy-lazy-count-format): Avoid a momentarily incorrect
count when reversing search direction.
* isearch.el (isearch-lazy-highlight-new-loop): Avoid a call to
`isearch-message` that is quickly succeed by a second echo area
update, thus causing flicker.
* isearch.el (isearch-lazy-highlight-new-loop):
Start lazy highlight immediately if appropriate.
* etc/NEWS: Announce the change.
* doc/emacs/search.texi: Document `lazy-highlight-no-delay-length'.
Copyright-paperwork-exempt: yes
Change calls from 'read-event' to 'read-key' in libraries expecting
mouse events. Do this only when 'xterm-mouse-mode' is enabled. That
way those libraries read decoded mouse events instead of the
underlying escape sequence. Add a parameter to 'read-key' that avoids
running any of the unbound fallbacks in 'read-key-sequence' so the
libraries can read mouse button-down events.
For backward compatibility purposes, the above logic is contained in a
new internal-only function: 'read--potential-mouse-event'.
* doc/lispref/commands.texi (Reading One Event): Document new
parameter to 'read-key'. Mention that non-character events on
terminals need 'read-key'.
* lisp/subr.el (read-key-full-map): Add new keymap used by 'read-key'.
(read-key): Add new parameter 'fallbacks-disabled' to prevent running
any of the unbound fallbacks normally run by 'read-key-sequence'.
(read--potential-mouse-event): Add new function that calls 'read-key'
or 'read-event' depending on if 'xterm-mouse-mode' is set.
* lisp/foldout.el (foldout-mouse-swallow-events):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/mouse-drag.el (mouse-drag-throw, mouse-drag-drag):
* lisp/mouse.el (mouse-drag-secondary):
* lisp/ruler-mode.el (ruler-mode-mouse-grab-any-column)
(ruler-mode-mouse-drag-any-column-iteration):
* lisp/strokes.el (strokes-read-stroke, strokes-read-complex-stroke):
* lisp/textmodes/artist.el (artist-mouse-draw-continously)
(artist-mouse-draw-poly, artist-mouse-draw-2points):
* lisp/vc/ediff-wind.el (ediff-get-window-by-clicking):
* lisp/wid-edit.el (widget-button--check-and-call-button)
(widget-button-click): Call 'read--potential-mouse-event' instead of
'read-event'.
* lisp/wid-edit.el (widget-key-sequence-read-event): Call 'read-key'
with 'fallbacks-disabled' set instead of 'read-event'. Unlike above
changes, this is unconditionally applied so it works for function
keys too. Apply 'local-function-key-map' instead of
'function-key-map' as that contains the full terminal translations.
* lisp/vc/ediff.el (ediff-windows): Use 'display-mouse-p' to check if
a mouse is available.
* src/lread.c (Fread_event): Recommend 'read-key' in docstring for
'read-event' for non-character events.
488204cdc6 (origin/emacs-27) Remove one of recently added warnings ab...
55bc1560ac Fix assertion failure in window_box_height (Bug#45737)
27743e9e70 Fix cl-concatenate inlining
32a3758c84 Fix infloop in 'pixel-scroll-mode'
74d18957b8 Fix inhibiting the default.el loading in user init file
* lisp/isearch.el (isearch-yank-from-kill-ring): New command
with code moved from isearch-yank-pop.
(isearch-yank-pop): Use isearch-yank-from-kill-ring.
(isearch-yank-pop-only): Add optional arg, and call
isearch-yank-from-kill-ring when the prefix arg is C-u.
https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00089.html
* lisp/isearch.el (isearch-menu-bar-yank-map, isearch-mode-map):
(isearch-forward): Use isearch-yank-pop-only instead of isearch-yank-pop.
(isearch-yank-pop): Mention isearch-yank-pop-only.
(isearch-yank-pop-only): New command with old body from Emacs 27.