diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-08-25 15:45:05 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-09-01 19:05:55 +0200 |
commit | 0932dac73dee1d296c15b6245101e205a51d8860 (patch) | |
tree | a47681335fcff19b62899acea45f1d4f30d684ec | |
parent | e2dc3cd985bcdb2a315f1978265190ce89736979 (diff) | |
download | org-mode-0932dac73dee1d296c15b6245101e205a51d8860.tar.gz |
Fix `org-list-bottom-point' when point is after end of list.
-rw-r--r-- | lisp/org-list.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index 102cf8f..83ee590 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -873,21 +873,24 @@ A checkbox is blocked if all of the following conditions are fulfilled: (and (let ((outline-regexp org-outline-regexp)) ;; Use default regexp because folding ;; changes OUTLINE-REGEXP. - (outline-next-heading)) - (skip-chars-backward " \r\t\n") - (1+ (point-at-eol))))) + (outline-next-heading))))) (limit (or (save-excursion (and (re-search-forward "^[ \t]*:END:" next-head t) (point-at-bol))) next-head - (point-max)))) - (cond - ((eq org-list-ending-method 'regexp) - (org-list-bottom-point-with-regexp limit)) - ((eq org-list-ending-method 'indent) - (org-list-bottom-point-with-indent limit)) - (t (let ((bottom-re (org-list-bottom-point-with-regexp limit))) - (org-list-bottom-point-with-indent (or bottom-re limit))))))) + (point-max))) + (bottom (cond + ((eq org-list-ending-method 'regexp) + (org-list-bottom-point-with-regexp limit)) + ((eq org-list-ending-method 'indent) + (org-list-bottom-point-with-indent limit)) + (t (let ((bottom-re (org-list-bottom-point-with-regexp limit))) + (org-list-bottom-point-with-indent (or bottom-re limit))))))) + (when bottom + (save-excursion + (goto-char bottom) + (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. |