aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el (unfollow)
Commit message (Collapse)AuthorFilesLines
2026-02-11Revert "New key 'M-j' for 'icomplete-mode' (bug#62108)"Juri Linkov1-3/+0
This reverts commit 3584a762b8cbfb6e13011827ec5934f039344d0f. Another fix follows shortly after this commit.
2026-01-30New key 'M-j' for 'icomplete-mode' (bug#62108)Juri Linkov1-0/+3
* lisp/icomplete.el (icomplete-exit): New alias for 'icomplete-fido-exit'. (icomplete-minibuffer-map): Bind it to "M-j" . * lisp/replace.el (multi-occur--prompt): Show "M-j" bound to 'icomplete-exit' in 'icomplete-mode'.
2026-01-01; Add 2026 to copyright years.Sean Whitton1-1/+1
2025-12-26December 2025 spelling fixesPaul Eggert1-1/+1
Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
2025-12-20Add query-replace-read-transpose-from-toJens Schmidt1-4/+42
Provide a command to easily swap FROM and TO arguments in a query replace operation. * lisp/replace.el (query-replace-read-transpose-from-to): New function. (query-replace-read-map): New keymap. (query-replace-read-from): Use new keymap to read from minibuffer. (read-regexp-map): Inherit from 'query-replace-read-map'. (query-replace-read-from, query-replace-read-to): Fix parameter references in doc strings. * etc/NEWS: Document the change. (Bug#79835)
2025-12-01Override 'display-buffer-overriding-action' conditionally in perform-replaceJuri Linkov1-3/+6
* lisp/replace.el (perform-replace): For 'diff' display, override 'display-buffer-overriding-action' only when it has the default value. https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg01077.html
2025-11-24Fix query-replace-regexp for using '^' with calculated replacement '\,'Juri Linkov1-6/+10
* lisp/replace.el (replace--push-stack): Add new args 'next-replacement' and 'match-again' and push them to the stack. (perform-replace): Restore the previous already calculated values of 'next-replacement' and 'match-again' from the stack for the 'backup' ('^') key (bug#79811). * test/lisp/replace-tests.el (query-replace-tests): Add tests.
2025-11-20Show the diff buffer with replacements by typing 'd' in 'query-replace'Juri Linkov1-1/+13
* doc/emacs/search.texi (Query Replace): Mention new key 'd'. * lisp/replace.el (query-replace-help): Mention the key 'd'. (query-replace-map): Bind the key 'd' to 'diff'. (perform-replace): When 'def' is equal to 'diff', call 'multi-file-replace-as-diff' to show the diff buffer with replacements (bug#79761).
2025-11-13* lisp/replace.el (replace--push-stack, perform-replace): Use markersStefan Monnier1-21/+22
Don't use integers to store match data for "long term". Otherwise, buffer edits that occur between two steps (e.g. via process filters of post-command-hooks) makes it invalid, leading to very confusing behavior, e.g. after `C-M-% ... y` the right (next) match is highlighted yet if a process-filter or post-command-hook runs, the next `y` may replace something else than what was highlighted.
2025-10-18; Improve documentation of commands that split current windowEli Zaretskii1-1/+4
* doc/emacs/sending.texi (Sending Mail): * doc/emacs/dired.texi (Dired Enter, Dired Visiting): * doc/emacs/maintaining.texi (Old Revisions) (Change Log Commands, Looking Up Identifiers): * doc/emacs/windows.texi (Displaying Buffers): * doc/emacs/files.texi (Visiting): Add cross-references to where user options are described which control how windows are split. * lisp/mail/sendmail.el (mail-other-window): * lisp/gnus/message.el (message-mail-other-window) (message-news-other-window): * lisp/replace.el (occur-mode-goto-occurrence-other-window): * lisp/vc/vc.el (vc-revision-other-window): * lisp/vc/vc-dir.el (vc-dir-find-file-other-window): * lisp/progmodes/xref.el (xref-find-definitions-other-window): * lisp/simple.el (compose-mail-other-window) (clone-indirect-buffer-other-window): * lisp/vc/add-log.el (add-change-log-entry-other-window): * lisp/view.el (view-file-other-window) (view-buffer-other-window): * lisp/window.el (switch-to-buffer-other-window): * lisp/files.el (find-file-other-window) (find-file-read-only-other-window) (find-alternate-file-other-window): * lisp/dired.el (dired-other-window) (dired-mouse-find-file-other-window) (dired-find-file-other-window, dired-jump-other-window): Mention in the doc strings how to control the way the current window is split.
2025-07-07; Fix typosRobert Pluim1-1/+1
* lisp/emacs-lisp/warnings.el (warning-display-at-bottom): Fix typo. * lisp/replace.el (query-replace-help): Typo fix.
2025-07-05; * lisp/replace.el (query-replace-help): Fix help text (bug#78916).Eli Zaretskii1-7/+9
2025-05-22(perform-replace): Make it work with F-keys in TTYs (bug#78113)Stefan Monnier1-14/+15
* lisp/replace.el (perform-replace): Use `read-key`. * test/lisp/replace-tests.el (replace-tests-with-undo): Adjust accordingly.
2025-03-16Use defvar-keymap for some trivial keymapsStefan Kangas1-8/+6
* lisp/bindings.el (mode-line-window-dedicated-keymap) (mode-line-buffer-identification-keymap): * lisp/emulation/cua-rect.el (cua--overlay-keymap, cua--overlay-key): * lisp/mh-e/mh-mime.el (mh-mime-security-button-map): * lisp/mh-e/mh-utils.el (mh-hidden-header-keymap): * lisp/net/eudc-bob.el (eudc-bob-generic-keymap, eudc-bob-image-keymap) (eudc-bob-sound-keymap, eudc-bob-url-keymap, eudc-bob-mail-keymap): * lisp/progmodes/etags-regen.el (etags-regen-mode-map): * lisp/progmodes/octave.el (octave-help-mode-map): * lisp/replace.el (multi-query-replace-map): * lisp/simple.el (process-menu-mode-map, messages-buffer-mode-map): * lisp/startup.el (splash-screen-keymap): * lisp/tab-bar.el (tab-bar-mode-map): * lisp/textmodes/ispell.el (ispell-minor-keymap): * lisp/textmodes/tex-mode.el (latex-mode-map, plain-tex-mode-map): * lisp/tree-widget.el (tree-widget-button-keymap): * lisp/vc/vc-hooks.el (vc-mode-line-map): Use defvar-keymap.
2025-03-09Document return values of the various read-* functionsEli Zaretskii1-1/+1
* lisp/textmodes/string-edit.el (read-string-from-buffer): * lisp/simple.el (read-from-kill-ring, read-shell-command) (read-signal-name): * lisp/replace.el (read-regexp-case-fold-search): * lisp/auth-source.el (read-passwd): * lisp/subr.el (read-key, read-number): * lisp/minibuffer.el (read-file-name, read-no-blanks-input): * lisp/international/mule-cmds.el (read-multilingual-string): * lisp/language/japan-util.el (read-hiragana-string): * lisp/files-x.el (read-file-local-variable) (read-file-local-variable-mode, read-file-local-variable-value): * lisp/faces.el (read-face-font, read-face-name): * lisp/simple.el (read-extended-command): * lisp/env.el (read-envvar-name): * lisp/files.el (read-directory-name): * lisp/faces.el (read-color): * lisp/international/mule-diag.el (read-charset): * lisp/emacs-lisp/map-ynp.el (read-answer): * src/coding.c (Fread_coding_system) (Fread_non_nil_coding_system): * src/minibuf.c (Fread_command, Fread_from_minibuffer): * src/lread.c (Fread_char, Fread_char_exclusive, Fread_event): Doc fixes.
2025-02-18Don't access overriding-text-conversion-style when unboundPo Lu1-7/+6
* lisp/replace.el (perform-replace): Don't access overriding-text-conversion-style when unbound, and also avoid needlessly polluting this symbol with a binding. (bug#76371)
2025-02-17Adapt query-replace and lazy highlighting to text conversionPo Lu1-2/+17
* lisp/isearch.el (isearch-lazy-highlight-new-loop): Rather call redisplay to guarantee a valid window-start than sit-for, to account for cases where this function is called from an after-change-function bound to a special input event quickly followed by another event that does not modify the buffer. * lisp/progmodes/prog-mode.el (treesit-node-at): Declare function before references. * lisp/replace.el (perform-replace): When querying, suppress text conversion around the input loop.
2025-01-02Update copyright year to 2025Stefan Kangas1-1/+1
Run "TZ=UTC0 admin/update-copyright".
2025-01-01Update copyright year to 2025Paul Eggert1-1/+1
Run "TZ=UTC0 admin/update-copyright".
2024-12-12Make bindings--define-key obsoleteStefan Kangas1-2/+2
It used to be like 'define-key', but was used for making pure copies of as much of a menu's data as possible. With purespace now gone, it can be replaced by 'define-key'. * lisp/bindings.el (bindings--define-key): Make into obsolete alias for 'define-key'. Update all callers.
2024-07-28Add new optional argument NO-HIGHLIGHT to query-replace-read-argsVisuwesh1-2/+2
* lisp/replace.el (query-replace-read-args): Add new optional argument to disable regexp highlighting. * lisp/dired-aux.el (dired-do-query-replace-regexp) (dired-do-replace-regexp-as-diff) (dired-do-find-regexp-and-replace): Revert last change, and use the new argument instead. (bug#72147)
2024-03-14; Simplify (with-current-buffer (get-buffer ...) ...)Tim Landscheidt1-1/+1
There's no need to call 'get-buffer', since 'with-current-buffer' does that internally. * lisp/calendar/todo-mode.el (todo-merge-category): * lisp/comint.el (comint-dynamic-list-completions): * lisp/emacs-lisp/checkdoc.el (checkdoc-error): * lisp/emacs-lisp/debug.el (debug, debugger-record-expression): * lisp/emacs-lisp/eieio-opt.el (eieio-browse): * lisp/emacs-lisp/re-builder.el (reb-restart-font-lock): * lisp/erc/erc-dcc.el (erc-dcc-do-LIST-command): * lisp/eshell/em-unix.el (eshell-poor-mans-grep): * lisp/gnus/gnus-group.el (gnus-add-mark): * lisp/net/eww.el (eww-next-bookmark, eww-previous-bookmark): * lisp/net/sieve.el (sieve-upload): * lisp/net/tramp-cmds.el (tramp-cleanup-some-buffers): * lisp/obsolete/quickurl.el (quickurl-list-populate-buffer): * lisp/org/ob-calc.el: (org-babel-execute:calc): * lisp/org/org-agenda.el (org-agenda-use-sticky-p): * lisp/pcomplete.el (pcomplete-show-completions): * lisp/progmodes/bug-reference.el (bug-reference--try-setup-gnus-article): * lisp/progmodes/idlw-help.el (idlwave-highlight-linked-completions): * lisp/progmodes/verilog-mode.el (verilog-preprocess): * lisp/replace.el (occur-1): * lisp/term.el (term-dynamic-list-completions): * lisp/time.el (world-clock-update): * lisp/url/url-cache.el (url-store-in-cache): * lisp/vc/vc-cvs.el (vc-cvs-merge, vc-cvs-merge-news): * lisp/vc/vc-rcs.el (vc-rcs-system-release): * lisp/vc/vc-svn.el (vc-svn-merge, vc-svn-merge-news): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--get-error-string-for-export): * test/lisp/erc/erc-dcc-tests.el (pcomplete/erc-mode/DCC--get-1flag) (pcomplete/erc-mode/DCC--get-2flags) (pcomplete/erc-mode/DCC--get-2flags-reverse): * test/lisp/erc/erc-networks-tests.el (erc-networks--rename-server-buffer--existing--noreuse): * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-misc--reconnect-retry-nick): * test/lisp/erc/erc-tests.el (erc--refresh-prompt): Replace (with-current-buffer (get-buffer ...) ...) with (with-current-buffer ...).
2024-03-02* lisp/replace.el (perform-replace): Accept default bindings in lookup-key.Juri Linkov1-2/+2
Set ACCEPT-DEFAULT arg of lookup-key to t (bug#69342). This will allow the users to ignore unbound keys with ‘(define-key query-replace-map [t] 'ignore)’.
2024-01-02; Add 2024 to copyright yearsPo Lu1-1/+1
2023-11-20Improve invisibility handling in isearch-lazy-highlight (bug#40808)Juri Linkov1-0/+1
* lisp/isearch.el (isearch-lazy-highlight-invisible): New variable. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search) (isearch-lazy-highlight-match, isearch-lazy-highlight-buffer-update): Use it. * lisp/replace.el (replace-highlight): Let-bind isearch-invisible to search-invisible. * test/lisp/isearch-tests.el (isearch--test-invisible): New test.
2023-11-18(update_search_regs): Install better fix for bug#67124Stefan Monnier1-7/+0
The recent fix for the bug in `replace-match-maybe-edit` was basically a refinement of a previously installed workaround, whereas the bug was really in `update_search_regs`. * src/search.c (update_search_regs): Improve handling of `start` positions. * lisp/replace.el (replace-match-maybe-edit): Remove workaround. * test/src/search-tests.el (search-test--replace-match-update-data): New test.
2023-11-15Fix query-replace at EOBEli Zaretskii1-2/+5
* lisp/replace.el (replace-match-maybe-edit): Avoid clobbering match-data with outdated buffer position. (Bug#67124)
2023-09-13Fix defcustom :type in replace.el (Bug#65920)Mauro Aranda1-2/+4
* lisp/replace.el (list-matching-lines-face) (list-matching-lines-buffer-name-face): Allow a nil value.
2023-08-17Improve documentation of case transfer in replacement commandsEli Zaretskii1-4/+6
* doc/emacs/search.texi (Replacement and Lax Matches): * src/search.c (Freplace_match): * lisp/replace.el (query-replace, query-replace-regexp): Clarify in the doc string and the manual how letter-case is transferred from the replaced text to the replacement text. (Bug#65347)
2023-05-10; Fix minor documentation issue ion replace.elEli Zaretskii1-1/+6
* lisp/replace.el (query-replace, query-replace-regexp): Doc fix. (Bug#63397)
2023-01-18Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-mapJuri Linkov1-3/+3
Also it's compatible with 'M-s c' (isearch-toggle-case-fold) used during Isearch. Also makes possible to use the global keybinding 'M-c' (capitalize-dwim) in the minibuffer. * doc/lispref/minibuf.texi (Text from Minibuffer): Rename ‘M-c’ to ‘M-s c’. * lisp/replace.el (read-regexp-map): Rebind ‘M-c’ to ‘M-s c’ (bug#60741). (read-regexp-toggle-case-fold): Rename from read-regexp-toggle-case-folding to more standard name.
2023-01-01; Add 2023 to copyright years.Eli Zaretskii1-1/+1
2022-12-26; Fix typosStefan Kangas1-1/+1
(cherry picked from commit a5d39e11443fa30c8e8bc58254a1a59550dcd99e)
2022-12-23; Fix typosStefan Kangas1-1/+1
2022-12-13Add cross-reference to flush-linesStefan Kangas1-2/+5
* lisp/replace.el (flush-lines, kill-matching-lines): Add cross-references between commands, using the names '(kill|delete)-matching-lines' for symmetry. (Bug#59934)
2022-12-09; Mention flush-lines in kill-matching-lines docstringStefan Kangas1-1/+4
* lisp/replace.el (kill-matching-lines): Add cross-reference to flush-lines.
2022-11-11; Fix typosStefan Kangas1-1/+1
2022-10-02perform-replace doc string fixLars Ingebrigtsen1-2/+2
* lisp/replace.el (perform-replace): Fix doc string (bug#58177).
2022-09-09Delete many items obsolete since 24.3Stefan Kangas1-98/+88
* lisp/allout.el (allout-exposure-change-hook) (allout-structure-added-hook, allout-structure-deleted-hook) (allout-structure-shifted-hook): * lisp/arc-mode.el (archive-extract-hooks): * lisp/buff-menu.el (Buffer-menu-buffer+size-width): * lisp/calendar/timeclock.el (timeclock-modeline-display) (timeclock-modeline-display, timeclock-update-modeline): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym-function-arglist): * lisp/cedet/semantic/db-file.el (semanticdb-save-database-hooks): * lisp/cedet/semantic/edit.el (semantic-change-hooks) (semantic-edits-new-change-hooks) (semantic-edits-delete-change-hooks) (semantic-edits-reparse-change-hooks): * lisp/cedet/semantic/lex.el (semantic-lex-reset-hooks): * lisp/comint.el (comint--unquote&expand-filename) (comint-unquote-filename): * lisp/custom.el (user-variable-p): * lisp/dired.el (dired-shrink-to-fit, dired-pop-to-buffer) (dired-sort-set-modeline): * lisp/ebuff-menu.el (Electric-buffer-menu-mode): * lisp/emacs-lisp/byte-run.el (macro-declaration-function): * lisp/emacs-lisp/checkdoc.el (custom-print-functions) (checkdoc-comment-style-hooks): * lisp/emacs-lisp/cl-lib.el (custom-print-functions): * lisp/emacs-lisp/edebug.el (gud-inhibit-global-bindings): * lisp/erc/erc-dcc.el (erc-dcc-chat-filter-hook): * lisp/eshell/esh-mode.el (eshell-status-in-modeline): * lisp/eshell/eshell.el (eshell-add-to-window-buffer-names) (eshell-remove-from-window-buffer-names): * lisp/faces.el (set-face-underline-p, font-list-limit): * lisp/files.el (automount-dir-prefix, toggle-read-only): * lisp/filesets.el (filesets-cache-fill-content-hooks): * lisp/frame.el (automatic-hscrolling): * lisp/generic-x.el (javascript-generic-mode) (javascript-generic-mode-hook): * lisp/gnus/gnus-start.el (gnus-subscribe-newsgroup-hooks): * lisp/gnus/nndiary.el (nndiary-request-create-group-hooks) (nndiary-request-update-info-hooks) (nndiary-request-accept-article-hooks): * lisp/htmlfontify.el (hfy-post-html-hooks): * lisp/international/mule-cmds.el (inactivate-current-input-method-function) (inactivate-input-method, input-method-inactivate-hook) (ucs-insert): * lisp/international/quail.el (quail-inactivate) (quail-inactivate-hook): * lisp/international/robin.el (robin-inactivate) (robin-inactivate-hook): * lisp/leim/quail/hangul.el (hangul-input-method-inactivate): * lisp/leim/quail/uni-input.el (ucs-input-inactivate): * lisp/mail/emacsbug.el (report-emacs-bug-info): * lisp/mh-e/mh-e.el (mh-kill-folder-suppress-prompt-hooks): * lisp/mpc.el (mpc-string-prefix-p): * lisp/net/rcirc.el (rcirc-print-hooks, rcirc-sentinel-hooks) (rcirc-receive-message-hooks, rcirc-activity-hooks): * lisp/obsolete/crisp.el (crisp-mode-modeline-string): * lisp/pcomplete.el (pcomplete-arg-quote-list) (pcomplete-quote-argument): * lisp/progmodes/cc-mode.el (c-prepare-bug-report-hooks): * lisp/progmodes/python.el (python-info-ppss-context) (python-info-ppss-context-type) (python-info-ppss-comment-or-string-p, python-indent) (python-guess-indent, python-buffer, python-preoutput-result) (python-proc, python-send-receive, python-send-string) (python-use-skeletons): * lisp/progmodes/sh-script.el (sh-maybe-here-document): * lisp/replace.el (query-replace-interactive): * lisp/strokes.el (strokes-modeline-string): * lisp/subr.el (redraw-modeline): * lisp/term.el (term-default-fg-color, term-default-bg-color): * lisp/textmodes/tex-mode.el (latex-string-prefix-p) (tex-string-prefix-p): * lisp/url/url-parse.el (url-recreate-url-attributes): * lisp/vc/add-log.el (change-log-acknowledgement): * lisp/vc/ediff-wind.el (ediff-choose-window-setup-function-automatically): * lisp/vc/pcvs-util.el (cvs-string-prefix-p): * lisp/vc/vc.el (vc-string-prefix-p): * lisp/window.el (display-buffer-function): * lisp/winner.el (winner-mode-leave-hook): Remove many functions and variables obsolete since 24.3. * lisp/buff-menu.el (list-buffers--refresh): * lisp/dired.el (dired-mode-map): * lisp/files.el (abbreviate-file-name): * lisp/generic-x.el (generic-default-modes): * lisp/mh-e/mh-funcs.el (mh-kill-folder): * lisp/progmodes/hideif.el (hide-ifdef-mode-submap): * lisp/replace.el (query-replace-read-from): * lisp/term.el (term): * lisp/window.el (display-buffer): Don't use above deleted functions and variables. * src/marker.c (Fbuffer_has_markers_at): Delete DEFUN obsolete since 24.3. (syms_of_marker) <Sbuffer_has_markers_at>: Delete defsubr. * lisp/subr.el (buffer-has-markers-at): Remove obsoletion of above deleted DEFUN. * etc/TODO: Doc fix; don't mention above deleted function. * admin/cus-test.el (cus-test-get-options): * lisp/pcomplete.el: Doc fixes; don't mention removed items. ; * etc/NEWS: List removed items.
2022-09-04Use use-region-beginning/end in replacement commands (bug#45607)Juri Linkov1-16/+29
* lisp/isearch.el (isearch-query-replace): Use use-region-beginning and use-region-end. * lisp/textmodes/paragraphs.el (repunctuate-sentences): * lisp/replace.el (query-replace, query-replace-regexp) (map-query-replace-regexp, replace-string, replace-regexp): Add 'interactive-args' to 'declare' and use use-region-beginning, use-region-end, use-region-noncontiguous-p. * lisp/simple.el (use-region-noncontiguous-p): New function. (region-noncontiguous-p): Return more meaningful value.
2022-08-09Use new convenience functions in replace-stringLars Ingebrigtsen1-4/+3
* lisp/replace.el (replace-string): Use new convenience functions.
2022-08-09* lisp/replace.el (replace-highlight): Optimize for large buffers (bug#56815)Juri Linkov1-1/+3
Let-bind isearch-lazy-count and lazy-highlight-buffer to nil to avoid revisiting all matches in the whole buffer after every replacement.
2022-08-08Allow specifying how args are to be stored in `command-history'Lars Ingebrigtsen1-1/+4
* doc/lispref/functions.texi (Declare Form): Document `interactive-args' * lisp/replace.el (replace-string): Store the correct interactive arguments (bug#45607). * lisp/emacs-lisp/byte-run.el (byte-run--set-interactive-args): New function. (defun-declarations-alist): Use it. * src/callint.c (fix_command): Remove the old hack (which now longer works since interactive specs are byte-compiled) and instead rely on `interactive-args'.
2022-07-31Delete additional items obsolete since 20, 21 and 22Stefan Kangas1-83/+4
* lisp/font-lock.el (font-lock-reference-face): Delete variable alias obsolete since 20.3. * lisp/progmodes/cc-cmds.el (c-toggle-auto-state): Delete alias obsolete since 22.1. * lisp/replace.el (query-replace-regexp-eval): Delete function obsolete since 22.1. (replace-count, replace-re-search-function): Doc fixes; adjust for above deleted function.
2022-07-18Use `take` where clearly safe to do so (bug#56521)Mattias Engdegård1-3/+2
* lisp/emacs-lisp/seq.el (seq-take): * lisp/auth-source.el (auth-source-secrets-search) (auth-source-plstore-search): * lisp/gnus/message.el (message-insert-formatted-citation-line): * lisp/net/dbus.el (dbus-unregister-object): * lisp/replace.el (occur-context-lines): * test/src/print-tests.el (print-circular): Replace hand-written loop or `butlast` call with `take` for clarity, performance and validation. We have the equivalence (take N LIST) = (butlast LIST (- (length LIST) N)).
2022-07-05Don't hard-code `M-c' in `read-regexp'Lars Ingebrigtsen1-23/+29
* lisp/replace.el (read-regexp-map): New map. (read-regexp--case-fold, read-regexp-toggle-case-folding) (read-regexp): Factor out to avoid hard-coding `M-c'.
2022-07-03Quote some literal keys to get help-key-binding faceStefan Kangas1-6/+6
* lisp/align.el (align): * lisp/bindings.el (undo-repeat-map): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-prog.el (calc-user-define-invocation): * lisp/calc/calc-yank.el (calc--edit-mode): * lisp/comint.el (comint-history-isearch) * lisp/dired.el (dired-mode): * lisp/emulation/viper.el (viper-mode): * lisp/erc/erc-button.el (erc-button-face): * lisp/erc/erc-track.el (erc-track-enable-keybindings): * lisp/gnus/gnus-art.el (gnus-article-button-face): * lisp/gnus/gnus-eform.el (gnus-edit-form): * lisp/gnus/gnus-sum.el (gnus-summary-stop-at-end-of-message) (gnus-summary-goto-unread): * lisp/icomplete.el (icomplete-show-matches-on-no-input): * lisp/image-mode.el (image-scroll-up): * lisp/international/iso-transl.el (iso-transl-set-language): * lisp/isearch.el (isearch-forward-regexp): * lisp/misc.el (butterfly): * lisp/outline.el (outline-minor-mode-cycle-filter) (outline-minor-mode-cycle): * lisp/progmodes/grep.el (rgrep): * lisp/progmodes/gud.el (gud-gdb-repeat-map, gud-sdb-repeat-map) (gud-dbx-repeat-map, gud-xdb-repeat-map, gud-perldb-repeat-map) (gud-pdb-repeat-map, gud-guiler-repeat-map, gud-jdb-repeat-map): * lisp/progmodes/idlw-shell.el (idlwave-shell-graphics-window-size) (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-shell-debug-modifiers) (idlwave-list-shell-load-path-shadows): * lisp/progmodes/python.el (python-shell-get-process-or-error): * lisp/repeat.el (repeat-check-key): * lisp/replace.el (query-replace, query-replace-regexp) (read-regexp): * lisp/simple.el (read-extended-command-predicate): * lisp/tab-bar.el (tab-bar-switch-repeat-map) (tab-bar-move-repeat-map): * lisp/term.el (ansi-term): * lisp/textmodes/reftex-index.el (reftex-index-phrases-set-macro-key): * lisp/vc/emerge.el (emerge-scroll-left, emerge-scroll-right): * lisp/windmove.el: * lisp/winner.el (winner-mode): Quote literal keys to get 'help-key-binding' face. * lisp/comint.el (comint-insert-previous-argument): Use regular quotes.
2022-06-25Fix subr-x fix that was missed when re-revertingLars Ingebrigtsen1-0/+1
* lisp/replace.el (require): Fix subr-x build warning.
2022-06-25Revert "Fix some byte-compilation warnings about subr-x"Lars Ingebrigtsen1-1/+0
This reverts commit cd479aa8bd498da4d7980a7fe7a37e238761482f. This led to build failures when doing bootstraps.
2022-06-24Fix some byte-compilation warnings about subr-xLars Ingebrigtsen1-0/+1
* lisp/term/haiku-win.el (require): * lisp/replace.el (require): * lisp/progmodes/elisp-mode.el (require): * lisp/isearch.el (require): * lisp/files.el (require): Require subr-x when compiling.