[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language 1107b93 101/101: Fixes #21
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language 1107b93 101/101: Fixes #21 |
Date: |
Sat, 23 Feb 2019 10:34:51 -0500 (EST) |
branch: externals/guess-language
commit 1107b93621e758bee07b2b24139e9e4557dc1d6e
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
Fixes #21
---
guess-language.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/guess-language.el b/guess-language.el
index 01f841d..f712d99 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -257,6 +257,12 @@ which LANG was detected."
(when typo-lang
(typo-change-language typo-lang)))))
+(defun guess-language-flyspell-buffer-wrapper (orig-fun &rest args)
+ "Do not guess language when an unknown word is encountered
+during `flyspell-buffer'."
+ (let ((flyspell-incorrect-hook nil))
+ (apply orig-fun args)))
+
;;;###autoload
(define-minor-mode guess-language-mode
"Toggle guess-language mode.
@@ -281,8 +287,11 @@ correctly."
:global nil
:group 'guess-language
(if guess-language-mode
- (add-hook 'flyspell-incorrect-hook #'guess-language-function nil t)
- (remove-hook 'flyspell-incorrect-hook #'guess-language-function t)))
+ (progn
+ (add-hook 'flyspell-incorrect-hook #'guess-language-function nil t)
+ (advice-add 'flyspell-buffer :around
#'guess-language-flyspell-buffer-wrapper))
+ (remove-hook 'flyspell-incorrect-hook #'guess-language-function t)
+ (advice-remove 'flyspell-buffer #'guess-language-flyspell-buffer-wrapper)))
(defun guess-language-mark-lines (&optional highlight)
"Guess language on all lines in the buffer and mark them.
- [elpa] externals/guess-language f54ca4f 086/101: Added test data from LIGA., (continued)
- [elpa] externals/guess-language f54ca4f 086/101: Added test data from LIGA., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language bad0375 062/101: Always spell check with fast strategy., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 044f6d1 074/101: README: Updated documentation regarding new hook, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language d6c2fac 081/101: README re typo, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 7e8c9e2 084/101: Function: guess language of current line., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 11f74d0 088/101: Moved test_data.org to subdir., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 89537dc 090/101: Merge pull request #16 from peterwvj/master, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language f6a7861 061/101: Merge pull request #6 from joostkremers/master, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 0c4e9ab 069/101: Minor fixes in test data., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language b8ab800 070/101: Use hooks for greater configurability., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1107b93 101/101: Fixes #21,
Stefan Monnier <=
- [elpa] externals/guess-language 65dccb1 096/101: Added workaround for bug in org mode., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1f1602f 098/101: Merge pull request #18 from humitos/master, Stefan Monnier, 2019/02/23