[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 6e9ea1a 149/434: Merge pull request #20 f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 6e9ea1a 149/434: Merge pull request #20 from tkf/diff-friendly-save-lists |
Date: |
Sat, 7 Aug 2021 09:20:14 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 6e9ea1ae52a6ade62188cb954b8e3cf2b2ebe554
Merge: 8a12e97 f4d5aea
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Merge pull request #20 from tkf/diff-friendly-save-lists
Diff friendly .mc-lists.el
---
multiple-cursors-core.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 6312db5..387f7ea 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -479,6 +479,18 @@ 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))
+ (sort value (lambda (x y) (string-lessp (symbol-name x)
+ (symbol-name y)))))
+ (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 +500,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 ae0033f 140/434: Protect post-command-hook from errors to avoids undead cursors, (continued)
- [nongnu] elpa/multiple-cursors ae0033f 140/434: Protect post-command-hook from errors to avoids undead cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fcbb7a4 152/434: Make mc/cycle-forward and mc/cycle-backward loop around by default., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 876937b 153/434: Use (interactive "P") instead of the weird (but equivalent) (interactive (list prefix-arg)), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1ec78e1 162/434: Don't let mc/mark-lines create 'double' cursors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1074c88 178/434: Added mc/mark-all-like-this-dwim, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9582c72 204/434: Add mc/insert-numbers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d534132 122/434: Remove todo.org - use issues instead, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f7d393d 128/434: Don't use next-line and previous-line in non-interactive ways., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc59b63 131/434: Fix typo, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d98b85b 138/434: Bump to 1.1.2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6e9ea1a 149/434: Merge pull request #20 from tkf/diff-friendly-save-lists,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 6d4979d 144/434: Bump to 1.1.3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b3ca408 171/434: Have to require 'cl for now, because of count-if., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a6984a1 203/434: Merge pull request #53 from oneself/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a37e02b 177/434: Add new mc-commands to default run-once list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6339657 192/434: Fix byte-compilation warnings, and avoid unnecessary use of "eval", ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 641eb68 212/434: Can use mc/reverse-regions w/o region or cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0ee76bf 214/434: Add mc/add-cursor-on-click, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 16589a5 224/434: Update README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5c60757 216/434: export ECUKES_EMACS in run-travis-ci.sh, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6467fe2 277/434: Add mc/mark-all-dwim to autoloads, ELPA Syncer, 2021/08/07