emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/guess-language 65dccb1 096/101: Added workaround for bu


From: Stefan Monnier
Subject: [elpa] externals/guess-language 65dccb1 096/101: Added workaround for bug in org mode.
Date: Sat, 23 Feb 2019 10:34:50 -0500 (EST)

branch: externals/guess-language
commit 65dccb18df4d0c766d516c5f1423994bae445b51
Author: Titus von der Malsburg <address@hidden>
Commit: Titus von der Malsburg <address@hidden>

    Added workaround for bug in org mode.
    
    (org-in-list-p) gives non-nil outside of list, i.e. after the point
    returned by (org-end-of-item-list).
---
 guess-language.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/guess-language.el b/guess-language.el
index a4d15a0..cc8f877 100644
--- a/guess-language.el
+++ b/guess-language.el
@@ -169,11 +169,15 @@ most appropriate given the buffer mode."
   "Uses whatever method for moving to the previous paragraph is
 most appropriate given the buffer mode."
   (if (eq major-mode 'org-mode)
-      (if (org-in-item-p)
-          (while (org-in-item-p)
-            (org-end-of-item-list))
-        (org-forward-paragraph))
-    (forward-paragraph)))
+      (if (org-list-struct)
+          (let ((last-pos nil)
+                (new-pos (car (last (first (last (org-list-struct)))))))
+            (while (not (eq last-pos new-pos))
+              (setq last-pos new-pos)
+              (setq new-pos (car (last (first (last (org-list-struct)))))))
+            (goto-char new-pos))
+            (org-forward-paragraph))
+        (forward-paragraph)))
 
 (defun guess-language-region (beginning end)
   "Guess language in the specified region.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]