1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00
Commit Graph

809 Commits

Author SHA1 Message Date
Augusto Stoffel
e55b4074af Fix last change in minibuffer-lazy-highlight-setup
* lisp/isearch.el (minibuffer-lazy-highlight-setup): Apply advices
buffer-locally.
2022-05-18 21:55:34 +03:00
Augusto Stoffel
2b3f3d421a Make minibuffer lazy highlight setup buffer-local where appropriate
* 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).
2022-05-15 21:44:53 +03:00
Juri Linkov
cbd59395bd Add char-folding of double quotes in isearch-fold-quotes-mode (bug#24510)
* lisp/isearch.el (isearch-fold-quotes-mode): Add char-folding of
double quotation marks.

* test/lisp/subr-tests.el (test-local-set-state): Test values
after setting state.
2022-05-06 21:06:47 +03:00
Lars Ingebrigtsen
16dc1d597b Char-fold quotation characters in *info* and *Help*
* lisp/info.el (Info-mode):
* lisp/help-mode.el (help-mode): Use it.
* lisp/isearch.el (isearch-fold-quotes-mode): New minor mode
(bug#24510).
2022-05-06 13:28:20 +02:00
Eli Zaretskii
b3023de543 Merge from origin/emacs-28
# Conflicts:
#	lisp/progmodes/xref.el
2022-04-28 18:37:34 +03:00
Lars Ingebrigtsen
a7f2eb3054 Make isearch respond to 'mouse-yank-at-point'
* 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.
2022-04-27 14:02:23 +02:00
Eli Zaretskii
e93e31c895 ; Fix last change in isearch.el
* lisp/isearch.el (isearch-occur): Move the recent addition
to doc string from here...
(isearch-query-replace-regexp): ...to here.
2022-04-21 21:56:09 +03:00
Eli Zaretskii
16d1ab02af Add minimum instructions to 'query-replace' commands
* lisp/vc/vc-dir.el (vc-dir-query-replace-regexp):
* lisp/textmodes/reftex-global.el (reftex-query-replace-document):
* lisp/progmodes/project.el (project-query-replace-regexp):
* lisp/progmodes/etags.el (tags-query-replace):
* lisp/progmodes/ebrowse.el (ebrowse-tags-query-replace):
* lisp/isearch.el (isearch-query-replace, isearch-occur):
* lisp/emulation/viper-cmd.el (viper-query-replace):
* lisp/dired-aux.el (dired-do-query-replace-regexp)
(dired-do-find-regexp-and-replace):
* lisp/progmodes/xref.el (xref-query-replace-in-results):
* lisp/replace.el (query-replace, query-replace-regexp)
(query-replace-regexp-eval, map-query-replace-regexp): Add minimal
instructions for dealing with matches, with a link to the command
that shows the full instructions.  (Bug#55050)
2022-04-21 14:54:45 +03:00
Lars Ingebrigtsen
352fc739a1 Make isearch-lax-whitespace a user option
* lisp/isearch.el (isearch-lax-whitespace): Make into a defcustom
(bug#20351).
2022-04-18 13:36:05 +02:00
Augusto Stoffel
4c0c9d23ab Rewrite the minibuffer lazy highlight feature
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.
2022-04-10 22:36:47 +03:00
Juri Linkov
935cc42795 Add search function to search within filenames in Dired and WDired (bug#14013)
* 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.
2022-03-28 21:00:32 +03:00
Augusto Stoffel
d361144f61 Always run 'isearch-lazy-count-update-hook' with point at match
* 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.
2022-03-27 10:48:07 +03:00
Augusto Stoffel
ac3bb7e754 Fix regression in isearch-yank-char-in-minibuffer
* 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.
2022-03-23 22:06:07 +02:00
Augusto Stoffel
ceb57e10d6 Add lazy highlight to 'isearch-edit-string'
* lisp/isearch.el (isearch-edit-string): Activate lazy highlight and
lazy count, provided 'isearch-lazy-highlight' respectively
'isearch-lazy-count' are non-nil.
2022-03-20 22:25:35 +02:00
Augusto Stoffel
0f7c3f553f Allow lazy highlight and match count while reading from minibuffer
* 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.
2022-03-20 22:25:28 +02:00
Augusto Stoffel
3d204afe3c New hook, lazy-count-update-hook
* 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.
2022-03-20 22:25:12 +02:00
Lars Ingebrigtsen
a4eeea8124 Add a :distant-foreground to the lazy-highlight face
* lisp/isearch.el (lazy-highlight): Add a :distant-foreground
colour so that the text is always legible (bug#16969).
2022-02-05 23:46:02 +01:00
Juri Linkov
e241e77194 * lisp/isearch.el: Put 'isearch-scroll' property on two new symbols.
Put 'isearch-scroll' property on new commands 'recenter-other-window'
and 'context-menu-open'.
2022-01-29 20:55:17 +02:00
Eli Zaretskii
d983e080e0 Improve documentation of 'isearch-emoji-by-name'
* 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.
2022-01-13 16:40:28 +02:00
Daniel Martín
ecbe801989 Add isearch-emoji-by-name
* 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.
2022-01-12 19:49:50 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Juri Linkov
434c2cb2e9 * lisp/isearch.el: Don't display "Pending" for lax and toggle commands.
* 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'.
2021-12-19 19:47:36 +02:00
Juri Linkov
f247fa5d5c * lisp/isearch.el (isearch-delete-char): Reopen hidden overlays (bug#52248).
(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.
2021-12-04 22:04:37 +02:00
Stefan Kangas
48d1e6e9d9 Merge from origin/emacs-28
f38dfa56a0 ; Update loaddefs files.
b3d4b18507 ; make change-history-commit
334ff0232e * lisp/repeat.el: Use same logic for repeat-check-key and ...
8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point ...

# Conflicts:
#	lisp/ldefs-boot.el
2021-12-02 17:34:10 +01: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
73754bc54c Adapt isearch help screen for variable-pitch-mode
* lisp/isearch.el (isearch-help-for-help-internal): Adapt for
'variable-pitch-mode', now that 'make-help-screen' uses that.
2021-11-21 21:05:47 +01:00
Juri Linkov
764341919f Simplify c8acc5fd92
* lisp/isearch.el (isearch-filter-visible): Add check if there are
no properties 'inhibit-isearch' in the search range,
instead of code of c8acc5fd92.
2021-11-07 20:13:01 +02:00
Lars Ingebrigtsen
c8acc5fd92 Introduce a new 'inhibit-isearch' text property
* 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.
2021-11-06 04:59:05 +01:00
Stefan Kangas
357d273d2e Remove redundant #' before lambda
* admin/unidata/unidata-gen.el (unidata-gen-table)
(unidata-gen-table-symbol, unidata-gen-table-integer)
(unidata-gen-table-numeric, unidata-gen-table-word-list)
(unidata-describe-decomposition):
* lisp/apropos.el (apropos-user-option):
* lisp/bookmark.el (bookmark-bmenu-search):
* lisp/composite.el (unicode-category-table):
* lisp/elec-pair.el (electric-pair--balance-info):
* lisp/electric.el (electric-quote-chars):
* lisp/emulation/cua-base.el (cua-rectangle-mark-key):
* lisp/epa-hook.el (epa-file-encrypt-to):
* lisp/faces.el (face-font-selection-order)
(face-font-family-alternatives, face-font-registry-alternatives)
(face-valid-attribute-values, tty-run-terminal-initialization):
* lisp/files.el (recover-file, file-expand-wildcards):
* lisp/frame.el (frames-on-display-list):
* lisp/help-at-pt.el (help-at-pt-display-when-idle):
* lisp/help-fns.el (help-fns--face-attributes):
* lisp/ido.el (ido-mode, ido-unc-hosts):
* lisp/isearch.el (isearch-highlight-regexp)
(isearch-highlight-lines-matching-regexp):
* lisp/language/indian.el (script-regexp-alist):
* lisp/language/lao.el:
* lisp/leim/quail/ipa.el (ipa-x-sampa-prepend-to-keymap-entry):
* lisp/mh-e/mh-folder.el (mh-process-commands):
* lisp/mh-e/mh-mime.el (mh-display-with-external-viewer):
* lisp/ps-mule.el (ps-mule-end-job):
* lisp/ps-print.el (ps-color-scale, ps-background-pages)
(ps-background-text, ps-background-image, ps-background)
(ps-begin-job, ps-print-translation-table):
* lisp/recentf.el (recentf-sort-ascending)
(recentf-sort-descending, recentf-sort-basenames-ascending)
(recentf-sort-basenames-descending)
(recentf-sort-directories-ascending)
(recentf-sort-directories-descending):
* lisp/replace.el (occur-engine-add-prefix):
* lisp/select.el (xselect--encode-string):
* lisp/server.el (server-use-tcp):
* lisp/ses.el (ses-sort-column):
* lisp/sort.el (sort-columns):
* lisp/term/ns-win.el (window-system-initialization):
* lisp/tree-widget.el (tree-widget-image-formats):
* lisp/whitespace.el (whitespace-report-region): Remove redundant #'
before lambda.
2021-10-21 23:35:07 +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