[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language d9933d3 075/101: Keep switching typo-mod
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language d9933d3 075/101: Keep switching typo-mode. |
Date: |
Sat, 23 Feb 2019 10:34:46 -0500 (EST) |
branch: externals/guess-language
commit d9933d3d51eeb86047cced4ffaf1387db7591682
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
Keep switching typo-mode.
For the sake of backward compatibility.
---
README.org | 9 ---------
guess-language.el | 10 ++++++----
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/README.org b/README.org
index fbc0ecd..9de769c 100644
--- a/README.org
+++ b/README.org
@@ -86,15 +86,6 @@ Languages that are currently supported by
guess-language-mode:
| Spanish | ~es~ | spanish |
|
| Swedish | ~sv~ | svenska |
|
-*** Typo mode
-
-By default guess-language only switches the Ispell dictionary used by Flyspell
(`ispell-change-dictionary`). However, guess-language can also switch the
language settings used by type-mode. To activate this add the following to
your configuration:
-
-#+BEGIN_SRC elisp
-(add-hook 'guess-language-after-detection-functions
'guess-language-switch-typo-mode-function)
-#+END_SRC
-
-
*** Custom functions
While changing the spell-checker’s dictionary is the main purpose of
guess-language, there are other things that a user might want to do when a new
language is detected, for instance, a user might want to change the input
method. Things like that can be easily achieved by adding custom functions to
the hook `guess-language-after-detection-functions`. Functions on this hook
take three arguments:
diff --git a/guess-language.el b/guess-language.el
index 3c3f6c2..f7c23e6 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -105,7 +105,8 @@ value is nil."
:type '(alist :key-type symbol :value-type list)
:group 'guess-language)
-(defcustom guess-language-after-detection-functions (list
#'guess-language-switch-flyspell-function)
+(defcustom guess-language-after-detection-functions (list
#'guess-language-switch-flyspell-function
+
#'guess-language-switch-typo-mode-function)
"Hook run when a new language is detected.
This hook is abnormal in that its functions take arguments,
@@ -215,9 +216,10 @@ which LANG was detected."
LANG is the ISO 639-1 code of the language (as a
symbol). BEGINNING and END are the endpoints of the region in
which LANG was detected."
- (let* ((typo-lang (cl-caddr (assq lang guess-language-langcodes))))
- (when typo-lang
- (typo-change-language typo-lang))))
+ (when (boundp 'typo-mode)
+ (let* ((typo-lang (cl-caddr (assq lang guess-language-langcodes))))
+ (when typo-lang
+ (typo-change-language typo-lang)))))
;;;###autoload
(define-minor-mode guess-language-mode
- [elpa] externals/guess-language 9763f9e 066/101: Fix #12: boundp wants a symbol, (continued)
- [elpa] externals/guess-language 9763f9e 066/101: Fix #12: boundp wants a symbol, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 8813bbf 076/101: README minor, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 2bc0e1f 095/101: Fix endless loop in org lists at beginning of buffer., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language d1a43df 087/101: README: some details about minimal paragraph length, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1516fbe 091/101: README: how to switch voice in festival, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1afd382 097/101: defcustom to set the trigrams path, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 03e69d0 100/101: Removed some cruft., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language bc6fe11 099/101: Fix bug in `guess-language-forward- paragraph`., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 8450268 058/101: README: Configuration, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language b84e19d 064/101: README fix typo, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language d9933d3 075/101: Keep switching typo-mode.,
Stefan Monnier <=
- [elpa] externals/guess-language c369ef5 063/101: Type-mode is not a dependency anymore., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language f610859 057/101: Find data files more robustly., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 881e261 068/101: Improve docstrings., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 4177b92 080/101: Typo-mode is not anymore a dependency., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language c0a9cd3 079/101: Mention custom functions in commentary., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1f0d9d9 083/101: Fix docstring., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 1ab9637 085/101: Added guess-language-mark-lines for debugging., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 8c8a161 094/101: Treat org lists as one paragraph., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 2fd5023 093/101: In org buffers use org-backward/forward-paragraph., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language f54ca4f 086/101: Added test data from LIGA., Stefan Monnier, 2019/02/23