[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors d27870d 421/434: Load mc/list-file as lat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors d27870d 421/434: Load mc/list-file as late as possible |
Date: |
Sat, 7 Aug 2021 09:21:13 -0400 (EDT) |
branch: elpa/multiple-cursors
commit d27870dff3a765e1c1fcb0ea5e433ec62a62dfb6
Author: Andrew Whatson <whatson@gmail.com>
Commit: Andrew Whatson <whatson@gmail.com>
Load mc/list-file as late as possible
Previously the list file was loaded immediately upon loading
`multiple-cursors-core`. This doesn't work well with modern autoloading
emacs configurations, where customisation is mostly done in
`eval-after-load` hooks; the default file location is loaded, *then*
the value of `mc/list-file` is changed, and everyone is confused.
---
multiple-cursors-core.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 935f6df..12e9e75 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -435,6 +435,10 @@ the original cursor, to inform about the lack of support."
(message "%S is not supported with multiple cursors%s"
original-command
(get original-command 'mc--unsupported))
+
+ ;; lazy-load the user's list file
+ (mc/load-lists)
+
(when (and original-command
(not (memq original-command
mc--default-cmds-to-run-once))
(not (memq original-command mc/cmds-to-run-once))
@@ -613,6 +617,15 @@ for running commands with multiple cursors."
:type 'file
:group 'multiple-cursors)
+(defvar mc--list-file-loaded nil
+ "Whether the list file has already been loaded.")
+
+(defun mc/load-lists ()
+ "Loads preferences for running commands with multiple cursors from
`mc/list-file'"
+ (unless mc--list-file-loaded
+ (load mc/list-file 'noerror 'nomessage)
+ (setq mc--list-file-loaded t)))
+
(defun mc/dump-list (list-symbol)
"Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
(cl-symbol-macrolet ((value (symbol-value list-symbol)))
@@ -817,10 +830,6 @@ for running commands with multiple cursors."
(defvar mc/cmds-to-run-for-all nil
"Commands to run for all cursors in multiple-cursors-mode")
-;; load, but no errors if it does not exist yet please, and no message
-;; while loading
-(load mc/list-file 'noerror 'nomessage)
-
(provide 'multiple-cursors-core)
;; Local Variables:
- [nongnu] elpa/multiple-cursors bbbe90d 349/434: Minor changes mark-next-like-this-word and readme, (continued)
- [nongnu] elpa/multiple-cursors bbbe90d 349/434: Minor changes mark-next-like-this-word and readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dd07bc5 351/434: Merge pull request #228 from jtamagnan/mark-next-like-this-word, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8297f1f 363/434: Merge pull request #241 from YoungFrog/fix-#230, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3112e61 377/434: When cursor-type is bar, mc/cursors appear as bars, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8413969 383/434: Merge pull request #253 from jtamagnan/fake-bar-cursor, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ddbe3ae 396/434: Merge pull request #278 from shlomme/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d2766bc 400/434: tips and tricks: add note about <return> and newlines; if it is not default, let it at least be more discoverable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0e49fec 410/434: Merge pull request #326 from pstray/issue325, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1075270 407/434: Added mc/interactive-repeating-commands (#303), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 038815b 414/434: Make "no more matches found." user-error, fix #218, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d27870d 421/434: Load mc/list-file as late as possible,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors fc6a6a7 422/434: Merge pull request #355 from flatwhatson/lazy-list-file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7763f4f 429/434: Load mc-cycle-cursors and mc-hide-unmatched-lines-mode after loading multiple-cursors-core, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a9d7764 431/434: Add option to disable bar-style fake cursors (#367), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 616fbdd 434/434: Document existing functions in Readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7ab8a8c 067/434: Better support for undo., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 608ceb4 069/434: Disable multiple-cursors-mode if there's only one cursor (the real one)., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 61280ae 100/434: autoload integration for package.el compatibility, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d82e252 106/434: Don't let fake cursors scroll the buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dc22766 108/434: Macros must be defined before they are used to be expanded properly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7a655b0 117/434: Disable emacs-snapshot tests until it is in order., ELPA Syncer, 2021/08/07