[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 324d935 157/434: Split macro mc/for-each-
From: |
ELPA Syncer |
Subject: |
[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. |
Date: |
Sat, 7 Aug 2021 09:20:16 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 324d9354b5bba9f354dde16717f74e8420db72e6
Author: Marco Baringer <mb@bese.it>
Commit: Marco Baringer <mb@bese.it>
Split macro mc/for-each-fake-cursor into a function returning all the
cursor overlays and a macro to loop over this list.
---
multiple-cursors-core.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 387f7ea..b2576e9 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -49,12 +49,16 @@
(setq buffer-undo-list ;; otherwise add a function to activate this
cursor
(cons (cons 'apply (cons 'activate-cursor-for-undo (list id)))
buffer-undo-list)))))
+(defun mc/all-fake-cursors (&optional start end)
+ (remove-if-not (lambda (overlay)
+ (mc/fake-cursor-p overlay))
+ (overlays-in (or start (point-min))
+ (or end (point-max)))))
+
(defmacro mc/for-each-fake-cursor (&rest forms)
"Runs the body for each fake cursor, bound to the name cursor"
- `(mapc #'(lambda (cursor)
- (when (mc/fake-cursor-p cursor)
- ,@forms))
- (overlays-in (point-min) (point-max))))
+ `(mapc #'(lambda (cursor) ,@forms)
+ (mc/all-fake-cursors)))
(defmacro mc/save-excursion (&rest forms)
"Saves and restores all the state that multiple-cursors cares about."
- [nongnu] elpa/multiple-cursors fca0685 055/434: Use symbol properties on commands instead of maintaining a list of unsupported commands., (continued)
- [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, 2021/08/07
- [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 <=
- [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
- [nongnu] elpa/multiple-cursors a4f6ea1 205/434: Add transient-mark-mode to mc/cursor-specific-vars to fix other selections than C-SPC. Fixes #55, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3ce6e4a 199/434: Avoid strange behavior with smartrep, ELPA Syncer, 2021/08/07