[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/guess-language 8c8a161 094/101: Treat org lists as one
From: |
Stefan Monnier |
Subject: |
[elpa] externals/guess-language 8c8a161 094/101: Treat org lists as one paragraph. |
Date: |
Sat, 23 Feb 2019 10:34:50 -0500 (EST) |
branch: externals/guess-language
commit 8c8a1616b6a7bc4c10942ee0a1b2591b98fcd493
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>
Treat org lists as one paragraph.
The default in org is that each list item is a paragraph but in many
cases this won’t give us enough material to detect the language reliably.
---
guess-language.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/guess-language.el b/guess-language.el
index ef2a1a9..a0c5a1e 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -153,14 +153,24 @@ Uses ISO 639-1 to identify languages.")
"Uses whatever method for moving to the previous paragraph is
most appropriate given the buffer mode."
(if (eq major-mode 'org-mode)
- (org-backward-paragraph)
+ ;; When in list, go to the beginning of the top-level list:
+ (if (org-in-item-p)
+ (progn
+ (while (org-in-item-p)
+ (org-beginning-of-item-list)
+ (forward-line -1))
+ (forward-line 1))
+ (org-backward-paragraph))
(backward-paragraph)))
(defun guess-language-forward-paragraph ()
"Uses whatever method for moving to the previous paragraph is
most appropriate given the buffer mode."
(if (eq major-mode 'org-mode)
- (org-forward-paragraph)
+ (if (org-in-item-p)
+ (while (org-in-item-p)
+ (org-end-of-item-list))
+ (org-forward-paragraph))
(forward-paragraph)))
(defun guess-language-region (beginning end)
- [elpa] externals/guess-language 8450268 058/101: README: Configuration, (continued)
- [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, 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 <=
- [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, 2019/02/23
- [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