[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 80bc6f6 135/434: Temporarily disable auto
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 80bc6f6 135/434: Temporarily disable auto-complete-mode in multiple-cursors-mode |
Date: |
Sat, 7 Aug 2021 09:20:11 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 80bc6f6d560d14bc18d054c6ae9f527734492027
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Temporarily disable auto-complete-mode in multiple-cursors-mode
Fixes #12
---
multiple-cursors-core.el | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 2e280ff..3adcaa6 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -329,16 +329,41 @@ So you can paste it in later with `yank-rectangle'."
(unless (mc--all-equal entries)
(setq killed-rectangle entries))))
+(defvar mc/unsupported-minor-modes '(auto-complete-mode)
+ "List of minor-modes that does not play well with multiple-cursors.
+They are temporarily disabled when multiple-cursors are active.")
+
+(defvar mc/temporarily-disabled-minor-modes nil
+ "The list of temporarily disabled minor-modes.")
+(make-variable-buffer-local 'mc/temporarily-disabled-minor-modes)
+
+(defun mc/temporarily-disable-minor-mode (mode)
+ (when (and (boundp mode) (eval mode))
+ (add-to-list 'mc/temporarily-disabled-minor-modes mode)
+ (funcall mode -1)))
+
+(defun mc/temporarily-disable-unsupported-minor-modes ()
+ (mapc 'mc/temporarily-disable-minor-mode mc/unsupported-minor-modes))
+
+(defun mc/enable-minor-mode (mode)
+ (funcall mode 1))
+
+(defun mc/enable-temporarily-disabled-minor-modes ()
+ (mapc 'mc/enable-minor-mode mc/temporarily-disabled-minor-modes)
+ (setq mc/temporarily-disabled-minor-modes nil))
+
(define-minor-mode multiple-cursors-mode
"Mode while multiple cursors are active."
nil " mc" mc/keymap
(if multiple-cursors-mode
(progn
+ (mc/temporarily-disable-unsupported-minor-modes)
(add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors
t t)
(run-hooks 'multiple-cursors-mode-enabled-hook))
(remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t)
(mc--maybe-set-killed-rectangle)
(mc/remove-fake-cursors)
+ (mc/enable-temporarily-disabled-minor-modes)
(run-hooks 'multiple-cursors-mode-disabled-hook)))
(add-hook 'after-revert-hook #'(lambda () (multiple-cursors-mode 0)))
- [nongnu] elpa/multiple-cursors 4c91260 004/434: Updated readme., (continued)
- [nongnu] elpa/multiple-cursors 4c91260 004/434: Updated readme., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 399db27 012/434: More white-listed commands:, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fca0685 055/434: Use symbol properties on commands instead of maintaining a list of unsupported commands., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 50851e7 060/434: Add more core tests., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors de0519e 057/434: Add support for running lambdas for each cursor., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8ec468f 080/434: Don't save .mc-list.el when running tests., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4003aa1 102/434: Replace outdated function name with new one, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 605894d 121/434: Add link to video., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 26544fa 126/434: Bump version to 1.1.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 466d8bd 127/434: Don't use next-line non-interactively, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 80bc6f6 135/434: Temporarily disable auto-complete-mode in multiple-cursors-mode,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 80ebdbb 156/434: Added test for mc/mark-(next|previous)-like-this when there is no active region., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 324d935 157/434: Split macro mc/for-each-fake-cursor into a function returning all the cursor overlays and a macro to loop over this list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a8b6323 159/434: Remove superfluous lambda., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2818d9e 163/434: Rename mc/(first|last)-cursor-(before|after)-point to mention that they operate on fake cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 65d4f87 168/434: Added Ivan Andrus to list of contributors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 52300ff 190/434: Prevent byte-compilation warnings 'cl functions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 129ea77 189/434: 1.1.4, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors bfb293f 200/434: Merge pull request #48 from tkf/smartrep, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f1a5a39 197/434: Merge pull request #46 from tkf/fix-dump-list-take-2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b218a13 185/434: Run tests in Emacs 23, Emacs 24 and snapshot., ELPA Syncer, 2021/08/07