summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-12-19 12:06:30 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-12-19 12:06:30 +0100
commit1d7f1349c9d753a5afd8fe1decf7e87a247cc55c (patch)
treedcdbad817f20722f83952063c3b3f0a1c1eb68ea
parent51efd7f1db1ca651a267920bd92fbeec4c12eb75 (diff)
downloadorg-mode-1d7f1349c9d753a5afd8fe1decf7e87a247cc55c.tar.gz
org-list: Clarify code
* lisp/org-list.el (org-list-item-body-column): Clarify code.
-rw-r--r--lisp/org-list.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 78a8aea..1eb1b50 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2097,13 +2097,19 @@ Possible values are: `folded', `children' or `subtree'. See
"Return column at which body of ITEM should start."
(save-excursion
(goto-char item)
- (looking-at "[ \t]*\\(\\S-+\\)\\(.*[ \t]::\\)?\\([ \t]\\|$\\)")
- (if (match-beginning 2)
- (let ((start (1+ (match-end 2)))
+ (if (save-excursion
+ (end-of-line)
+ (re-search-backward
+ "[ \t]::\\([ \t]\\|$\\)" (line-beginning-position) t))
+ ;; Descriptive list item. Body starts after item's tag, if
+ ;; possible.
+ (let ((start (1+ (- (match-beginning 1) (line-beginning-position))))
(ind (org-get-indentation)))
(if (> start (+ ind org-list-description-max-indent))
(+ ind 5)
start))
+ ;; Regular item. Body starts after bullet.
+ (looking-at "[ \t]*\\(\\S-+\\)")
(+ (progn (goto-char (match-end 1)) (current-column))
(if (and org-list-two-spaces-after-bullet-regexp
(string-match-p org-list-two-spaces-after-bullet-regexp