[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language 044f6d1 074/101: README: Updated documen
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language 044f6d1 074/101: README: Updated documentation regarding new hook |
Date: |
Sat, 23 Feb 2019 10:34:45 -0500 (EST) |
branch: externals/guess-language
commit 044f6d12a50b10ae13783f543700e2dcff0ccc8e
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
README: Updated documentation regarding new hook
---
README.org | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/README.org b/README.org
index 80150cb..fbc0ecd 100644
--- a/README.org
+++ b/README.org
@@ -28,6 +28,8 @@ Guess-language-mode is available through
[[https://melpa.org/#/guess-language][M
** Configuration
+*** Language settings
+
#+BEGIN_SRC elisp
(require 'guess-language)
@@ -84,6 +86,31 @@ 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:
+
+1. `LANG` the language that was detected
+2. `BEGINNING` the beginning of the region in which the new language was
detected
+3. `END` the end of the region
+
+Template:
+
+#+BEGIN_SRC elisp
+(defun my-custom-function (lang beginning end)
+ (do-something))
+
+(add-hook 'guess-language-after-detection-functions #'my-custom-function)
+#+END_SRC
** Usage
- [elpa] externals/guess-language f610859 057/101: Find data files more robustly., (continued)
- [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
- [elpa] externals/guess-language 044f6d1 074/101: README: Updated documentation regarding new hook,
Stefan Monnier <=
- [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, 2019/02/23
- [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