[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 29869ebed0 118/301: Add buffer local variable iedit-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 29869ebed0 118/301: Add buffer local variable iedit-occurrence-keymap |
Date: |
Mon, 10 Jan 2022 22:58:55 -0500 (EST) |
branch: elpa/iedit
commit 29869ebed08c822bfd123420e03ec4bfd6ab4e68
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Add buffer local variable iedit-occurrence-keymap
---
iedit-lib.el | 25 ++++++++++++-------------
iedit-rect.el | 6 +++---
iedit.el | 5 +++--
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 243318d71b..73f8889256 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-09-05 09:33:31 Victor Ren>
+;; Time-stamp: <2012-09-05 09:46:44 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -165,7 +165,11 @@ is not applied to other occurrences when it is true.")
(define-key map (kbd "M->") 'iedit-last-occurrence)
(define-key map (kbd "C-?") 'iedit-help-for-occurrences)
map)
- "Default keymap used within overlays.")
+ "Default keymap used within occurrence overlays.")
+
+(defvar iedit-occurrence-keymap 'iedit-occurrence-keymap-default
+ "Keymap used within occurrence overlays")
+(make-local-variable 'iedit-occurrence-context-lines)
(defun iedit-help-for-occurrences ()
"Display `iedit-occurrence-keymap-default'"
@@ -182,20 +186,18 @@ is not applied to other occurrences when it is true.")
(substitute-command-keys "\\[iedit-last-occurrence]")
":first/last "
)))
-(defun iedit-make-occurrences-overlays (occurrence-exp beg end &optional
keymap)
+(defun iedit-make-occurrences-overlays (occurrence-exp beg end)
"Create occurrence overlays for `occurrence-exp' in a region.
Return the number of occurrences."
(setq iedit-aborting nil)
(setq iedit-occurrences-overlays nil)
- (unless keymap
- (setq keymap iedit-occurrence-keymap-default))
;; Find and record each occurrence's markers and add the overlay to the
occurrences
(let ((counter 0)
(case-fold-search (not iedit-case-sensitive-local)))
(save-excursion
(goto-char beg)
(while (re-search-forward occurrence-exp end t)
- (push (iedit-make-occurrence-overlay (match-beginning 0) (match-end 0)
keymap)
+ (push (iedit-make-occurrence-overlay (match-beginning 0) (match-end 0))
iedit-occurrences-overlays)
(setq counter (1+ counter)))
(message "%d matches for \"%s\"" counter (iedit-printable
occurrence-exp))
@@ -205,15 +207,12 @@ Return the number of occurrences."
(iedit-hide-unmatched-lines iedit-occurrence-context-lines))))
counter))
-(defun iedit-add-next-occurrence-overlay (occurrence-exp &optional keymap)
+(defun iedit-add-next-occurrence-overlay (occurrence-exp)
"Create next occurrence overlay for `occurrence-exp'."
- (unless keymap
- (setq keymap iedit-occurrence-keymap-default))
(let ((case-fold-search (not iedit-case-sensitive-local)))
(when (re-search-forward occurrence-exp nil t)
(push (iedit-make-occurrence-overlay (match-beginning 0)
- (match-end 0)
- keymap)
+ (match-end 0))
iedit-occurrences-overlays)
(sort iedit-occurrences-overlays
(lambda (left right)
@@ -252,7 +251,7 @@ there are."
(setq iedit-before-modification-string "")
(setq iedit-before-modification-undo-list nil))
-(defun iedit-make-occurrence-overlay (begin end keymap)
+(defun iedit-make-occurrence-overlay (begin end)
"Create an overlay for an occurrence in Iedit mode.
Add the properties for the overlay: a face used to display a
occurrence's default value, and modification hooks to update
@@ -260,7 +259,7 @@ occurrences if the user starts typing."
(let ((occurrence (make-overlay begin end (current-buffer) nil t)))
(overlay-put occurrence iedit-occurrence-overlay-name t)
(overlay-put occurrence 'face 'iedit-occurrence)
- (overlay-put occurrence 'keymap keymap)
+ (overlay-put occurrence 'keymap iedit-occurrence-keymap)
(overlay-put occurrence 'insert-in-front-hooks '(iedit-occurrence-update))
(overlay-put occurrence 'insert-behind-hooks '(iedit-occurrence-update))
(overlay-put occurrence 'modification-hooks '(iedit-occurrence-update))
diff --git a/iedit-rect.el b/iedit-rect.el
index 66081e1eda..a668956c9a 100644
--- a/iedit-rect.el
+++ b/iedit-rect.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-08-31 11:34:26 Victor Ren>
+;; Time-stamp: <2012-09-05 09:49:55 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -107,6 +107,7 @@ Commands:
(setq iedit-occurrences-overlays nil)
(setq iedit-rectangle (list beg end))
(setq iedit-initial-string-local nil)
+ (setq iedit-occurrence-keymap iedit-rect-keymap)
(save-excursion
(let ((beg-col (progn (goto-char beg) (current-column)))
(end-col (progn (goto-char end) (current-column))))
@@ -120,8 +121,7 @@ Commands:
(point))
(progn
(move-to-column end-col t)
- (point))
- iedit-rect-keymap)
+ (point)))
iedit-occurrences-overlays)
(forward-line 1))
until (> (point) end))
diff --git a/iedit.el b/iedit.el
index fc3370bd12..78873b0e27 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-08-31 11:28:00 Victor Ren>
+;; Time-stamp: <2012-09-05 09:47:56 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -353,13 +353,14 @@ Keymap used within overlays:
(defun iedit-refresh (occurrence-exp beg end)
"Refresh Iedit mode."
(setq occurrence-exp (regexp-quote occurrence-exp))
+ (setq iedit-occurrence-keymap iedit-mode-occurrence-keymap)
(when iedit-only-complete-symbol-local
(setq occurrence-exp (concat "\\_<" occurrence-exp "\\_>")))
(setq iedit-mode
(propertize
(concat " Iedit:"
(number-to-string
- (iedit-make-occurrences-overlays occurrence-exp beg end
iedit-mode-occurrence-keymap)))
+ (iedit-make-occurrences-overlays occurrence-exp beg end)))
'face
'font-lock-warning-face))
(force-mode-line-update))
- [nongnu] elpa/iedit 697e24c337 073/301: remove a todo item: add ert test case, (continued)
- [nongnu] elpa/iedit 697e24c337 073/301: remove a todo item: add ert test case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 428be4e13e 078/301: Fix iedit-kill-rectangle problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f348f2d8fb 004/301: updates, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit da0a24701b 005/301: Add option to match only complete words, not inside words, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1b3672d28a 069/301: Init, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8e87f353fe 006/301: add me as a contributor, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 59ce7fa759 091/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 307262b25a 093/301: (add-hook 'change-major-mode-hook 'iedit-done nil t), ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d2a6e16977 055/301: Update commentary with rectangle support, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 76eeb87b95 102/301: Add feekback message for iedit-restrict-function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 29869ebed0 118/301: Add buffer local variable iedit-occurrence-keymap,
ELPA Syncer <=
- [nongnu] elpa/iedit ec765ee0c4 018/301: implement interactive string-rectangle mode with universal argument and region selected, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d4b9fd53ce 019/301: don't call hooks when there is only text properites change, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7ed8e04557 021/301: Optmize iedit-hide-unmatched-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e6f558539e 025/301: fix org-mode text-property compatibility (use insert-and-inherit), ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 039c0e23ab 023/301: Postpone iedit-done after commands are excuted., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c5a0d4de84 028/301: fix zero-width rectangle insertion, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 13ecba138a 026/301: Merge branch 'upstream-master', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1d070b7d36 029/301: move init code for iedit-mode-map inside defvar, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a75c44645a 031/301: fix bug with autopair and iedit-rect, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 20c1075948 032/301: remove conditions on setting `iedit-before-modification-string'., ELPA Syncer, 2022/01/10