[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 0b3cf4b0a6 103/288: Merge pull request #17 from syohe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 0b3cf4b0a6 103/288: Merge pull request #17 from syohex/add-nonquery-replace-command |
Date: |
Thu, 6 Jan 2022 03:58:44 -0500 (EST) |
branch: elpa/anzu
commit 0b3cf4b0a697922c775ad476545947e8e66488bf
Merge: 189c0eaf9f bac9660b47
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Merge pull request #17 from syohex/add-nonquery-replace-command
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 ad0d7bce91 073/288: Update document, (continued)
- [nongnu] elpa/anzu ad0d7bce91 073/288: Update document, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 5718f08dc6 066/288: Fix case fold issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 17b3ab244b 074/288: Fix case, no symbol at cursor, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c324833756 080/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu f50be69c0f 082/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu eb2b4ec103 084/288: fix link, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 156980dc69 092/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c7ecd57c24 095/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 91f3478003 097/288: Merge pull request #15 from syohex/fix-nonprefix-case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 189c0eaf9f 101/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 0b3cf4b0a6 103/288: Merge pull request #17 from syohex/add-nonquery-replace-command,
ELPA Syncer <=
- [nongnu] elpa/anzu 2a9785459b 111/288: Merge pull request #20 from syohex/enable-lexical-binding, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8e92765ab7 113/288: Specify Emacs version, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 8fe3d080ff 114/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 11dcdf722f 128/288: Use package-file instead of package, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 718d5845d1 126/288: Merge pull request #25 from syohex/add-lines-region, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 485f463a40 127/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ffcffffc1a 130/288: Merge pull request #26 from cedricporter/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 1ae7297bc7 132/288: Merge pull request #27 from syohex/fix-for-toggle-search, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu c0d58a61c2 136/288: A couple of grammar and typo fixes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 41f19cd2c2 214/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06