[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language e64d88f 09/10: Merge pull request #25 fr
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language e64d88f 09/10: Merge pull request #25 from wentasah/fixes |
Date: |
Wed, 17 Apr 2019 08:12:41 -0400 (EDT) |
branch: externals/guess-language
commit e64d88f287a547198e4c96e2fff543e103f2b456
Merge: 09e1a41 9a49c94
Author: Titus von der Malsburg <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #25 from wentasah/fixes
Fix incorrect highlighting of otherwise correct words when switching
dictionary
---
guess-language.el | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/guess-language.el b/guess-language.el
index ae68069..3f79e62 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -159,7 +159,9 @@ most appropriate given the buffer mode."
(if (org-in-item-p)
(org-beginning-of-item-list)
(org-backward-paragraph))
- (backward-paragraph)))
+ (backward-paragraph)
+ (when (looking-at-p "[[:space:]]")
+ (forward-whitespace 1))))
(defun guess-language-forward-paragraph ()
"Uses whatever method for moving to the next paragraph is
@@ -238,11 +240,17 @@ which LANG was detected."
(new-dictionary (cadr (assq lang guess-language-langcodes))))
(unless (string= old-dictionary new-dictionary)
(ispell-change-dictionary new-dictionary)
- (let ((flyspell-issue-welcome-flag nil)
- (flyspell-issue-message-flag nil)
- (flyspell-incorrect-hook nil)
- (flyspell-large-region 1))
- (flyspell-region beginning end)))))
+ ;; Flyspell the region with the new dictionary after we return
+ ;; from flyspell-incorrect-hook that called us. Otherwise, the
+ ;; word at point is highlighted as incorrect even if it is
+ ;; correct according to the new dictionary.
+ (run-at-time 0 nil
+ (lambda ()
+ (let ((flyspell-issue-welcome-flag nil)
+ (flyspell-issue-message-flag nil)
+ (flyspell-incorrect-hook nil)
+ (flyspell-large-region 1))
+ (flyspell-region beginning end)))))))
(defun guess-language-switch-typo-mode-function (lang _beginning _end)
"Switch the language used by typo-mode.
- [elpa] externals/guess-language updated (7b84003 -> 2852aa6), Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 5ec9b58 02/10: Fix typo., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 49b1237 03/10: Add Type for defcustom., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 5edde0d 04/10: Added README with information about language data., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language d2a1330 01/10: A bunch of small improvements suggested by Stefan Monnier., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 2852aa6 10/10: Merge remote-tracking branch 'guess-language/master' into externals/guess-language, Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 3b7acbb 05/10: Remove advice dependency., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language e64d88f 09/10: Merge pull request #25 from wentasah/fixes,
Stefan Monnier <=
- [elpa] externals/guess-language 9a49c94 08/10: Make the word under point correctly highlighted after change of dictionary, Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language 09e1a41 06/10: Fix #23., Stefan Monnier, 2019/04/17
- [elpa] externals/guess-language ec7c0f6 07/10: Make guess-language-backward-paragraph always go to word boundary, Stefan Monnier, 2019/04/17