[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 2f0c484817 283/301: Move iedit-buffering related to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 2f0c484817 283/301: Move iedit-buffering related to `iedit-lib' |
Date: |
Mon, 10 Jan 2022 22:59:10 -0500 (EST) |
branch: elpa/iedit
commit 2f0c484817e2768e715514fa58ffa78070b9918f
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor <victorhge@gmail.com>
Move iedit-buffering related to `iedit-lib'
---
iedit-lib.el | 47 ++++++++++++++++++++++++++++-------------------
iedit.el | 49 ++++++++++++++++---------------------------------
2 files changed, 44 insertions(+), 52 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 1c388e49a7..f89f6e47f4 100755
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010 - 2019, 2020 Victor Ren
-;; Time-stamp: <2021-01-13 22:27:53 Victor Ren>
+;; Time-stamp: <2021-01-14 23:56:53 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.9.9.9
@@ -432,6 +432,11 @@ there are."
(defun iedit-lib-start (mode-exit-func)
"Initialize the hooks."
+ (when iedit-auto-buffering
+ (iedit-start-buffering))
+ ;; Enforce skip modification once, errors may happen to cause this to be
+ ;; unset.
+ (setq iedit-skip-modification-once t)
(setq iedit-lib-quit-func mode-exit-func)
(add-hook 'post-command-hook 'iedit-update-occurrences-2 nil t)
(add-hook 'before-revert-hook iedit-lib-quit-func nil t)
@@ -441,11 +446,8 @@ there are."
(defun iedit-lib-cleanup ()
"Clean up occurrence overlay, invisible overlay and local variables."
+ (iedit-cleanup-occurrences-overlays)
(remove-hook 'post-command-hook 'iedit-update-occurrences-2 t)
- (remove-overlays nil nil iedit-occurrence-overlay-name t)
- ;; Close overlays opened by `isearch-range-invisible'
- (isearch-clean-overlays)
- (iedit-show-all)
(remove-hook 'before-revert-hook iedit-lib-quit-func t)
(remove-hook 'kbd-macro-termination-hook iedit-lib-quit-func t)
(remove-hook 'change-major-mode-hook iedit-lib-quit-func t)
@@ -1023,8 +1025,8 @@ modification is not going to be applied to other
occurrences."
(upcase modified-string))
(cap-initial
(if (= 0 offset)
- (capitalize modified-string)
- modified-string))
+ (capitalize modified-string)
+ modified-string))
(t modified-string))))
(iedit-move-conjoined-overlays occurrence))))
(goto-char (+ (overlay-start ov) offset))))))
@@ -1139,18 +1141,25 @@ Return nil if occurrence string is empty string."
(setq overlays (cdr overlays)))))
found))
-(defun iedit-cleanup-occurrences-overlays (beg end &optional inclusive)
- "Remove deleted overlays from list `iedit-occurrences-overlays'."
- (if inclusive
- (remove-overlays beg end iedit-occurrence-overlay-name t)
- (remove-overlays (point-min) beg iedit-occurrence-overlay-name t)
- (remove-overlays end (point-max) iedit-occurrence-overlay-name t))
- (let (overlays)
- (dolist (overlay iedit-occurrences-overlays)
- (if (overlay-buffer overlay)
- (push overlay overlays)))
- (setq iedit-occurrences-overlays overlays)
- (iedit-update-index)))
+(defun iedit-cleanup-occurrences-overlays (&optional beg end inclusive)
+ "Remove overlays from list `iedit-occurrences-overlays'."
+ (when iedit-buffering
+ (iedit-stop-buffering))
+ ;; Close overlays opened by `isearch-range-invisible'
+ (isearch-clean-overlays)
+ (iedit-show-all)
+ (if (null beg)
+ (remove-overlays nil nil iedit-occurrence-overlay-name t)
+ (if inclusive
+ (remove-overlays beg end iedit-occurrence-overlay-name t)
+ (remove-overlays (point-min) beg iedit-occurrence-overlay-name t)
+ (remove-overlays end (point-max) iedit-occurrence-overlay-name t))
+ (let (overlays)
+ (dolist (overlay iedit-occurrences-overlays)
+ (if (overlay-buffer overlay)
+ (push overlay overlays)))
+ (setq iedit-occurrences-overlays overlays)
+ (iedit-update-index))))
(defun iedit-printable (string)
"Return a omitted substring that is not longer than 50.
diff --git a/iedit.el b/iedit.el
index edc1a8e212..641fb91dfc 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010 - 2019, 2020 Victor Ren
-;; Time-stamp: <2021-01-13 22:39:04 Victor Ren>
+;; Time-stamp: <2021-01-14 23:52:39 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.9.9.9
@@ -466,9 +466,6 @@ Keymap used within overlays:
(defun iedit-start (occurrence-regexp beg end)
"Start Iedit mode for the `occurrence-regexp' in the current buffer."
- ;; enforce skip modification once, errors may happen to cause this to be
- ;; unset.
- (setq iedit-skip-modification-once t)
(setq iedit-initial-region (list beg end))
(let ((counter 0))
(if (eq iedit-occurrence-type-local 'markup-tag)
@@ -482,8 +479,6 @@ Keymap used within overlays:
counter
(iedit-printable occurrence-regexp))
(setq iedit-mode t))
- (when iedit-auto-buffering
- (iedit-start-buffering))
(iedit-lib-start 'iedit-done)
(run-hooks 'iedit-mode-hook))
@@ -570,8 +565,6 @@ Return the tag if succeeded, nil if failed."
"Exit Iedit mode.
Save the current occurrence string locally and globally. Save
the initial string globally."
- (when iedit-buffering
- (iedit-stop-buffering))
(setq iedit-last-occurrence-local (iedit-current-occurrence-string))
(setq iedit-occurrence-type-global iedit-occurrence-type-local)
(setq iedit-last-occurrence-global iedit-last-occurrence-local)
@@ -763,12 +756,9 @@ prefix, bring the top of the region back down one
occurrence."
"Restricting Iedit mode in a region."
(if (null (iedit-find-overlay beg end 'iedit-occurrence-overlay-name
exclusive))
(iedit-done)
- (when iedit-buffering
- (iedit-stop-buffering))
(setq iedit-last-occurrence-local (iedit-current-occurrence-string))
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
- (iedit-show-all)
(iedit-cleanup-occurrences-overlays beg end exclusive)
(if iedit-hiding
(iedit-hide-context-lines iedit-occurrence-context-lines))
@@ -778,12 +768,9 @@ prefix, bring the top of the region back down one
occurrence."
"Toggle case-sensitive matching occurrences. "
(interactive)
(setq iedit-case-sensitive (not iedit-case-sensitive))
- (if iedit-buffering
- (iedit-stop-buffering))
(setq iedit-last-occurrence-local (iedit-current-occurrence-string))
(when iedit-last-occurrence-local
- (remove-overlays nil nil iedit-occurrence-overlay-name t)
- (iedit-show-all)
+ (iedit-cleanup-occurrences-overlays)
(let* ((occurrence-regexp (iedit-regexp-quote iedit-last-occurrence-local))
(begin (car iedit-initial-region))
(end (cadr iedit-initial-region))
@@ -803,25 +790,21 @@ prefix, bring the top of the region back down one
occurrence."
(if iedit-search-invisible
nil
(or search-invisible 'open)))
- (if iedit-buffering
- (iedit-stop-buffering))
(let ((occurrence-string (iedit-current-occurrence-string)))
- (when occurrence-string
- (remove-overlays nil nil iedit-occurrence-overlay-name t)
- (iedit-show-all)
- (isearch-clean-overlays)
- (let* ((occurrence-regexp (iedit-regexp-quote occurrence-string))
- (begin (car iedit-initial-region))
- (end (cadr iedit-initial-region))
- (counter (iedit-make-occurrences-overlays occurrence-regexp begin
end)))
- (message "iedit %s. %d matches for \"%s\""
- (if iedit-search-invisible
- "matching invisible"
- "matching visible")
- counter
- (iedit-printable occurrence-regexp))
- (setq iedit-last-occurrence-local occurrence-string)
- (force-mode-line-update)))))
+ (when occurrence-string
+ (iedit-cleanup-occurrences-overlays)
+ (let* ((occurrence-regexp (iedit-regexp-quote occurrence-string))
+ (begin (car iedit-initial-region))
+ (end (cadr iedit-initial-region))
+ (counter (iedit-make-occurrences-overlays
occurrence-regexp begin end)))
+ (message "iedit %s. %d matches for \"%s\""
+ (if iedit-search-invisible
+ "matching invisible"
+ "matching visible")
+ counter
+ (iedit-printable occurrence-regexp))
+ (setq iedit-last-occurrence-local occurrence-string)
+ (force-mode-line-update)))))
(provide 'iedit)
- [nongnu] elpa/iedit 76ff4aa6b9 218/301: Merge pull request #64 from justbur/sgml-error, (continued)
- [nongnu] elpa/iedit 76ff4aa6b9 218/301: Merge pull request #64 from justbur/sgml-error, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2221a517a8 227/301: Fix comments, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 0ef1410ec5 259/301: Add iedit-show/hide-occurrence-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 326b6f7787 263/301: Merge `iedit-number-occurrences' and `iedit-increment-occurrences', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 02bad3e3b9 240/301: Fix compile warnings, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit abb577e447 236/301: Merge pull request #77 from EdwardBetts/spelling, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 39919478f9 230/301: fix C-R-RET key binding problem in term, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 77e1661134 246/301: Readme.org: add melpa/stable version badges, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f566ade5e4 264/301: Workaround for slow `c-before-change', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 64c3505d04 235/301: correct spelling mistake, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2f0c484817 283/301: Move iedit-buffering related to `iedit-lib',
ELPA Syncer <=
- [nongnu] elpa/iedit 7e277119fc 221/301: Fix doc string for markup tag, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 50b7da10ac 251/301: Add option `iedit-auto-buffering`, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3211c2ee6c 228/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 93b642f0a8 286/301: A few small fixes, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 02b4a6553e 243/301: Add the index of the current occurrence on mode-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06e600aae2 222/301: Fix: use return value of iedit-default-occurrence-mode-local, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit abcc27a9f0 231/301: Add Installation instruction, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8b620efacb 262/301: Replace `inhibit-modification-hooks' with `iedit-updating', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6d2694356c 253/301: Move "declare-function" invocations outside of "when" statement., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f6682186f0 242/301: Replace eval-after-load with require check, ELPA Syncer, 2022/01/10