[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language cc11ec6 055/101: README: More details ab
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language cc11ec6 055/101: README: More details about configuration. |
Date: |
Sat, 23 Feb 2019 10:34:42 -0500 (EST) |
branch: externals/guess-language
commit cc11ec643e77e8e0d5604f2c991c2fff3131a334
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
README: More details about configuration.
---
README.org | 59 +++++++++++++++++++++++++++++++++++++------------------
guess-language.el | 44 ++++++++++++++++++++++++-----------------
2 files changed, 66 insertions(+), 37 deletions(-)
diff --git a/README.org b/README.org
index d2441f2..2905e67 100644
--- a/README.org
+++ b/README.org
@@ -36,27 +36,48 @@ Guess-language-mode is available through
[[https://melpa.org/#/guess-language][M
(setq guess-language-min-paragraph-length 35)
#+END_SRC
+~guess-language-languages~ defines the candidate languages that should be
considered. Only include languages that you actually use to improve
performance. Languages are identified using ISO 639-1 codes (see table below).
+
+~guess-language-min-paragraph-length~ specifies the minimal length that a
paragraph needs to have before guess-language-mode starts guessing.
+
+For each language, there is a default Ispell dictionary that
guess-language-mode tries to use. However, for some languages there are
several dictionaries available and guess-language can’t know which one you’d
like to use. For example, there are several different dictionaries for German
and for English. If the dictionary that guess-language-mode uses by default is
not present, you will get an error message like the following:
+
+#+BEGIN_SRC elisp
+Error in post-command-hook (flyspell-post-command-hook): (error "Undefined
dictionary: en")
+#+END_SRC
+
+In this case, use the variable ~guess-language-langcodes~ to tell
guess-language-mode which dictionary should be used instead. For example, use
the following definition if you want to use British English and Swiss German:
+
+#+BEGIN_SRC elisp
+(setq guess-language-langcodes
+ '((en . ("en_GB" "English"))
+ (de . ("de_CH" "German"))))
+#+END_SRC
+
+
+
Available languages at this time:
-| IDO 639-1 code | Language |
-|----------------+------------|
-| ~ar~ | Arabic |
-| ~cs~ | Czech |
-| ~da~ | Danish |
-| ~nl~ | Dutch |
-| ~en~ | English |
-| ~es~ | Spanish |
-| ~fi~ | Finnish |
-| ~fr~ | French |
-| ~de~ | German |
-| ~it~ | Italian |
-| ~nb~ | Norwegian |
-| ~pl~ | Polish |
-| ~pt~ | Portuguese |
-| ~ru~ | Russian |
-| ~sk~ | Slovak |
-| ~sl~ | Slovenian |
-| ~sv~ | Swedish |
+| Language | IDO 639-1 code | Ispell dictionary | Typo-mode setting |
+|------------+----------------+-------------------+-------------------|
+| Arabic | ~ar~ | ar | |
+| Czech | ~cs~ | czech | Czech |
+| Danish | ~da~ | dansk | |
+| Dutch | ~nl~ | de | |
+| English | ~en~ | en | English |
+| Finnish | ~fi~ | finnish | Finnish |
+| French | ~fr~ | francais | French |
+| German | ~de~ | de | German |
+| Italian | ~it~ | italiano | Italian |
+| Norwegian | ~nb~ | norsk | |
+| Polish | ~pl~ | polish | |
+| Portuguese | ~pt~ | portuguese | |
+| Russian | ~ru~ | russian | Russian |
+| Slovak | ~sk~ | slovak | |
+| Slovenian | ~sl~ | slovenian | |
+| Spanish | ~es~ | spanish | |
+| Swedish | ~sv~ | svenska | |
+
** Usage
diff --git a/guess-language.el b/guess-language.el
index b7bab34..347fc7d 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -80,26 +80,34 @@ little material to reliably guess the language."
(defvar guess-language-regexps nil
"The regular expressions that are used to count trigrams.")
-(defvar guess-language-langcodes
- '(
- (ar . ("ar" nil))
- (cs . ("czech" "Czech"))
- (da . ("dansk" nil))
- (de . ("de" "German"))
- (en . ("en" "English"))
- (es . ("spanish" nil))
- (fi . ("finnish" "Finnish"))
- (fr . ("francais" "French"))
- (it . ("italiano" "Italian"))
- (nb . ("norsk" nil))
+(defcustom guess-language-langcodes
+ '((ar . ("ar" nil))
+ (cs . ("czech" "Czech"))
+ (da . ("dansk" nil))
+ (de . ("de" "German"))
+ (en . ("en" "English"))
+ (es . ("spanish" nil))
+ (fi . ("finnish" "Finnish"))
+ (fr . ("francais" "French"))
+ (it . ("italiano" "Italian"))
+ (nb . ("norsk" nil))
(nl . ("nederlands" nil))
- (pl . ("polish" nil))
+ (pl . ("polish" nil))
(pt . ("portuguese" nil))
- (ru . ("russian" "Russian"))
- (sk . ("slovak" nil))
- (sl . ("slovenian" nil))
- (sv . ("svenska" nil)))
- "Language codes for Ispell and typo-mode.")
+ (ru . ("russian" "Russian"))
+ (sk . ("slovak" nil))
+ (sl . ("slovenian" nil))
+ (sv . ("svenska" nil)))
+ "Language codes for Ispell and typo-mode. The key is a symbol
+giving the ISO 639-1 code of the language. The values is a list
+with two elements. The first is the name of the Ispell
+dictionary that should be used (i.e., what you would enter when
+setting the language with `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'."
+ :type '(alist :key-type symbol :value-type list)
+ :group 'guess-language)
(defun guess-language-load-trigrams ()
"Load language statistics."
- [elpa] externals/guess-language e28742b 025/101: Do not mess with flyspell defcustoms., (continued)
- [elpa] externals/guess-language e28742b 025/101: Do not mess with flyspell defcustoms., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 45406db 030/101: README: minor fixes., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language efdf1de 044/101: Better title, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 889b9aa 043/101: Dansk -> Danish, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 0787d81 045/101: Add URL, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 02f90ac 033/101: Updated documentation with new languages., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 7619b58 039/101: Adressing issues identified by flycheck-package., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 88e31bf 054/101: Documentation: Added Arabic., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 3b61ce0 052/101: Added test data for all supported languages., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 2982b26 056/101: README improved, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language cc11ec6 055/101: README: More details about configuration.,
Stefan Monnier <=
- [elpa] externals/guess-language 5ab21de 072/101: Fix bug that prevented Flyspell from highlighting incorrect words., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 85cfda4 065/101: Detect basedir in a way that’s compatible with old Emacs., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language ac991ce 073/101: Merge pull request #14 from tmalsburg/hooks, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 28eb75d 089/101: Fix typo in README, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 7c9c139 077/101: README fix markup, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 2082e4e 078/101: README fix markup, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 52e7623 092/101: Merge branch 'master' of https://github.com/tmalsburg/guess-language.el, Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 93dcc15 071/101: Display ISO 639-1 code in mode line., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language c2c0206 082/101: Make variable buffer local by default., Stefan Monnier, 2019/02/23
- [elpa] externals/guess-language 8264b3b 067/101: Add missing defgroup., Stefan Monnier, 2019/02/23