1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00
Commit Graph

781 Commits

Author SHA1 Message Date
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Juri Linkov
8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point over mouse-set-point
* 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).
2021-12-01 19:36:00 +02:00
Stefan Kangas
285f59cbe2 * lisp/isearch.el (isearch-forward-regexp): Doc fix. (Bug22483) 2021-09-25 18:08:25 +02:00
Stefan Kangas
aebba085cb ; More minor stylistic fixes found by checkdoc 2021-09-22 20:26:40 +02:00
Lars Ingebrigtsen
85e9e5f616 Don't quote nil and t in doc strings and comments
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
* test/lisp/url/url-auth-tests.el
(url-auth-test-digest-auth-retrieve-cache):
* test/lisp/subr-tests.el (subr-tests-add-hook-depth):
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function):
* test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort):
* src/xfaces.c:
* src/process.c (Finterrupt_process):
(syms_of_process):
* src/minibuf.c (Fread_from_minibuffer):
(Fcompleting_read):
(syms_of_minibuf):
* src/dispnew.c (syms_of_display):
* src/data.c:
* lisp/so-long.el (so-long--hack-local-variables):
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
(elisp--xref-find-definitions):
* lisp/org/ox-html.el (org-html-htmlize-output-type):
* lisp/org/org-agenda.el (org-agenda-do-in-region):
* lisp/net/tramp.el:
* lisp/minibuffer.el (set-minibuffer-message):
* lisp/isearch.el (isearch-wrap-pause):
(isearch-repeat-on-direction-change):
* lisp/emacs-lisp/timer.el (timer):
* lisp/emacs-lisp/package.el (package-read-archive-contents):
* lisp/emacs-lisp/faceup.el (faceup-next-property-change):
* lisp/emacs-lisp/comp.el (comp-func):
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p):
* lisp/emacs-lisp/cl-macs.el (cl-do):
(cl-do*):
(cl--self-tco):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions):
(byte-compile-cond-jump-table): Don't quote t and nil.
2021-09-21 22:11:43 +02:00
Basil L. Contovounesios
ca6ae0d905 Evaluate recent isearch-motion lambdas
* 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.
2021-09-15 19:45:10 +01:00
Juri Linkov
a17bea6d63 * lisp/isearch.el: Improve 'isearch-allow-motion' feature (bug#50466)
* 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'.
2021-09-13 21:18:30 +03:00
Lars Ingebrigtsen
c1a1339526 Add some search-whitespace-regexp examples
* lisp/isearch.el (search-whitespace-regexp): Add some
alternatives in the defcustom.
2021-09-13 09:24:46 +02:00
Lars Ingebrigtsen
28ce3bf5c9 Further fix for the search-whitespace-regexp change
* lisp/isearch.el (search-whitespace-regexp): Fix yet another typo
in this one-line change (bug#21278).
2021-09-10 12:56:22 +02:00
Gregory Heytings
f3cfd47898 New user options to move between isearch matches
* 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.
2021-09-10 12:43:45 +02:00
Lars Ingebrigtsen
150ff9c157 Fix typo in previous search-whitespace-regexp change
* lisp/isearch.el (search-whitespace-regexp): Fix typo in last
checkin for this variable.
2021-09-10 12:42:22 +02:00
Gregory Heytings
061f8f2800 Fix behavior of isearch-{beginning,end}-of-buffer
* 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).
2021-09-10 12:39:33 +02:00
Lars Ingebrigtsen
74d091a0a6 Change the default value of search-whitespace-regexp
* 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.
2021-09-10 12:27:28 +02:00
Lars Ingebrigtsen
b099942113 isearch*-lax-whitespace doc string improvements
* lisp/isearch.el (isearch-regexp-lax-whitespace):
* lisp/isearch.el (isearch-lax-whitespace): Mention the key binding
in the doc string (bug#31790).
2021-09-02 09:57:30 +02:00
Juri Linkov
dd34bef7d3 Revert e061999559 that added save-match-data.
* lisp/isearch.el (isearch-filter-predicate): Mention precautions against
clobbering the match data in docstring (bug#49534).
2021-07-14 02:21:17 +03:00
Juri Linkov
e061999559 * lisp/isearch.el: Add save-match-data for funcall isearch-filter-predicate.
* lisp/isearch.el (isearch-search): Add save-match-data before
funcall isearch-filter-predicate.
(isearch-lazy-highlight-search): Add save-match-data before
funcall isearch-filter-predicate.
(Bug#49534)
2021-07-14 01:29:53 +03:00
Juri Linkov
35a8861619 Support Isearch filter predicates with empty search hits (bug#49534)
* 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.
2021-07-13 22:25:05 +03:00
Basil L. Contovounesios
5e0cf09f1e ; Bump isearch.el :version after recent change. 2021-06-01 20:13:33 +01:00
Glenn Morris
3dff854199 Remove unnecessary function declaration in isearch
* lisp/isearch.el (multi-isearch-switch-buffer):
Remove unnecessary declaration (after ldefs-boot update).
2021-06-01 08:52:47 -07:00
Juri Linkov
ef07d0b8c7 * lisp/isearch.el (lazy-highlight-buffer-max-at-a-time): Change from 20 to 200
Suggested by Augusto Stoffel <arstoffel@gmail.com> in bug#48581
2021-05-31 23:32:50 +03:00
Eli Zaretskii
fe8c1e7b1a Avoid byte-compiler warning during bootstrap
* lisp/isearch.el (multi-isearch-switch-buffer): Avoid
byte-compiler warning.
2021-05-21 13:37:48 +03:00
Juri Linkov
83be3e9598 * lisp/simple.el (read-from-kill-ring): Add new arg PROMPT (bug#48478).
* lisp/simple.el (yank-pop, yank-from-kill-ring):
* lisp/isearch.el (isearch-yank-from-kill-ring):
Use arg PROMPT in the call read-from-kill-ring.
2021-05-18 23:23:50 +03:00
Juri Linkov
25c775b4e9 * lisp/misearch.el (multi-isearch-switch-buffer): New function.
* lisp/isearch.el (isearch-search-string):
* lisp/misearch.el (multi-isearch-wrap, multi-isearch-pop-state): Use it.

https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00309.html
2021-05-09 22:27:08 +03:00
Eli Zaretskii
3021ecdedd Fix Isearch hscrolling in a corner case
* 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)
2021-04-22 14:01:42 +03:00
Juri Linkov
8c83231dae * lisp/isearch.el (isearch-forward-thing-at-point): New command (bug#39512).
(search-map): Bind "M-s M-." to isearch-forward-thing-at-point.
(isearch-forward-thing-at-point): New defcustom.
2021-04-21 23:39:27 +03:00
Juri Linkov
741dc6a8e8 * lisp/isearch.el (isearch-post-command-hook): Revert ff796823e5 (bug#47894). 2021-04-20 23:00:26 +03:00
Juri Linkov
c2fc0c7029 * lisp/isearch.el (isearch-mouse-2): Let-bind isearch-mode to nil (bug#47755) 2021-04-14 21:35:06 +03:00
Gregory Heytings
ff796823e5 Terminate isearch when point has moved to another buffer
* lisp/isearch.el (isearch-post-command-hook): Terminate isearch
when the command just executed has moved point to another buffer.
https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00309.html
2021-04-08 22:04:39 +03:00
Gregory Heytings
972bab0981 User option to move to another match when changing direction in isearch.
* 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.
2021-04-08 22:04:08 +03:00
Juri Linkov
151b202cf0 Don't set isearch-success in isearch-wrap functions
* 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)).
2021-04-07 19:47:09 +03:00
Juri Linkov
735ed235c7 * lisp/isearch.el (isearch-wrap-pause): New defcustom (bug#47599).
(isearch-repeat): Use it.
(isearch-search): Don't ding when isearch-wrap-pause is no-ding.
2021-04-06 22:15:30 +03:00
Stefan Kangas
4a112fd7a6 Add new face 'help-key-binding' for keybindings in help
* 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.
2021-03-08 04:23:08 +01:00
Juri Linkov
e6a4ef48fd * lisp/isearch.el: Minor doc fix. 2021-03-01 21:58:43 +02:00
Stefan Kangas
697aaafca3 Convert isearch menu to easymenu
* 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.
2021-02-28 00:07:32 +01:00
Stefan Kangas
46c501e762 Checkdoc fixes in isearch.el
* lisp/isearch.el (isearch--set-state, isearch-yank-pop-only)
(isearch-search-and-update, isearch-complete-edit, isearch-search):
Minor doc fixes.
2021-02-28 00:07:32 +01:00
Mattias Engdegård
de15ca7d00 Fix typos
* doc/lispref/display.texi (Size of Displayed Text):
* doc/lispref/windows.texi (Buffer Display Action Functions):
* etc/NEWS:
* etc/ORG-NEWS (Org-Attach has been refactored and extended):
* lisp/battery.el (display-battery-mode, battery--upower-subsribe):
* lisp/calendar/parse-time.el:
* lisp/dired-x.el:
* lisp/emacs-lisp/chart.el (chart-sequece, chart-bar-quickie):
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p)
(eldoc-documentation-strategy):
* lisp/emacs-lisp/pcase.el (pcase--split-pred, pcase--u1):
* lisp/gnus/gnus-search.el (gnus-search-expandable-keys)
(gnus-search-parse-query, gnus-search-query-return-string)
(gnus-search-imap, gnus-search-imap-search-command)
(gnus-search-transform-expression):
* lisp/gnus/nnselect.el:
* lisp/isearch.el (isearch-lazy-count-format):
* lisp/mh-e/mh-show.el (mh-show-msg):
* lisp/net/dictionary-connection.el (dictionary-connection-open):
* lisp/net/dictionary.el (dictionary-default-popup-strategy)
(dictionary, dictionary-split-string, dictionary-do-select-dictionary)
(dictionary-display-dictionarys, dictionary-search)
(dictionary-tooltip-mode):
* lisp/net/eudcb-macos-contacts.el (eudc-macos-contacts-set-server):
* lisp/net/mailcap.el (mailcap-mime-data):
* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection):
* lisp/nxml/nxml-mode.el (nxml-mode):
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cperl-mode.el (cperl-mode)
(cperl-fontify-syntaxically):
* lisp/progmodes/flymake.el (flymake-diagnostic-functions):
* lisp/progmodes/verilog-mode.el (verilog--supressed-warnings)
(verilog-preprocess):
* lisp/simple.el (self-insert-uses-region-functions):
* lisp/textmodes/bibtex.el (bibtex-copy-summary-as-kill):
* lisp/textmodes/texnfo-upd.el (texinfo-insert-master-menu-list):
* src/dispnew.c:
* src/font.c (Ffont_get):
* src/indent.c (compute_motion):
* src/process.c (init_process_emacs):
* src/w32fns.c (deliver_wm_chars):
* test/lisp/jsonrpc-tests.el (deferred-action-complex-tests):
Fix typos in documentation, comments, and internal identifiers.
2021-02-18 16:50:55 +01:00
Augusto Stoffel
6b0de9f830 Small correction to `isearch-lazy-highlight-buffer-update'
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
2021-02-13 20:30:25 +02:00
Glenn Morris
bd5b4b35bc Merge from origin/emacs-27
7355209f53 (origin/emacs-27) * lisp/window.el (recenter-top-bottom): ...
dc78f8a4ea (emacs-27) url-http.el: Special-case NTLM authentication
85b0137858 * lisp/isearch.el (isearch-lazy-highlight): Fix defcustom ...
cbeda21083 Sync latest SKK-JISYO.L
2021-02-03 08:11:08 -08:00
Juri Linkov
85b0137858 * lisp/isearch.el (isearch-lazy-highlight): Fix defcustom type (bug#46208) 2021-01-31 23:47:31 +02:00
Basil L. Contovounesios
42f45e52aa
; Improve defcustom :type in last change. 2021-01-30 19:09:46 +00:00
Augusto Stoffel
ece7425c22 Reduce flicker in Isearch mode
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
2021-01-30 20:48:28 +02:00
Juri Linkov
c8c4d65d65 Use isearch-tmm-menubar when tmm-menubar is called in isearch-mode (bug#43966)
* lisp/isearch.el (isearch-menu-bar-commands): Add tmm-menubar to defaults.
(isearch-mode-map): Remove remapping of tmm-menubar to isearch-tmm-menubar.

* lisp/tmm.el (tmm-menubar): Call isearch-tmm-menubar in isearch-mode.
2021-01-28 21:27:26 +02:00
Juri Linkov
e718d3a849 Better check for nil in search-/query-replace-highlight-submatches (bug#45973)
* lisp/isearch.el (isearch-highlight):
* lisp/replace.el (replace-highlight):
Use integer-or-marker-p to check matches.
2021-01-19 20:13:48 +02:00
Jared Finder
66ac17289a Make libraries works with xterm-mouse-mode.
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.
2021-01-15 13:50:07 +02:00
Glenn Morris
c83590b121 Merge from origin/emacs-27
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
2021-01-14 07:50:28 -08:00
Juri Linkov
488204cdc6 Remove one of recently added warnings abound binding keys in Isearch maps
* lisp/isearch.el (minibuffer-local-isearch-map): Remove comments
which warn against wantonly rebinding unbound keys from
irrelevant keymap.
https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00259.html
2021-01-13 20:32:36 +02:00
Juri Linkov
ebab8898ca * lisp/isearch.el: C-s C-u M-y reads a string from the kill-ring minibuffer
* 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
2021-01-13 20:19:22 +02:00
Glenn Morris
6f0bb2fe58 Merge from origin/emacs-27
7384ec6416 Add warning comments abound binding keys in Isearch maps
2021-01-04 07:50:22 -08:00
Eli Zaretskii
7384ec6416 Add warning comments abound binding keys in Isearch maps
* lisp/isearch.el (isearch-mode-map)
(minibuffer-local-isearch-map): Add comments which warn against
wantonly rebinding unbound keys.
2021-01-01 13:52:37 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00