From c12ce921d7127ac86db6406acaa61400bbaf0e4c Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 29 Dec 2010 01:42:34 +0100 Subject: [PATCH] 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. --- lisp/org.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4d9a367ea..39eb60e8f 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)