[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu bac9660b47 102/288: Add non query replace command
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu bac9660b47 102/288: Add non query replace command |
Date: |
Thu, 6 Jan 2022 03:58:44 -0500 (EST) |
branch: elpa/anzu
commit bac9660b47bebddc3430d9be3425cc896be8628a
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Add non query replace command
---
anzu.el | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/anzu.el b/anzu.el
index e2f78b3626..3db5c7e7c0 100644
--- a/anzu.el
+++ b/anzu.el
@@ -501,17 +501,17 @@
(and (boundp 'list-matching-lines-prefix-face)
(and prefix (< prefix 0))))
-(defun anzu--construct-perform-replace-arguments (from to delimited beg end
backward)
+(defun anzu--construct-perform-replace-arguments (from to delimited beg end
backward query)
(if backward
- (list from to t t delimited nil nil beg end backward)
- (list from to t t delimited nil nil beg end)))
+ (list from to query t delimited nil nil beg end backward)
+ (list from to query t delimited nil nil beg end)))
(defun anzu--construct-query-replace-arguments (from to delimited beg end
backward)
(if backward
(list from to delimited beg end backward)
(list from to delimited beg end)))
-(defun anzu--query-replace-common (use-regexp &optional at-cursor thing
prefix-arg)
+(defun* anzu--query-replace-common (use-regexp &key at-cursor thing prefix-arg
(query t))
(anzu--cons-mode-line 'replace)
(let* ((use-region (use-region-p))
(backward (anzu--replace-backward-p prefix-arg))
@@ -538,7 +538,7 @@
(setq clear-overlay t)
(if use-regexp
(apply 'perform-replace
(anzu--construct-perform-replace-arguments
- from to delimited beg end backward))
+ from to delimited beg end backward
query))
(apply 'query-replace (anzu--construct-query-replace-arguments
from to delimited beg end backward))))
(progn
@@ -550,22 +550,33 @@
;;;###autoload
(defun anzu-query-replace-at-cursor ()
(interactive)
- (anzu--query-replace-common t t))
+ (anzu--query-replace-common t :at-cursor t))
;;;###autoload
(defun anzu-query-replace-at-cursor-thing ()
(interactive)
- (anzu--query-replace-common t t anzu-replace-at-cursor-thing))
+ (anzu--query-replace-common t :at-cursor t :thing
anzu-replace-at-cursor-thing))
;;;###autoload
(defun anzu-query-replace (arg)
(interactive "p")
- (anzu--query-replace-common nil nil nil arg))
+ (anzu--query-replace-common nil :prefix-arg arg))
;;;###autoload
(defun anzu-query-replace-regexp (arg)
(interactive "p")
- (anzu--query-replace-common t nil nil arg))
+ (anzu--query-replace-common t :prefix-arg arg))
+
+;;;###autoload
+(defun anzu-replace-at-cursor-thing ()
+ (interactive)
+ (let ((orig (point-marker)))
+ (anzu--query-replace-common t
+ :at-cursor t
+ :thing anzu-replace-at-cursor-thing
+ :query nil)
+ (goto-char (marker-position orig))
+ (set-marker orig nil)))
(provide 'anzu)
;;; anzu.el ends here
- [nongnu] elpa/anzu fd99f06af9 042/288: add screenshot for threshold, (continued)
- [nongnu] elpa/anzu fd99f06af9 042/288: add screenshot for threshold, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 168d8c7f73 043/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ff4393fac5 050/288: Add feature that highlight replaced texts, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e2e8d12905 058/288: Update face documentation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ebfbfe7e01 060/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a8f75879a8 063/288: Don't evaluate not regexp replacement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f503b785ef 065/288: Update about anzu-query-replace-at-cursor, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 71fb782b38 064/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 3dbd22ff44 086/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5c59c252d5 099/288: Fix ignore case problem, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu bac9660b47 102/288: Add non query replace command,
ELPA Syncer <=
- [nongnu] elpa/anzu a81c99b146 105/288: Merge pull request #18 from syohex/switch-to-cl-lib, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e26f29af37 109/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a06fb937b5 110/288: Enable lexical-binding, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e817db8532 115/288: Fix byte compile warning for Emacs 24.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f3c83f3109 116/288: Merge pull request #21 from syohex/fix-byte-compile-warning, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b7185acafc 122/288: Use original function name instead of alias, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu a77aa41dbc 121/288: Update Git animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 59fec57b13 124/288: Add Cask file for testing, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 43cb178b16 133/288: Update mode line like searching in replacing command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e53fe6d0fc 135/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06