[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language c369ef5 063/101: Type-mode is not a depe
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language c369ef5 063/101: Type-mode is not a dependency anymore. |
Date: |
Sat, 23 Feb 2019 10:34:43 -0500 (EST) |
branch: externals/guess-language
commit c369ef5349933b5ccb81e3aa8199a5d6d882b05e
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
Type-mode is not a dependency anymore.
Still supported, though.
---
README.org | 8 ++++----
guess-language.el | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/README.org b/README.org
index e09a411..fb31821 100644
--- a/README.org
+++ b/README.org
@@ -3,7 +3,7 @@
* guess-language: Emacs minor mode for robust automatic language detection
-Emacs minor mode that detects the language of what you're typing.
Automatically switches spell checker and typo-mode.
+Emacs minor mode that detects the language of what you're typing.
Automatically switches the spell checker and typo-mode (if present).
*Key features:*
- Detection algorithm is robust, efficient, and dead simple. Based on
@@ -14,13 +14,13 @@ Emacs minor mode that detects the language of what you're
typing. Automatically
-----
-I write a lot of text in multiple languages and was getting tired of
constantly having to switch the dictionary of my spell-checker. In true Emacs
spirit, I decided to dust off my grandpa's parentheses and wrote some code to
address this problem. The result is ~guess-language-mode~, a minor mode for
Emacs that guesses the language of the current paragraph and then changes the
dictionary of ispell and the language settings of typo-mode. It also reruns
Flyspell on the current paragraph, [...]
+I write a lot of text in multiple languages and was getting tired of
constantly having to switch the dictionary of my spell-checker. In true Emacs
spirit, I decided to dust off my grandpa's parentheses and wrote some code to
address this problem. The result is ~guess-language-mode~, a minor mode for
Emacs that guesses the language of the current paragraph and then changes the
dictionary of ispell and the language settings of typo-mode (if present). It
also reruns Flyspell on the curre [...]
Currently, the following languages are supported: Arabic, Czech, Danish,
Dutch, English, Finnish, French, German, Italian, Norwegian, Polish,
Portuguese, Russian, Slovak, Slovenian, Spanish, Swedish. It is very easy to
add more languages and this repository includes the necessary language
statistics for 49 additional languages. (These were copied from
[[https://github.com/kent37/guess-language][guess_language.py]].)
** Prerequisites
-This mode assumes that Flyspell is activated and configured for all relevant
languages, i.e., those listed in ~guess-language-languages~. Guess-language
also assumes that [[https://github.com/jorgenschaefer/typoel][typo-mode]] is
installed and set up.
+This mode assumes that Flyspell is activated and configured for all relevant
languages, i.e., those listed in ~guess-language-languages~. If
[[https://github.com/jorgenschaefer/typoel][typo-mode]] is present,
guess-language also changes the language there. Typo-mode is not a dependency,
though.
** Installation
@@ -54,7 +54,7 @@ In this case, use the variable ~guess-language-langcodes~ to
tell guess-language
(de . ("de_CH" "German"))))
#+END_SRC
-The key of each entry in this alist is an ISO 639-1 language code. The first
element of the value is the name of the dictionary that should be used (i.e.,
what you would enter when setting the language via ~M-x
ispell-change-dictionary~). The second element is the name of the language
setting that should be used with typo-mode. If a language is not supported by
typo-mode, enter ~nil~.
+The key of each entry in this alist is an ISO 639-1 language code. The first
element of the value is the name of the dictionary that should be used (i.e.,
what you would enter when setting the language via ~M-x
ispell-change-dictionary~). The second element is the name of the language
setting that should be used with typo-mode (if present). If a language is not
supported by typo-mode, enter ~nil~.
For a list of all dictionaries available for spell-checking, use the following:
diff --git a/guess-language.el b/guess-language.el
index c7c2889..e06bb91 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -23,12 +23,13 @@
;; Guess-language is a buffer-local minor mode. It guesses the
;; language of the current paragraph when flyspell detects an
-;; incorrect word and changes Ispell's dictionary and typo-mode
-;; accordingly. If the language settings change, flyspell is rerun
-;; but only on the current paragraph. Guess-language thus supports
-;; documents using multiple languages. If the paragraph is shorter
-;; than some user-defined value, none of the above happens because
-;; there is likely not enough text to guess the language correctly.
+;; incorrect word and changes Ispell's dictionary and typo-mode (if
+;; present) accordingly. If the language settings change, flyspell is
+;; rerun but only on the current paragraph. Guess-language thus
+;; supports documents using multiple languages. If the paragraph is
+;; shorter than some user-defined value, none of the above happens
+;; because there is likely not enough text to guess the language
+;; correctly.
;;
;; The detection algorithm is based on counts of character
;; trigrams. At this time, supported languages are Arabic, Czech,
@@ -40,7 +41,6 @@
;;; Code:
(require 'cl-lib)
-(require 'typo)
(require 'find-func)
(require 'ispell)
(require 'flyspell)
@@ -165,7 +165,7 @@ If typo doesn't support the language, we leave it alone."
(let* ((lang (guess-language-paragraph))
(codes (cdr (assoc lang guess-language-langcodes))))
(ispell-change-dictionary (car codes))
- (when (cadr codes)
+ (when (and (boundp typo-mode) (cadr codes))
(typo-change-language (cadr codes)))))
(defun guess-language-autoset-and-spellcheck-maybe (beginning end doublon)
- [elpa] externals/guess-language 8813bbf 076/101: README minor, (continued)
- [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, 2019/02/23
- [elpa] externals/guess-language c369ef5 063/101: Type-mode is not a dependency anymore.,
Stefan Monnier <=
- [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
- [elpa] externals/guess-language bad0375 062/101: Always spell check with fast strategy., Stefan Monnier, 2019/02/23