[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 45c6cd0 256/434: Add mc/mark-all-dwim
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 45c6cd0 256/434: Add mc/mark-all-dwim |
Date: |
Sat, 7 Aug 2021 09:20:37 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 45c6cd0be44039f3c35dc0e37952716962c3e430
Author: Maciej Katafiasz <mathrick@gmail.com>
Commit: Maciej Katafiasz <mathrick@gmail.com>
Add mc/mark-all-dwim
---
mc-mark-more.el | 16 ++++++++++++++++
multiple-cursors-core.el | 1 +
2 files changed, 17 insertions(+)
diff --git a/mc-mark-more.el b/mc-mark-more.el
index 7e240a1..26bbe6f 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -416,6 +416,22 @@ With prefix, it behaves the same as original
`mc/mark-all-like-this'"
(when (<= (mc/num-cursors) before)
(mc/mark-all-like-this))))))
+(defun mc/mark-all-dwim (arg)
+ "Tries even harder to guess what you want to mark all of.
+
+If the region is active and spans multiple lines, it will behave
+as if `mc/mark-all-in-region'. Otherwise, it will delegate to
+`mc/mark-all-like-this-dwim' or `mc/mark-all-like-this' (if the
+prefix ARG is present)"
+ (interactive "P")
+ (if (and (use-region-p)
+ (not (= (line-number-at-pos (region-beginning))
+ (line-number-at-pos (region-end)))))
+ (call-interactively 'mc/mark-all-in-region)
+ (progn
+ (setq this-command 'mc/mark-all-like-this-dwim)
+ (mc/mark-all-like-this-dwim arg))))
+
(defun mc--in-defun ()
(bounds-of-thing-at-point 'defun))
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index d073090..4b30cf9 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -573,6 +573,7 @@ for running commands with multiple cursors.")
mc/mark-all-words-like-this-in-defun
mc/mark-all-symbols-like-this-in-defun
mc/mark-all-like-this-dwim
+ mc/mark-all-dwim
mc/mark-sgml-tag-pair
mc/insert-numbers
mc/sort-regions
- [nongnu] elpa/multiple-cursors 53db250 237/434: Added a mark-pop.feature file., (continued)
- [nongnu] elpa/multiple-cursors 53db250 237/434: Added a mark-pop.feature file., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 69c9961 234/434: Use Carton for dev dependencies, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 75df47f 236/434: Added mention of mc/mark-pop to README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1cb894d 242/434: Add more mc-specific commands to the run-once list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 47e03d5 249/434: Release 1.2.2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4a7fb32 059/434: Autotest, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors eda9952 058/434: Finally got the tests running. :-), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1d5b54e 070/434: Separate default cmd-lists and those populated by the end user., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 398cc9e 251/434: Merge pull request #92 from knu/mark_by_logical_lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e8d7344 252/434: Fix the doc string of mc/mark-pop, which was not updated after a copy., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 45c6cd0 256/434: Add mc/mark-all-dwim,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors e28090d 259/434: Merge pull request #106 from porterjamesj/patch-1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d69ae15 073/434: Use setq for default lists to be able to re-evaluate., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 487e8be 006/434: Added docstrings to each function., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a4d406e 011/434: Conclude multiple-cursors-mode with <return>, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dcd9c52 022/434: Add new feature test., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 03dfc70 024/434: A working multiple-regions implementation, with some issues., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1392027 031/434: Separate secondary stuff from core., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 759391e 045/434: Don't message about skipping known run-once commands, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 71f444a 050/434: Remove unused commands from whitelist., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 822bf18 056/434: Update test., ELPA Syncer, 2021/08/07