[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors be149f9 378/434: Create customizable mc/i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors be149f9 378/434: Create customizable mc/insert-numbers-default |
Date: |
Sat, 7 Aug 2021 09:21:03 -0400 (EDT) |
branch: elpa/multiple-cursors
commit be149f9121840561b7a2df17a7a3b1838a1b1f4c
Author: Jules Tamagnan <jtamagnan@gmail.com>
Commit: Jules Tamagnan <jtamagnan@gmail.com>
Create customizable mc/insert-numbers-default
This commit fulfills the feature request from #248 and creates a
customizable variable called mc/insert-numbers-default which is the
starting value for mc/insert-numbers if no arg is passed
---
features/insert-numbers.feature | 21 +++++++++++++++++++++
mc-separate-operations.el | 11 +++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/features/insert-numbers.feature b/features/insert-numbers.feature
index 59db91f..191150e 100644
--- a/features/insert-numbers.feature
+++ b/features/insert-numbers.feature
@@ -17,3 +17,24 @@ Feature: Insert increasing numbers
When I press "C-u H-0"
And I press "SPC"
Then I should see "This 4 text contains the word 5 text thrice (6 text)"
+
+ Scenario: Three cursors, 0-1-2, default
+ Given I have cursors at "text" in "This text contains the word text thrice
(text)"
+ When I set mc/insert-numbers-default to 1
+ And I press "H-0"
+ And I press "SPC"
+ Then I should see "This 1 text contains the word 2 text thrice (3 text)"
+
+ Scenario: Three cursors, 9-10-11, default
+ Given I have cursors at "text" in "This text contains the word text thrice
(text)"
+ When I set mc/insert-numbers-default to 1
+ And I press "C-9 H-0"
+ And I press "SPC"
+ Then I should see "This 9 text contains the word 10 text thrice (11 text)"
+
+ Scenario: Three cursors, 9-10-11, default
+ Given I have cursors at "text" in "This text contains the word text thrice
(text)"
+ When I set mc/insert-numbers-default to 1
+ And I press "C-u H-0"
+ And I press "SPC"
+ Then I should see "This 4 text contains the word 5 text thrice (6 text)"
diff --git a/mc-separate-operations.el b/mc-separate-operations.el
index ca6e8d8..ca10775 100644
--- a/mc-separate-operations.el
+++ b/mc-separate-operations.el
@@ -31,13 +31,20 @@
;;;###autoload
(defun mc/insert-numbers (arg)
- "Insert increasing numbers for each cursor, starting at 0 or ARG."
+ "Insert increasing numbers for each cursor, starting at
+`mc/insert-numbers-default' or ARG."
(interactive "P")
(setq mc--insert-numbers-number (or (and arg (prefix-numeric-value arg))
- 0))
+ mc/insert-numbers-default))
(mc/for-each-cursor-ordered
(mc/execute-command-for-fake-cursor 'mc--insert-number-and-increase
cursor)))
+(defcustom mc/insert-numbers-default 0
+ "The default number at which to start counting for
+`mc/insert-numbers'"
+ :type 'integer
+ :group 'multiple-cursors)
+
(defvar mc--insert-numbers-number 0)
(defun mc--insert-number-and-increase ()
- [nongnu] elpa/multiple-cursors 9b53e89 344/434: Merge pull request #203 from dovej/master, (continued)
- [nongnu] elpa/multiple-cursors 9b53e89 344/434: Merge pull request #203 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ca822cd 347/434: Add mc/insert-letters function and test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 54c05c3 356/434: Add more aliases for cl stuff, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 06a2985 362/434: * mc-mark-more.el (mc/mark-all-in-region-regexp): Don't infloop when regexp matches empty string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4bf9860 364/434: Use cl-lib instead of shimming, which breaks in older emacsen, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d5b544e 365/434: Merge pull request #246 from purcell/cl-lib, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b3bd49c 372/434: Bump version to 1.4.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 741eec6 374/434: Update some copyright years, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a9daac1 375/434: Add/fix docstring to functions. fix #161, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors be149f9 378/434: Create customizable mc/insert-numbers-default,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors fd847ae 379/434: added mc/always-run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2ccfc74 382/434: Merge pull request #252 from bb2020/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 616fd84 395/434: Add ivy-done (from ivy) to the list of commands that are only executed once by default., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6d8c6fc 389/434: Pass tests., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7cb18b8 398/434: Fix bug in mc/mark-all-in-region-regexp. Fixes #293, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f628df7 408/434: Always call `mark` with `mark-even-if-inactive` set to t, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f33cdd4 404/434: Fix minor error, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e419903 411/434: Merge pull request #324 from mkcms/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e048e04 406/434: Fix #271: The command yank can't work, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b880554 427/434: Fix typos (#359), ELPA Syncer, 2021/08/07