summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2010-08-27 16:12:44 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2010-09-01 19:05:56 +0200
commitd05c77d6a5150207b061bea82b39b85de2b020b6 (patch)
tree1a3aaba2c31e88a85cce7dd19739fcc62bfb632d
parent421ba3a1872b0e5952a4a68e2220dc3e07ab6dd2 (diff)
downloadorg-mode-d05c77d6a5150207b061bea82b39b85de2b020b6.tar.gz
Fix infinite loop when buffer was ending on a blank lines with whitespaces.
-rw-r--r--lisp/org-list.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 99dc419..8a927db 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -525,21 +525,22 @@ List ending is determined by the indentation of text. See
(beginning-of-line)
(and beg-item
(catch 'exit
+ (skip-chars-forward " \t")
(while t
(let ((ind (org-get-indentation)))
(cond
((or (>= (point) limit)
- (looking-at "^[ \t]*:END:"))
+ (looking-at ":END:"))
(throw 'exit (point)))
- ((looking-at "^[ \t]*$")
+ ((= (point) (point-at-eol))
(skip-chars-forward " \r\t\n")
(beginning-of-line))
- ((looking-at org-item-beginning-re)
+ ((org-at-item-p)
(setq ind-ref (min ind ind-ref))
(forward-line 1))
((<= ind ind-ref)
(throw 'exit (point-at-bol)))
- ((looking-at "^[ \t]*#\\+begin_")
+ ((looking-at "#\\+begin_")
(re-search-forward "[ \t]*#\\+end_")
(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
(save-excursion
(goto-char bottom)
- (skip-chars-backward " \r\t\n")
- (1+ (point-at-eol))))))
+ (if (eobp)
+ (point)
+ (skip-chars-backward " \r\t\n")
+ (1+ (point-at-eol)))))))
(defun org-beginning-of-item ()
"Go to the beginning of the current hand-formatted item.