[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit dbf3f9a0e3 290/301: Add iedit-update-key-bindings
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit dbf3f9a0e3 290/301: Add iedit-update-key-bindings |
Date: |
Mon, 10 Jan 2022 22:59:11 -0500 (EST) |
branch: elpa/iedit
commit dbf3f9a0e3029bb9c9f335c7b906d68201567d6d
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor <victorhge@gmail.com>
Add iedit-update-key-bindings
---
iedit.el | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/iedit.el b/iedit.el
index 1ff33d7cc6..268d664b5d 100755
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010 - 2019, 2020, 2021 Victor Ren
-;; Time-stamp: <2021-01-16 13:48:39 Victor Ren>
+;; Time-stamp: <2021-08-05 15:18:16 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.9.9.9
@@ -275,18 +275,24 @@ This is like `describe-bindings', but displays only Iedit
keys."
(length iedit-occurrences-overlays))
;;; Default key bindings:
+(defun iedit-update-key-bindings (key)
+ "Update default key bindings."
+ (when (and key (not (eq key
+ (car (where-is-internal
'iedit-mode)))))
+ (let ((key-def (lookup-key (current-global-map) key)))
+ (if key-def
+ (display-warning 'iedit (format "Iedit default key %S is occupied by
%s."
+ (key-description key)
+ key-def)
+ :warning)
+ (define-key global-map key 'iedit-mode)
+ (define-key isearch-mode-map key 'iedit-mode-from-isearch)
+ (define-key esc-map key 'iedit-execute-last-modification)
+ (define-key help-map key 'iedit-mode-toggle-on-function)
+ (message "Iedit default key binding is %s" (key-description
key))))))
+
(when (and iedit-toggle-key-default (null (where-is-internal 'iedit-mode)))
- (let ((key-def (lookup-key (current-global-map) iedit-toggle-key-default)))
- (if key-def
- (display-warning 'iedit (format "Iedit default key %S is occupied by
%s."
- (key-description
iedit-toggle-key-default)
- key-def)
- :warning)
- (define-key global-map iedit-toggle-key-default 'iedit-mode)
- (define-key isearch-mode-map iedit-toggle-key-default
'iedit-mode-from-isearch)
- (define-key esc-map iedit-toggle-key-default
'iedit-execute-last-modification)
- (define-key help-map iedit-toggle-key-default
'iedit-mode-toggle-on-function)
- (message "Iedit default key binding is %s" (key-description
iedit-toggle-key-default)))))
+ (iedit-update-key-bindings iedit-toggle-key-default))
;; Avoid to restore Iedit mode when restoring desktop
(add-to-list 'desktop-minor-mode-handlers
@@ -765,6 +771,7 @@ prefix, bring the top of the region back down one
occurrence."
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
(iedit-cleanup-occurrences-overlays beg end exclusive)
+ (setq iedit-initial-region (list beg end exclusive))
(if iedit-hiding
(iedit-hide-context-lines iedit-occurrence-context-lines))
(force-mode-line-update)))
- [nongnu] elpa/iedit 4e8b9453ac 261/301: Update occurrences in `post-command-hook', (continued)
- [nongnu] elpa/iedit 4e8b9453ac 261/301: Update occurrences in `post-command-hook', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3c305620ae 250/301: Optimize iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 85fad4a3b7 233/301: Merge pull request #73 from lionel-/feature-mode-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a7f5ed7cf9 257/301: Turn off iedit-mode at running `iedit-mode-toggle-on-function` twice, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 5050b7e88e 260/301: Fix a failed test case when Emacs is compiled without GUI, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit afca4e6bbf 213/301: Rename hook functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7ab2509231 225/301: Expand iedit-regexp-quote with passthrough, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit efe98b2015 248/301: fix `iedit-mode-on-fuction problem, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 01fa1e5925 217/301: Fix error if sgml-electric-tag-pair-mode not bound, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d7db0e5d19 279/301: Replace `iedit-lib-aborting-hook' with a callback function, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit dbf3f9a0e3 290/301: Add iedit-update-key-bindings,
ELPA Syncer <=
- [nongnu] elpa/iedit 351bee5e0d 292/301: New iedit-record-changes, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 070775fb85 296/301: New feature: apply kmacro on occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3c7159a107 298/301: Avoid calling `iedit-lib-cleanup` twice, ELPA Syncer, 2022/01/10