0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 19:07:52 +00:00

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.
This commit is contained in:
Ihor Radchenko 2022-05-17 13:24:21 +08:00
parent cdbb1c9633
commit 2778972509
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -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