org-list: Clarify code
* lisp/org-list.el (org-list-item-body-column): Clarify code.
This commit is contained in:
parent
51efd7f1db
commit
1d7f1349c9
|
@ -2097,13 +2097,19 @@ Possible values are: `folded', `children' or `subtree'. See
|
||||||
"Return column at which body of ITEM should start."
|
"Return column at which body of ITEM should start."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char item)
|
(goto-char item)
|
||||||
(looking-at "[ \t]*\\(\\S-+\\)\\(.*[ \t]::\\)?\\([ \t]\\|$\\)")
|
(if (save-excursion
|
||||||
(if (match-beginning 2)
|
(end-of-line)
|
||||||
(let ((start (1+ (match-end 2)))
|
(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)))
|
(ind (org-get-indentation)))
|
||||||
(if (> start (+ ind org-list-description-max-indent))
|
(if (> start (+ ind org-list-description-max-indent))
|
||||||
(+ ind 5)
|
(+ ind 5)
|
||||||
start))
|
start))
|
||||||
|
;; Regular item. Body starts after bullet.
|
||||||
|
(looking-at "[ \t]*\\(\\S-+\\)")
|
||||||
(+ (progn (goto-char (match-end 1)) (current-column))
|
(+ (progn (goto-char (match-end 1)) (current-column))
|
||||||
(if (and org-list-two-spaces-after-bullet-regexp
|
(if (and org-list-two-spaces-after-bullet-regexp
|
||||||
(string-match-p org-list-two-spaces-after-bullet-regexp
|
(string-match-p org-list-two-spaces-after-bullet-regexp
|
||||||
|
|
Loading…
Reference in New Issue