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

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

[elpa] externals/org 2778972509: org-fold--reveal-outline-maybe: Prevent


From: ELPA Syncer
Subject: [elpa] externals/org 2778972509: org-fold--reveal-outline-maybe: Prevent wrong-side-of-point error
Date: Tue, 17 May 2022 01:57:50 -0400 (EDT)

branch: externals/org
commit 27789725093f483c2d123b4e90776ea1f67f3b61
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-fold--reveal-outline-maybe: Prevent wrong-side-of-point error
    
    * lisp/org-fold.el (org-fold--reveal-outline-maybe): Fix scenario when
    point is moved beyond REGION.
---
 lisp/org-fold.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index 43ebe7acca..c5542b92eb 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -958,8 +958,9 @@ This function is intended to be used as :fragile property of
      ;; Never hide level 1 headlines
      (save-excursion
        (goto-char (line-end-position))
-       (when (re-search-forward (rx bol "* ") (cdr region) t)
-         (org-fold-region (match-beginning 0) (line-end-position) nil 
'headline)))
+       (unless (>= (point) (cdr region))
+         (when (re-search-forward (rx bol "* ") (cdr region) t)
+           (org-fold-region (match-beginning 0) (line-end-position) nil 
'headline))))
      ;; Check the validity of headline
      (unless (let ((case-fold-search t))
               (looking-at (rx-to-string



reply via email to

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