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

org--backward-paragraph-once: Fix infinite loop at first element in section

* lisp/org.el (org--backward-paragraph-once): Do not consider section
parent as greater element.  section elements starts at the same point
with its first child and we do not want to "move" from beginning of
child to the beginning of the section.

Fixes https://list.orgmode.org/87cznsnql6.fsf@localhost/T/#t
This commit is contained in:
Ihor Radchenko 2021-10-27 23:09:02 +08:00
parent 5ca866d08a
commit cc3df3af2a
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -21399,7 +21399,9 @@ See `org-backward-paragraph'."
(forward-line -1))
;; At the beginning of the first element within a greater
;; element. Move to the beginning of the greater element.
((and parent (= begin (org-element-property :contents-begin parent)))
((and parent
(not (eq 'section (org-element-type parent)))
(= begin (org-element-property :contents-begin parent)))
(funcall reach (org-element-property :begin parent)))
;; Since we have to move anyway, find the beginning
;; position of the element above.