summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2010-12-29 01:42:34 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2011-02-18 12:45:08 +0100
commitc12ce921d7127ac86db6406acaa61400bbaf0e4c (patch)
tree754ed3a78142518e14519b57b3537fc804355ec4
parente2233577435e403b99e8fa8d472da7a7a680ff07 (diff)
downloadorg-mode-c12ce921d7127ac86db6406acaa61400bbaf0e4c.tar.gz
Checkboxes do not change indentation in lists
* org.el (org-indent-line-function): Indentation of item's body starts just after the bullet, not after a checkbox. Moreover, As `org-in-item-p' also returns item beginning position when point is in a list, do not compute it a second time.
-rw-r--r--lisp/org.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 4d9a367..39eb60e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18817,9 +18817,9 @@ If point is in an inline task, mark that task instead."
(org-get-indentation)
(org-get-indentation (match-string 0)))))
;; Lists
- ((org-in-item-p)
- (org-beginning-of-item)
- (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\(:?\\[@\\(:?start:\\)?[0-9]+\\][ \t]*\\)?\\[[- X]\\][ \t]*\\|.*? :: \\)?")
+ ((let ((in-item-p (org-in-item-p)))
+ (and in-item-p (goto-char in-item-p)))
+ (or (org-at-item-description-p) (org-at-item-p))
(setq bpos (match-beginning 1) tpos (match-end 0)
bcol (progn (goto-char bpos) (current-column))
tcol (progn (goto-char tpos) (current-column)))
@@ -18840,7 +18840,11 @@ If point is in an inline task, mark that task instead."
(and (looking-at "[ \t]*#\\+end_")
(re-search-backward "[ \t]*#\\+begin_"nil t))
(looking-at "[ \t]*[\n:#|]")
- (and (org-in-item-p) (goto-char (org-list-top-point)))
+ (let ((itemp (org-in-item-p)))
+ (and itemp
+ (goto-char itemp)
+ (goto-char
+ (org-list-get-top-point (org-list-struct)))))
(and (not inline-task-p)
(featurep 'org-inlinetask)
(org-inlinetask-in-task-p)