[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode |
Date: |
Mon, 10 Jan 2022 22:59:02 -0500 (EST) |
branch: elpa/iedit
commit 06bdb68bbf8a809d8be22e2e3a10281fbb522f1a
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Add iedit-switch-to-mc-mode
Iedit can switch to multiple-cursors-mode if you have it installed now.
---
iedit-lib.el | 23 ++++++++++++++++++++++-
iedit-rect.el | 4 ++--
iedit.el | 3 +--
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 8c0f70b7f0..01ebd7384a 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-06-08 10:44:42 Victor Ren>
+;; Time-stamp: <2016-06-11 12:57:46 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -580,6 +580,27 @@ value of `iedit-occurrence-context-lines' is used for this
time."
(iedit-barf-if-buffering)
(iedit-apply-on-occurrences 'upcase-region))
+(when (featurep 'multiple-cursors-core)
+ (require 'multiple-cursors-core)
+
+ (defun iedit-switch-to-mc-mode ()
+ "Switch to multiple-cursors-mode."
+ (interactive "*")
+ (iedit-barf-if-buffering)
+ (let* ((ov (iedit-find-current-occurrence-overlay))
+ (offset (- (point) (overlay-start ov)))
+ (master (point)))
+ (mc/save-excursion
+ (dolist (occurrence iedit-occurrences-overlays)
+ (goto-char (+ (overlay-start occurrence) offset))
+ (unless (= master (point))
+ (mc/create-fake-cursor-at-point))
+ ))
+ (multiple-cursors-mode 1)
+ (run-hooks 'iedit-aborting-hook)))
+
+ (define-key iedit-occurrence-keymap-default (kbd "M-M")
'iedit-switch-to-mc-mode))
+
(defun iedit-downcase-occurrences()
"Covert occurrences to lower case."
(interactive "*")
diff --git a/iedit-rect.el b/iedit-rect.el
index 112902bcfe..dce6b14a72 100644
--- a/iedit-rect.el
+++ b/iedit-rect.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-10-21 16:15:25 Victor Ren>
+;; Time-stamp: <2016-06-11 12:48:13 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -66,7 +66,7 @@ current mode is iedit-rect. Otherwise it is nil.
;;; Define Iedit rect mode map
(defvar iedit-rect-keymap
(let ((map (make-sparse-keymap)))
- (set-keymap-parent map iedit-occurrence-keymap-default)
+ (set-keymap-parent map iedit-occurrence-keymap)
(define-key map (kbd "M-K") 'iedit-kill-rectangle)
map)
"Keymap used within overlays in Iedit-rect mode.")
diff --git a/iedit.el b/iedit.el
index 1051596b14..5afcf037b9 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-06-10 22:29:42 Victor Ren>
+;; Time-stamp: <2016-06-11 12:23:07 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -429,7 +429,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)
- [nongnu] elpa/iedit 8c2316693a 198/301: Fix bug: C-u M-p does not work, (continued)
- [nongnu] elpa/iedit 8c2316693a 198/301: Fix bug: C-u M-p does not work, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locate the fist occurrence", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f9f87a0dd9 212/301: Add key bindings for iedit-quit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b4c7e41049 209/301: More doc for iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 18b99c1fb4 169/301: Fix compile warning and test case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit bd3fd44691 173/301: Added the default value for iedit-replace-occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b73b977839 204/301: Merge branch 'default-occurrence', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https://github.com/mbneedham/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode,
ELPA Syncer <=
- [nongnu] elpa/iedit b2bffd978c 184/301: Merge pull request #54 from Vifon/iedit-replace-occurences_default-case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d2f08e8862 163/301: Provide functions to narrow around current-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 27dbbdda0b 162/301: Split iedit-occurrence-update into two functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9a40f6fa36 205/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 97ad9d0600 254/301: removed downcasing the from-string in iedit-lib.el/iedit-replace-occurrences to allow case sensitivity., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7a3725cd04 267/301: Small optimizations, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 42654ba7ed 266/301: iedit-rect.el: Don't set iedit-initial-string-local, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d335d6842a 183/301: Check if the default keybinding of iedit-mode is taken, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e575cbf569 256/301: Allow adding a incremented number in each occurence, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 796ee5298d 237/301: fix the key conflict with yas-minor-mode, ELPA Syncer, 2022/01/10