branch: externals/guess-language commit 2bc0e1f9c8947b9b5ac8d792bd7f6d2c36d294ab Author: Titus von der Malsburg <malsb...@posteo.de> Commit: Titus von der Malsburg <malsb...@posteo.de>
Fix endless loop in org lists at beginning of buffer. --- guess-language.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guess-language.el b/guess-language.el index a0c5a1e..a4d15a0 100644 --- a/guess-language.el +++ b/guess-language.el @@ -156,10 +156,12 @@ most appropriate given the buffer mode." ;; When in list, go to the beginning of the top-level list: (if (org-in-item-p) (progn - (while (org-in-item-p) + (while (and (save-excursion (= (forward-line -1) 0)) + (org-in-item-p)) (org-beginning-of-item-list) (forward-line -1)) - (forward-line 1)) + (unless (org-in-item-p) + (forward-line 1))) (org-backward-paragraph)) (backward-paragraph)))