[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 00f9055 146/434: Add mc/dump-list to make
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 00f9055 146/434: Add mc/dump-list to make mc/save-lists diff-friendly |
Date: |
Sat, 7 Aug 2021 09:20:14 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 00f905549e40a333447ecbe3701f0205ece995a5
Author: Takafumi Arakaki <aka.tkf@gmail.com>
Commit: Takafumi Arakaki <aka.tkf@gmail.com>
Add mc/dump-list to make mc/save-lists diff-friendly
---
multiple-cursors-core.el | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 6312db5..132c415 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -479,6 +479,17 @@ from being executed if in multiple-cursors-mode."
"The position of the file that keeps track of your preferences
for running commands with multiple cursors.")
+(defun mc/dump-list (list-symbol)
+ "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
+ (let ((value (symbol-value list-symbol)))
+ (insert "(setq " (symbol-name list-symbol) "\n"
+ " '(")
+ (newline-and-indent)
+ (mapc #'(lambda (cmd) (insert (format "%S" cmd)) (newline-and-indent))
+ value)
+ (insert "))")
+ (newline)))
+
(defun mc/save-lists ()
"Saves preferences for running commands with multiple cursors to
`mc/list-file'"
(with-temp-file mc/list-file
@@ -488,21 +499,9 @@ for running commands with multiple cursors.")
(insert ";; It keeps track of your preferences for running commands with
multiple cursors.")
(newline)
(newline)
- (insert "(setq mc/cmds-to-run-for-all '(")
- (mapc #'(lambda (cmd) (insert (format "%S" cmd)) (newline-and-indent))
mc/cmds-to-run-for-all)
- (when mc/cmds-to-run-for-all
- (forward-line -1)
- (end-of-line))
- (insert "))")
+ (mc/dump-list 'mc/cmds-to-run-for-all)
(newline)
- (newline)
- (insert "(setq mc/cmds-to-run-once '(")
- (mapc #'(lambda (cmd) (insert (format "%S" cmd)) (newline-and-indent))
mc/cmds-to-run-once)
- (when mc/cmds-to-run-once
- (forward-line -1)
- (end-of-line))
- (insert "))")
- (newline)))
+ (mc/dump-list 'mc/cmds-to-run-once)))
(defvar mc/cmds-to-run-once nil
"Commands to run only once in multiple-cursors-mode.")
- [nongnu] elpa/multiple-cursors b51ee01 017/434: More white-listing., (continued)
- [nongnu] elpa/multiple-cursors b51ee01 017/434: More white-listing., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 53dd119 032/434: Add docstring., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c2bb81f 042/434: Dont forget to require rectangular-region-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ba11b12 051/434: Make interprogram-paste work for all cursors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8c8d52f 049/434: Run pre-command-hooks for each cursor, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c1fba2c 111/434: Add travis badge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f73569f 125/434: Update documentation., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ce777dc 134/434: Add some mouse-commands to the run-once list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 879ddb0 150/434: Add Takafumi Arakaki to list of contributors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 64ffd81 142/434: Add quoted-insert to run-for-all list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 00f9055 146/434: Add mc/dump-list to make mc/save-lists diff-friendly,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 7a6eb0d 145/434: Never execute keyboard macros for fake cursors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 82a1fe3 209/434: Add mc/sort-regions and mc/reverse-regions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors aa9a1ec 220/434: Add failing scenarios for mark-all-symbols/words, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e7a5fe6 213/434: Release 1.2.1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6b09b9c 172/434: Add some more basic commands to the run-all and run-once lists., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7382b46 170/434: Merge pull request #30 from gvol/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5f7c92b 173/434: Add more backward-delete commands to run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3f3cdc6 207/434: Merge pull request #56 from paradoxxxzero/transient-mark-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7d79b98 182/434: Autoload new functions., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0b9aae1 188/434: Merge pull request #40 from tkf/fix-dump-list, ELPA Syncer, 2021/08/07