[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 9bc57d2a30 041/301: make iedit-skipped-modification-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 9bc57d2a30 041/301: make iedit-skipped-modification-once buffer local |
Date: |
Mon, 10 Jan 2022 22:58:48 -0500 (EST) |
branch: elpa/iedit
commit 9bc57d2a301d2f9c424995d2d917763169783e70
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
make iedit-skipped-modification-once buffer local
---
iedit.el | 54 +++++++++++++++++++++++++-----------------------------
1 file changed, 25 insertions(+), 29 deletions(-)
diff --git a/iedit.el b/iedit.el
index f9f94c73fd..bb9df39602 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-01-30 12:48:14 Victor Ren>
+;; Time-stamp: <2012-01-30 13:33:21 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region replace simultaneous
;; Version: 0.92
@@ -122,7 +122,7 @@ default."
(or (assq 'iedit-mode minor-mode-alist)
(nconc minor-mode-alist
- (list '(iedit-mode iedit-mode))))
+ (list '(iedit-mode iedit-mode))))
(defvar iedit-occurrences-overlays nil
"The occurrences slot contains a list of overlays used to
@@ -176,6 +176,7 @@ occurrence is not applied to other occurrences when it is
true.")
(make-variable-buffer-local 'iedit-forward-success)
(make-variable-buffer-local 'iedit-before-modification-string)
(make-variable-buffer-local 'iedit-before-modification-undo-list)
+(make-variable-buffer-local 'iedit-skipped-modification-once)
(make-variable-buffer-local 'iedit-aborting)
(make-variable-buffer-local 'iedit-buffering)
@@ -198,9 +199,10 @@ occurrence is not applied to other occurrences when it is
true.")
map)
"Keymap for characters following the Help key for iedit mode.")
-(make-help-screen iedit-help-for-help-internal
- (purecopy "Type a help option: [bkm] or ?")
- "You have typed %THIS-KEY%, the help character. Type a Help option:
+(make-help-screen
+ iedit-help-for-help-internal
+ (purecopy "Type a help option: [bkm] or ?")
+ "You have typed %THIS-KEY%, the help character. Type a Help option:
\(Type \\<help-map>\\[help-quit] to exit the Help command.)
b Display all Iedit key bindings.
@@ -210,7 +212,7 @@ m Display documentation of Iedit mode.
You can't type here other help keys available in the global help map,
but outside of this help window when you type them in Iedit mode,
they exit Iedit mode before displaying global help."
- iedit-help-map)
+ iedit-help-map)
(defun iedit-help-for-help ()
"Display Iedit help menu."
@@ -498,16 +500,10 @@ exit iedit mode."
(setq iedit-before-modification-string
(buffer-substring-no-properties beg end)))
;; after modification
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Check if we are inserting into zero-width occurrence. ;;
- ;; ;;
- ;; If so, then TWO modification hooks will be called -- ;;
- ;; "insert-in-front-hooks" and "insert-behind-hooks". ;;
- ;; ;;
- ;; We need to run just once. ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when (not iedit-buffering)
+ ;; Check if we are inserting into zero-width occurrence. If so, then
+ ;; TWO modification hooks will be called -- "insert-in-front-hooks" and
+ ;; "insert-behind-hooks". We need to run just once.
(if (and (= beg (overlay-start occurrence))
(= end (overlay-end occurrence))
(= change 0)
@@ -723,25 +719,25 @@ the buffer."
(offset (- (point) beg))) ;; delete-region move cursor
(when (not (string= iedit-before-modification-string modified-string))
(save-excursion
- ;; Rollback the current modification and buffer-undo-list. This is to
- ;; avoid the inconsistency if user undoes modifications
- (delete-region beg end)
- (goto-char beg)
- (insert-and-inherit iedit-before-modification-string)
- (setq buffer-undo-list iedit-before-modification-undo-list)
- (dolist (occurrence iedit-occurrences-overlays) ; todo:extract as a
function
- (let ((beginning (overlay-start occurrence))
- (ending (overlay-end occurrence)))
- (delete-region beginning ending)
- (unless (eq beg end) ;; replacement
- (goto-char beginning)
- (insert-and-inherit modified-string)))))
+ ;; Rollback the current modification and buffer-undo-list. This is to
+ ;; avoid the inconsistency if user undoes modifications
+ (delete-region beg end)
+ (goto-char beg)
+ (insert-and-inherit iedit-before-modification-string)
+ (setq buffer-undo-list iedit-before-modification-undo-list)
+ (dolist (occurrence iedit-occurrences-overlays) ; todo:extract as a
function
+ (let ((beginning (overlay-start occurrence))
+ (ending (overlay-end occurrence)))
+ (delete-region beginning ending)
+ (unless (eq beg end) ;; replacement
+ (goto-char beginning)
+ (insert-and-inherit modified-string)))))
(goto-char (+ (overlay-start ov) offset))))
(setq iedit-buffering nil)
(setq iedit-mode (propertize " Iedit" 'face 'font-lock-warning-face))
(force-mode-line-update)
(setq iedit-before-modification-undo-list nil)
- (message "Iedit-mode stop buffering."))
+ (message "Iedit-mode buffering stopped."))
(defun iedit-find-current-occurrence-overlay ()
"Always return the current occurrence overlay at point or point - 1,
- [nongnu] elpa/iedit 6d96992291 015/301: Remove duplicated comments, (continued)
- [nongnu] elpa/iedit 6d96992291 015/301: Remove duplicated comments, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 011e8d354c 016/301: Performance optimization of iedit-occurrence-update, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c8dac6bee8 020/301: exit iedit mode when change is not inside of occurrence., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 768d89b60c 022/301: Merge remote-tracking branch 'lewang/master', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 0edc86ff41 024/301: Fix the last occurrence problem when it is a complete symbol., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit dd7d2f95f8 027/301: fix org-mode text-property compatibility (use insert-and-inherit), ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d5d4027a33 030/301: fix `iedit-toggle-unmatched-lines-visible' for rectangles, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 652087d63c 036/301: fix warning: the function `make-sparse-key-map' is not known to be, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit da47784c8d 038/301: Add iedit mode easy access keys, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c53a885fe5 040/301: Add bufferring modification functionalities, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9bc57d2a30 041/301: make iedit-skipped-modification-once buffer local,
ELPA Syncer <=
- [nongnu] elpa/iedit e99e65fccb 044/301: Fix current point move problem when call iedit-replace-occurrences., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4e31d50327 052/301: Add a prefix arg handling to iedit-toggle-unmatched-lines-visible, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 87053a3d44 054/301: Remove two buffer local variables for rectangle., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e568677fe4 056/301: Add new functionality: restrict iedit-mode in region, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a9bda4db66 060/301: Refine hotkeys, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4fa7342be9 065/301: Copy from iedit.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b579dd0739 063/301: Update with new information, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a13c4d6b56 067/301: Remove README, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 90ef2d5ac9 064/301: Add digit prefix argment 0 to enable restricting match in a function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 697e24c337 073/301: remove a todo item: add ert test case, ELPA Syncer, 2022/01/10