[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auto-correct f9c542b 08/11: auto-correct: Defer loading
From: |
Stefan Monnier |
Subject: |
[elpa] externals/auto-correct f9c542b 08/11: auto-correct: Defer loading of flyspell support until after flyspell has been enabled |
Date: |
Tue, 1 Dec 2020 15:17:29 -0500 (EST) |
branch: externals/auto-correct
commit f9c542ba5a6a92b048f29a2d49ef97b49450a962
Author: Ian Dunn <dunni@gnu.org>
Commit: Ian Dunn <dunni@gnu.org>
auto-correct: Defer loading of flyspell support until after flyspell has
been enabled
* packages/auto-correct/auto-correct.el: Bump version
(auto-correct-defer-flyspell-support):
(auto-correct-set-enable-flyspell-support): New functions.
(auto-correct-enable-flyspell-support): Use them for customization
setting.
---
auto-correct.el | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/auto-correct.el b/auto-correct.el
index d9e1039..3d65f15 100644
--- a/auto-correct.el
+++ b/auto-correct.el
@@ -5,7 +5,7 @@
;; Author: Ian Dunn <dunni@gnu.org>
;; Maintainer: Ian Dunn <dunni@gnu.org>
;; Keywords: editing
-;; Version: 1.1.2
+;; Version: 1.1.3
;; This file is part of GNU Emacs.
@@ -234,15 +234,32 @@ Activation means adding `auto-correct-flyspell-insert' to
#'auto-correct-flyspell-insert)
(remove-function flyspell-insert-function #'auto-correct-flyspell-insert)))
+;; Silence the byte-compiler; this will be enabled shortly
+(defvar auto-correct-enable-flyspell-support)
+
+(defun auto-correct-defer-flyspell-support ()
+ ;; Don't fully activate flyspell support until after it's loaded.
+ (with-eval-after-load 'flyspell
+ (auto-correct-handle-support
+ auto-correct-enable-flyspell-support
+ 'auto-correct--activate-flyspell-support)))
+
+(defun auto-correct-set-enable-flyspell-support (sym val)
+ (set sym val)
+ (auto-correct-defer-flyspell-support))
+
(defcustom auto-correct-enable-flyspell-support t
- "Whether to automatically correct corrections made in flyspell."
+ "Whether to automatically correct corrections made in flyspell.
+
+Support will not be enabled until after flyspell has been loaded.
+
+Use the following to set this manually to NEW-VALUE:
+
+(setq auto-correct-enable-flyspell-support NEW-VALUE)
+(auto-correct-defer-flyspell-support)"
:group 'auto-correct
:type 'boolean
- :set (lambda (sym val)
- (set sym val)
- (auto-correct-handle-support
- val
- 'auto-correct--activate-flyspell-support)))
+ :set 'auto-correct-set-enable-flyspell-support)
;; Ispell support
@@ -293,6 +310,9 @@ the result as a correction."
#'auto-correct--ispell-handler)
(advice-remove 'ispell-command-loop #'auto-correct--ispell-handler)))
+;; We don't defer ispell support because adding advice will work even if the
+;; feature hasn't been loaded yet.
+
(defcustom auto-correct-enable-ispell-support t
"Whether to automatically correct corrections made in Ispell."
:group 'auto-correct
- [elpa] branch externals/auto-correct created (now 3ab1d23), Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 9147742 01/11: Added auto-correct package, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 80fe805 03/11: auto-correct.el: Changed default predicate to enable auto-correct, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 3e4d699 02/11: auto-correct.el: Cleaned up support activation/deactivation, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct fb9950c 07/11: auto-correct: Fixed handle-support bug and bumped version, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 0d38425 10/11: auto-correct: Add support for flyspell-correct-word-*, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 3ab1d23 11/11: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 0be9302 06/11: auto-correct: Bumped version to 1.1.1, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct f9c542b 08/11: auto-correct: Defer loading of flyspell support until after flyspell has been enabled,
Stefan Monnier <=
- [elpa] externals/auto-correct 27a2323 04/11: auto-correct.el: Reverted last commit, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 84101c5 05/11: auto-correct: Changed default predicate to a function and added examples, Stefan Monnier, 2020/12/01
- [elpa] externals/auto-correct 12955c8 09/11: Updated copyright on auto-correct, captain, and vigenere, Stefan Monnier, 2020/12/01