mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-22 15:48:31 +00:00
Fix infinite loop when buffer was ending on a blank lines with whitespaces.
This commit is contained in:
parent
421ba3a187
commit
d05c77d6a5
|
@ -525,21 +525,22 @@ List ending is determined by the indentation of text. See
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(and beg-item
|
(and beg-item
|
||||||
(catch 'exit
|
(catch 'exit
|
||||||
|
(skip-chars-forward " \t")
|
||||||
(while t
|
(while t
|
||||||
(let ((ind (org-get-indentation)))
|
(let ((ind (org-get-indentation)))
|
||||||
(cond
|
(cond
|
||||||
((or (>= (point) limit)
|
((or (>= (point) limit)
|
||||||
(looking-at "^[ \t]*:END:"))
|
(looking-at ":END:"))
|
||||||
(throw 'exit (point)))
|
(throw 'exit (point)))
|
||||||
((looking-at "^[ \t]*$")
|
((= (point) (point-at-eol))
|
||||||
(skip-chars-forward " \r\t\n")
|
(skip-chars-forward " \r\t\n")
|
||||||
(beginning-of-line))
|
(beginning-of-line))
|
||||||
((looking-at org-item-beginning-re)
|
((org-at-item-p)
|
||||||
(setq ind-ref (min ind ind-ref))
|
(setq ind-ref (min ind ind-ref))
|
||||||
(forward-line 1))
|
(forward-line 1))
|
||||||
((<= ind ind-ref)
|
((<= ind ind-ref)
|
||||||
(throw 'exit (point-at-bol)))
|
(throw 'exit (point-at-bol)))
|
||||||
((looking-at "^[ \t]*#\\+begin_")
|
((looking-at "#\\+begin_")
|
||||||
(re-search-forward "[ \t]*#\\+end_")
|
(re-search-forward "[ \t]*#\\+end_")
|
||||||
(forward-line 1))
|
(forward-line 1))
|
||||||
(t (forward-line 1))))))))))
|
(t (forward-line 1))))))))))
|
||||||
|
@ -889,8 +890,10 @@ A checkbox is blocked if all of the following conditions are fulfilled:
|
||||||
(when bottom
|
(when bottom
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char bottom)
|
(goto-char bottom)
|
||||||
(skip-chars-backward " \r\t\n")
|
(if (eobp)
|
||||||
(1+ (point-at-eol))))))
|
(point)
|
||||||
|
(skip-chars-backward " \r\t\n")
|
||||||
|
(1+ (point-at-eol)))))))
|
||||||
|
|
||||||
(defun org-beginning-of-item ()
|
(defun org-beginning-of-item ()
|
||||||
"Go to the beginning of the current hand-formatted item.
|
"Go to the beginning of the current hand-formatted item.
|
||||||
|
|
Loading…
Reference in a new issue