[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 1d32922c04 089/301: Run after-change-functions hook
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 1d32922c04 089/301: Run after-change-functions hook for every occurrence |
Date: |
Mon, 10 Jan 2022 22:58:53 -0500 (EST) |
branch: elpa/iedit
commit 1d32922c04640d88679830c7cf6cf95a67e0bb96
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Run after-change-functions hook for every occurrence
---
iedit.el | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/iedit.el b/iedit.el
index 8d821ab485..bf0c39ab61 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-03-14 23:00:29 Victor Ren>
+;; Time-stamp: <2012-07-01 17:04:39 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.95
@@ -677,8 +677,22 @@ occurrence, it will exit Iedit mode."
(if (eq 0 change)
(dolist (another-occurrence (remove occurrence
iedit-occurrences-overlays))
(progn
- (goto-char (+ (overlay-start another-occurrence)
offset))
- (insert-and-inherit value)))
+ (let ((beginning (+ (overlay-start another-occurrence)
offset))
+ (ending (+ beginning (- end beg))))
+ (goto-char beginning)
+ (insert-and-inherit value)
+ ;; todo: reconsider this change
+ ;; Quick fix for multi-occur occur-edit-mode:
+ ;; multi-occur depend on after-change-functions to
+ ;; update original buffer. Since
+ ;; inhibit-modification-hooks is set to non-nil,
+ ;; after-change-functions hooks are not going to be
+ ;; called for the changes of other occurrences.
+ ;; So run the hook here.
+ (run-hook-with-args 'after-change-functions
+ beginning
+ ending
+ change))))
;; deletion
(dolist (another-occurrence (remove occurrence
iedit-occurrences-overlays))
(let* ((beginning (+ (overlay-start another-occurrence)
offset))
@@ -686,7 +700,11 @@ occurrence, it will exit Iedit mode."
(delete-region beginning ending)
(unless (eq beg end) ;; replacement
(goto-char beginning)
- (insert-and-inherit value)))))))))))))
+ (insert-and-inherit value))
+ (run-hook-with-args 'after-change-functions
+ beginning
+ ending
+ change))))))))))))
(defun iedit-next-occurrence ()
"Move forward to the next occurrence in the `iedit'.
- [nongnu] elpa/iedit b9ebb768b7 190/301: Merge pull request #60 from danrharms/issue-59-hotfix, (continued)
- [nongnu] elpa/iedit b9ebb768b7 190/301: Merge pull request #60 from danrharms/issue-59-hotfix, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f7b2d60989 167/301: Make occurrence string the latest kill in the kill ring, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c25992ef7f 199/301: Fix doc strings, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 19f35aa1a0 172/301: Change the default key binding for `iedit-rectangle-mode' to c-x-r-ret, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4864e17126 010/301: Merge remote-tracking branch 'tsdh/master', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit fc71952cf9 014/301: Boolean `t', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df6c2ad919 017/301: fix search to use regexp-quote when needed, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 30971294b2 071/301: Remove a limitation of empty occurrence string, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df9e958703 082/301: Add more short-cut to iedit on function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06fac017b4 087/301: explain what "quite different" means in rectangle context in README, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1d32922c04 089/301: Run after-change-functions hook for every occurrence,
ELPA Syncer <=
- [nongnu] elpa/iedit c935255053 083/301: minor change, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d29bf65e5e 096/301: Do not update mode line when buffering modification, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1c410fc2b8 101/301: Fix iedit-number-occurrences with conjointed occurrences problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 73a5884b4c 126/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b4c736225f 114/301: Merge pull request #18 from lewang/lewang-use-real-face, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8ff86b768d 115/301: Replace "(set-mark nil)" with (setq mark-active nil)", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9a1b776f22 103/301: Remove todo for conjointed overlays, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 21a60f2ea3 113/301: Add toogle key option, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e4d67bdb06 120/301: Separate iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 466ab11996 119/301: Add APIs for adding occurrence overlay, ELPA Syncer, 2022/01/10