summaryrefslogtreecommitdiff
path: root/lisp/replace.el
Commit message (Collapse)AuthorAgeFilesLines
...
* * lisp/replace.el (perform-replace): Document `replacements'.Stefan Monnier2015-08-111-6/+7
| | | | | (perform-replace): Move the description of the format of `replacements' from the body's comment to the docstring.
* * lisp/replace.el (replace-character-fold): Default to nilArtur Malabarba2015-08-051-1/+1
|
* * lisp/replace.el (replace-search): Fix regexp case (bug#20901)Artur Malabarba2015-06-261-0/+1
|
* * lisp/character-fold.el: New file (Bug#20887)Artur Malabarba2015-06-241-2/+3
| | | | | | | | | | | | | (character-fold-to-regexp): New function. * lisp/replace.el (replace-search): Check value of `character-fold-search'. * lisp/isearch.el: Move character-folding code to character-fold.el (isearch-toggle-character-fold): New command. (isearch-mode-map): Bind it to "\M-sf". (isearch-mode): Check value of `character-fold-search'.
* * lisp/isearch.el: Fold many unicode characters to ASCIIArtur Malabarba2015-06-231-0/+9
| | | | | | | | | | | | (isearch-character-fold-search, isearch--character-fold-extras) (isearch--character-fold-table): New variable. (isearch--character-folded-regexp): New function. (isearch-search-fun-default): Use them. * lisp/replace.el (replace-character-fold): New variable. (replace-search): Use it. * etc/NEWS: Document it.
* * lisp/replace.el (query-replace-read-from): Add separator toJuri Linkov2015-06-231-0/+2
| | | | the local binding of text-property-default-nonsticky. (Bug#20690)
* Avoid confusion in query-replace history when replacing NUL charsNicolas Richard2015-06-021-22/+30
| | | | | | * lisp/replace.el (query-replace--split-string): New function. (query-replace-read-from): Rely on the 'separator' property instead of searching for the NUL character (Bug#20690).
* * lisp/replace.el (query-replace-from-to-separator): Delay initializationGlenn Morris2015-04-161-7/+5
| | | | to avoid rogue setting after startup.
* Add `predicate' arg to `read-buffer' and use it for erc-iswitchbStefan Monnier2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes: debbugs:20116 * src/minibuf.c (Fread_buffer): Add `predicate' argument. * src/callint.c (Fcall_interactively): Adjust calls accordingly. * lisp/erc/erc.el (erc-switch-to-buffer): Rename from erc-iswitchb and rewrite using read-buffer. (erc--buffer-p): New function, extracted from erc-buffer-filter. (erc-buffer-filter): Use it. (erc-with-all-buffers-of-server): Silence compile warning if the return value is unused. (erc-is-valid-nick-p, erc-common-server-suffixes, erc-get-arglist) (erc-command-name, erc-popup-input-buffer): Use \` and \' to match beg/end of string. * lisp/obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg. * lisp/isearchb.el (isearchb-iswitchb): Adjust accordingly. * lisp/ido.el (ido-read-buffer): Add `predicate' argument. * lisp/misearch.el (unload-function-defs-list): Declare before use.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Fix query-replace-regexp when using lisp expressions for replacementJuri Linkov2014-12-161-3/+6
| | | | | | | * lisp/replace.el (query-replace-read-from): Use query-replace-compile-replacement only on the return value. Fixes: debbugs:19383
* * lisp/replace.el (query-replace-from-to-separator): Turn defvar into defcustom.Juri Linkov2014-11-181-9/+20
| | | | | | | | | | | Wrap char-displayable-p in ignore-errors because an attempt to autoload char-displayable-p fails during pre-loading. Move (propertize "\0" ... 'separator t) out of customizable part to query-replace-read-from. (query-replace-read-from): Call custom-reevaluate-setting on query-replace-from-to-separator to reevaluate the separator depending on the return value of char-displayable-p. http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg00466.html
* * lisp/replace.el: History for query replace pairs.Juri Linkov2014-11-081-24/+48
| | | | | | | | | | | | | | | | | (query-replace-defaults): Promote to a list of cons cell. Doc fix. (query-replace-from-to-separator): New variable. (query-replace-read-from): Let-bind query-replace-from-to-history to a list of FROM-TO strings created from query-replace-defaults and separated by query-replace-from-to-separator. Use it as the history while reading from the minibuffer. Split the returned string by the separator to get FROM and TO parts, and add them to the history variables. (query-replace-read-to): Add FROM-TO pairs to query-replace-defaults. (query-replace-regexp-eval): Let-bind query-replace-defaults to nil. http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg00253.html * lisp/isearch.el (isearch-text-char-description): Keep characters intact and put formatted strings with the `display' property.
* * lisp/replace.el (query-replace): Fix typo in docstring.Christoph Scholtes2014-08-241-1/+1
| | | | Fixes: debbugs:18320
* Allow `declare' to set the interactive-only propertyGlenn Morris2014-03-221-4/+4
| | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Add interactive-only. Doc tweak. (macro-declarations-alist): Doc tweak. * lisp/subr.el (declare): Doc tweak (add xref to manual). * lisp/comint.el (comint-run): * lisp/files.el (insert-file-literally, insert-file): * lisp/replace.el (replace-string, replace-regexp): * lisp/simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char) (delete-forward-char, goto-line, insert-buffer, next-line) (previous-line): Set interactive-only via declare. * doc/lispref/functions.texi (Declare Form): Add interactive-only. * doc/lispref/commands.texi (Defining Commands) Mention declare. * etc/NEWS: Mention this.
* * lisp/replace.el (read-regexp): Fix typo in earlier doc change.Glenn Morris2014-02-141-1/+1
|
* Some read-regexp docGlenn Morris2014-02-131-25/+39
| | | | | | | * lisp/replace.el (map-query-replace-regexp) (read-regexp-defaults-function, read-regexp): Doc fixes. * etc/NEWS: Related edits.
* Replace "Maintainer: FSF" with the emacs-devel mailing addressGlenn Morris2014-02-091-1/+1
|
* * replace.el (replace-match-maybe-edit): Doc clarification.Lars Ingebrigtsen2014-02-071-3/+5
| | | | Fixes: debbugs:15632
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-2/+2
|
* * lisp/replace.el (read-regexp-defaults-function): New defcustom.Juri Linkov2013-12-201-35/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (read-regexp-suggestions): New function. (read-regexp): Use `read-regexp-defaults-function' to get default values. Use `read-regexp-suggestions'. Add non-empty default to history for empty input. (occur-read-regexp-defaults-function): Remove function. (occur-read-primary-args): Use `regexp-history-last' instead of `occur-read-regexp-defaults-function'. * lisp/hi-lock.el (hi-lock-read-regexp-defaults-function): Remove function. (hi-lock-line-face-buffer, hi-lock-face-buffer) (hi-lock-face-phrase-buffer): Use `regexp-history-last' instead of `hi-lock-read-regexp-defaults-function'. Doc fix. (hi-lock-face-symbol-at-point): Replace `find-tag-default-as-regexp' with `find-tag-default-as-symbol-regexp'. Doc fix. (hi-lock-read-regexp-defaults): Remove function. (hi-lock-regexp-okay): Add check for null. * lisp/progmodes/grep.el (grep-read-regexp): Use `grep-tag-default' for the arg DEFAULTS. Move formatting of the prompt to `read-regexp'. * lisp/subr.el (find-tag-default-as-symbol-regexp): New function. (find-tag-default-as-regexp): Move symbol regexp formatting to `find-tag-default-as-symbol-regexp'. Fixes: debbugs:14405
* * lisp/replace.el (occur-engine): Use `add-face-text-property'Juri Linkov2013-12-201-14/+11
| | | | | | | | | | to add the face property to matches and titles. * lisp/hi-lock.el (hi-green): Use lighter color "light green" closer to the palette of other hi-lock colors. (hi-lock-set-pattern): Prepend hi-lock face to the existing face. Fixes: debbugs:14645
* query-replace backwardJuri Linkov2013-12-191-47/+87
| | | | | | | | | | | | | | | | | | * lisp/replace.el (query-replace-read-args): Split a non-negative arg and a negative arg into separate elements. (query-replace, query-replace-regexp, replace-string) (replace-regexp): Add arg `backward'. Doc fix. (replace-match-maybe-edit): When new arg `backward' is non-nil, move point to the beginning of the match. (replace-search, replace-highlight): Use new arg `backward' to set the value of `isearch-forward'. (perform-replace): Add arg `backward' and use it to perform replacement backward. * lisp/isearch.el (isearch-query-replace): Use a negative prefix arg to call `perform-replace' with a non-nil arg `backward'. Fixes: debbugs:14979
* * replace.el (occur-engine): Avoid infloop.Chong Yidong2013-12-181-1/+3
| | | | Fixes: debbugs:7593
* Make the `interactive-only' bytecomp warning like the `obsolete' oneGlenn Morris2013-11-301-2/+2
| | | | | | | | | | | | * emacs-lisp/bytecomp.el (byte-compile-form): Make the `interactive-only' warning like the `obsolete' one. * comint.el (comint-run): * files.el (insert-file-literally, insert-file): * replace.el (replace-string, replace-regexp): * simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char) (goto-line, insert-buffer, next-line, previous-line): Tweak `interactive-only' spec.
* * lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions):Bozhidar Batsov2013-11-251-0/+4
| | | | | | | Mark as obsolete and replace it with a symbol property. (byte-compile-form): Use new 'interactive-only property. * lisp/comint.el, lisp/files.el, lisp/replace.el, lisp/simple.el: Apply new 'interactive-only properly.
* * lisp/replace.el (replace-eval-replacement): Try to give more helpful errorGlenn Morris2013-11-131-3/+8
| | | | | | message. Fixes: debbugs:15836
* * lisp/replace.el (how-many): Fix rstart and !rend case.Oleh Krehel2013-10-121-3/+6
| | | | Fixes: debbugs:15589
* * lisp/replace.el (replace-string): Doc fix re start/end.Glenn Morris2013-09-051-4/+5
| | | | Fixes: debbugs:15275
* Revert introduction of isearch-filter-predicates.Stefan Monnier2013-08-051-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rely on add-function instead. * lisp/loadup.el: Preload nadvice. * lisp/isearch.el (isearch-filter-predicates): Rename it back to isearch-filter-predicate. (isearch-message-prefix): Use advice-function-mapc and advice properties to get the isearch-message-prefix. (isearch-search, isearch-lazy-highlight-search): Revert to funcall instead of run-hook-with-args-until-failure. (isearch-filter-visible): Not obsolete any more. * lisp/replace.el (perform-replace): Revert to funcall instead of run-hook-with-args-until-failure. * lisp/wdired.el (wdired-change-to-wdired-mode): Use add-function. * lisp/dired-aux.el (dired-isearch-filenames-mode): Rename from dired-isearch-filenames-toggle; make it into a proper minor mode. Use add/remove-function. (dired-isearch-filenames-setup, dired-isearch-filenames-end): Call the minor-mode rather than add/remove-hook. (dired-isearch-filter-filenames): Remove isearch-message-prefix property. * lisp/info.el (Info--search-loop): New function, extracted from Info-search. Funcall isearch-filter-predicate instead of run-hook-with-args-until-failure isearch-filter-predicates. (Info-search): Use it. (Info-mode): Use isearch-filter-predicate instead of isearch-filter-predicates. * src/lisp.mk (lisp): Add nadvice.elc. * lib-src/makefile.w32-in (lisp2): Add nadvice.elc. Fixes: debbugs:14714
* * lisp/isearch.el (isearch-query-replace): Add " symbol" and otherJuri Linkov2013-06-141-1/+4
| | | | | | | | | possible search modes from `isearch-message-prefix' to the prompt. (isearch-occur): Use `with-isearch-suspended' to not exit Isearch when reading a regexp to collect. * lisp/replace.el (perform-replace): Display "symbol " and other search modes from `isearch-message-prefix' in the *Help* buffer.
* Fix typos.Juanma Barranquero2013-06-111-4/+4
| | | | | | | | | * lisp/replace.el (query-replace, occur-read-regexp-defaults-function) (replace-search): * lisp/subr.el (declare-function, number-sequence, local-set-key) (substitute-key-definition, locate-user-emacs-file) (with-silent-modifications, split-string, eval-after-load): Fix typos, remove unneeded backslashes and reflow some docstrings.
* * lisp/replace.el (perform-replace): Avoid `isearch-range-invisible'Juri Linkov2013-05-311-0/+3
| | | | | | call when `query-flag' is nil and `search-invisible' is non-nil. Fixes: debbugs:11746
* * lisp/replace.el (occur-engine): Rename `globalcount' to `global-lines'Juri Linkov2013-05-301-31/+45
| | | | | | | | | | | | | | for total count of matching lines. Add `global-matches' for total count of matches. Rename `matches' to `lines' for count of matching lines. Add `matches' for count of matches. Rename `lines' to `curr-line' for line count. Rename `prev-lines' to `prev-line' for line number of prev match endpt. Increment `matches' for every match. Print the number of matching lines in the header. (occur-context-lines): Rename `lines' to `curr-line'. Rename `prev-lines' to `prev-line'. Fixes: debbugs:14017
* * lisp/replace.el (perform-replace): Add `skip-read-only-count',Juri Linkov2013-05-301-17/+62
| | | | | | | | | | `skip-filtered-count', `skip-invisible-count' let-bound to 0. Increment them for corresponding conditions and report the number of skipped occurrences in the final message. (query-replace, query-replace-regexp, query-replace-regexp-eval) (replace-string, replace-regexp): Doc fix. Fixes: debbugs:11746
* * lisp/replace.el (replace-search): New function with code moved outJuri Linkov2013-05-281-90/+96
| | | | | | | | from `perform-replace'. (replace-highlight, replace-dehighlight): Move function definitions up closer to `replace-search'. Fixes: debbugs:11746
* * lisp/replace.el (perform-replace): Ignore invisible matches.Juri Linkov2013-05-281-5/+15
| | | | | | | | | | In addition to checking `query-replace-skip-read-only', also filter out matches by calling `run-hook-with-args-until-failure' on `isearch-filter-predicates', and also check `search-invisible' for t or call `isearch-range-invisible'. (replace-dehighlight): Call `isearch-clean-overlays'. Fixes: debbugs:11746
* * lisp/replace.el (list-matching-lines-prefix-face): New defcustom.Juri Linkov2013-03-241-12/+32
| | | | | | | | | | | | | (occur-1): Pass `list-matching-lines-prefix-face' to the function `occur-engine' if `face-differs-from-default-p' returns t. (occur-engine): Add `,' inside backquote construct to evaluate `prefix-face'. Propertize the prefix with the `prefix-face' face. Pass `prefix-face' to the functions `occur-context-lines' and `occur-engine-add-prefix'. (occur-engine-add-prefix, occur-context-lines): Add optional arg `prefix-face' and propertize the prefix with `prefix-face'. Fixes: debbugs:14017
* Provide for customizing default regexp in occur commands (Bug#13892).Jambunathan K2013-03-101-1/+21
| | | | | | * lisp/replace.el (occur-read-regexp-defaults-function): New var. (occur-read-regexp-defaults): New defun. (occur-read-primary-args): Propagate above change.
* Provide for customizing default regexp in hi-lock commands (Bug#13892).Jambunathan K2013-03-081-9/+1
| | | | | | | | | | | * lisp/hi-lock.el (hi-lock-read-regexp-defaults-function): New var. (hi-lock-read-regexp-defaults): New defun. (hi-lock-line-face-buffer, hi-lock-face-buffer) (hi-lock-face-phrase-buffer): Propagate above change. Update docstring. * lisp/subr.el (find-tag-default-as-regexp): New defun. * lisp/replace.el (read-regexp): Propagate above change.
* * lisp/replace.el (read-regexp): Let-bind `default' to the firstJuri Linkov2013-02-251-26/+33
| | | | | | | | element of `defaults' if it's a list, otherwise it should be a string or nil. Let-bind `suggestions' to `defaults' if it's a list, otherwise make a list with the string value. Doc fix. Fixes: debbugs:13805
* Merge from emacs-24; up to 2012-12-22T02:59:08Z!cyd@gnu.orgGlenn Morris2013-02-221-0/+1
|\
| * * lisp/isearch.el (isearch-lazy-highlight-new-loop):Juri Linkov2013-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Set `isearch-lazy-highlight-start' and `isearch-lazy-highlight-end' to `isearch-other-end' if it is not nil. * lisp/replace.el (replace-highlight): Let-bind `isearch-other-end' to `match-beg'. * lisp/textmodes/ispell.el (ispell-highlight-spelling-error-overlay): Let-bind `isearch-other-end' to `start', `isearch-forward' to t and `isearch-error' to nil. Fixes: debbugs:13402
* | (read-regexp): Add regexp for symbol at point to the defaults (Bug#13687).Jambunathan K2013-02-161-9/+14
|/ | | | | | * lisp/replace.el (read-regexp): Tighten the regexp that matches tag. When tag is retrieved with `find-tag-default', use regexp that matches tag at point. Also update docstring.
* * lisp/replace.el (perform-replace): Move let-bindings of isearch-*Juri Linkov2013-02-021-46/+56
| | | | | | | | | | | | variables deeper to the loop that searches for the next match. Add bindings for `isearch-nonincremental' and `isearch-adjusted'. Use `isearch-search-fun-default' instead of `isearch-search-fun'. * lisp/isearch.el (isearch-search-fun-default): Check for null first element of isearch-cmds as a precaution when it's used with inactive isearch. Fixes: debbugs:13579
* Update copyright notices for 2013.Paul Eggert2013-01-011-2/+2
|
* * doc/emacs/search.texi (Query Replace): Document multi-buffer replacement ↵Juri Linkov2012-10-171-2/+6
| | | | | | | | | | | | keys. * doc/emacs/maintaining.texi (Tags Search): Change link "Replace" to "Query Replace". * lisp/replace.el (query-replace-help): Mention multi-buffer replacement keys in the Help message. Fixes: debbugs:12655
* * lisp/replace.el (query-replace-interactive): Declare obsolete.Juri Linkov2012-10-041-23/+30
| | | | | | | | | | | | (query-replace-read-from): Add the last incremental search string to the list of default values accessible via M-n. (map-query-replace-regexp): Use `read-regexp'. (query-replace, query-replace-regexp, query-replace-regexp-eval) (map-query-replace-regexp, replace-string, replace-regexp): Fix docstrings to replace mentions of `query-replace-interactive' with alternatives. Fixes: debbugs:12526
* Use declare forms, where possible, to mark obsolete functions.Chong Yidong2012-09-251-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/allout.el (allout-passphrase-hint-string): Likewise. (allout-init): Use a declare form to mark obsolete. * lisp/calendar/calendar.el (calendar-version): * lisp/calendar/icalendar.el (icalendar-extract-ical-from-buffer) (icalendar-convert-diary-to-ical): * lisp/cus-edit.el (custom-mode): * lisp/ansi-color.el (ansi-color-unfontify-region): * lisp/international/latin1-disp.el (latin1-char-displayable-p): * lisp/progmodes/cwarn.el (turn-on-cwarn-mode): * lisp/progmodes/which-func.el (which-func-update-1): Use define-obsolete-function-alias. * lisp/bookmark.el (bookmark-jump-noselect): Use a declare form to mark this function obsolete. * lisp/calendar/cal-x.el (calendar-two-frame-setup) (calendar-only-one-frame-setup, calendar-one-frame-setup): * lisp/calendar/calendar.el (american-calendar, european-calendar) (calendar-for-loop): * lisp/comint.el (comint-dynamic-simple-complete) (comint-dynamic-complete-as-filename, comint-unquote-filename): * lisp/desktop.el (desktop-load-default): * lisp/dired-x.el (dired-omit-here-always) (dired-hack-local-variables, dired-default-directory): * lisp/emacs-lisp/derived.el (derived-mode-class): * lisp/emacs-lisp/timer.el (timer-set-time-with-usecs): * lisp/emacs-lock.el (toggle-emacs-lock): * lisp/epa.el (epa-display-verify-result): * lisp/epg.el (epg-sign-keys, epg-start-sign-keys) (epg-passphrase-callback-function): * lisp/eshell/esh-util.el (eshell-for): * lisp/eshell/eshell.el (eshell-remove-from-window-buffer-names) (eshell-add-to-window-buffer-names): * lisp/files.el (locate-file-completion): * lisp/imenu.el (imenu-example--create-c-index) (imenu-example--create-lisp-index) (imenu-example--lisp-extract-index-name) (imenu-example--name-and-position): * lisp/international/mule-cmds.el (princ-list): * lisp/international/mule-diag.el (decode-codepage-char): * lisp/international/mule-util.el (detect-coding-with-priority): * lisp/iswitchb.el (iswitchb-read-buffer): * lisp/mail/mailalias.el (mail-complete): * lisp/mail/sendmail.el (mail-sent-via): * lisp/mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar) (mouse-major-mode-menu): * lisp/password-cache.el (password-read-and-add): * lisp/pcomplete.el (pcomplete-parse-comint-arguments): * lisp/progmodes/sh-script.el (sh-maybe-here-document): * lisp/replace.el (query-replace-regexp-eval): * lisp/savehist.el (savehist-load): * lisp/simple.el (choose-completion-delete-max-match): * lisp/term.el (term-dynamic-simple-complete): * lisp/vc/ediff-init.el (ediff-check-version): * lisp/vc/ediff-wind.el (ediff-choose-window-setup-function-automatically): * lisp/vc/vc.el (vc-diff-switches-list): * lisp/view.el (view-return-to-alist-update): Likewise. * lisp/iswitchb.el (iswitchb-read-buffer): Move code of iswitchb-define-mode-map here, and delete that obsolete function. * lisp/subr.el (eval-next-after-load, makehash, insert-string) (assoc-ignore-representation, assoc-ignore-case): Use declare to mark obsolete. (mode-line-inverse-video): Variable deleted. * lisp/emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that this applies to functions. * lisp/erc/erc.el (erc-send-command): Use define-obsolete-function-alias. * lisp/international/mule-util.el (string-to-sequence): Remove. * lisp/net/newst-backend.el (newsticker-cache-filename): * lisp/net/newst-treeview.el (newsticker-groups-filename): Fix incorrect obsolescence declaration. * lisp/net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete font-lock-reference-face. * lisp/url/url-parse.el (url-recreate-url-attributes): * lisp/url/url-util.el (url-generate-unique-filename): Use declare to mark obsolete. * src/xdisp.c (mode_line_inverse_video): Delete obsolete variable.
* * lisp/replace.el (query-replace-read-from): Use `read-regexp' insteadJuri Linkov2012-09-211-17/+14
| | | | | | | | | | | | | | | | of `read-from-minibuffer' when `regexp-flag' is non-nil. (occur-read-primary-args): Use `read-regexp' instead of `read-string'. (multi-occur-in-matching-buffers): Use `read-regexp' instead of `read-from-minibuffer'. * lisp/isearch.el (isearch-occur): Use `read-regexp' instead of `read-string'. * lisp/dired.el (dired-read-regexp): Use `read-regexp' instead of `read-from-minibuffer'. * lisp/progmodes/grep.el (grep-read-regexp): Use `read-regexp' instead of `read-string'. Fixes: debbugs:7567