From 8aa0a33e36be4593ad605d9a3c283942a275e580 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 26 Oct 2010 23:34:49 +0200 Subject: [PATCH] indentation: lines outside of drawers ignore indentation of drawers * org.el (org-indent-line-function): Ignore drawers above the current line when indenting --- lisp/org.el | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index c4c64ee..edc0b74 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18704,7 +18704,7 @@ which make use of the date at the cursor." (beginning-of-line 0) (while (and (not (bobp)) ;; skip comments, verbatim, empty lines, tables, - ;; inline tasks + ;; inline tasks, and lists (or (looking-at "[ \t]*[\n:#|]") (and (org-in-item-p) (goto-char (org-list-top-point))) (and (not inline-task-p) @@ -18714,8 +18714,11 @@ which make use of the date at the cursor." (not (looking-at org-drawer-regexp))) (beginning-of-line 0)) (cond - ;; There was an heading above. - ((looking-at "\\*+[ \t]+") + ;; There was an heading or the end of a drawer above. + ((or (looking-at "\\*+[ \t]+") + (and (looking-at "[ \t]*:END:") + (ignore-errors (org-back-to-heading 'invisible-ok)) + (looking-at "\\*+[ \t]+"))) (if (not org-adapt-indentation) (setq column 0) (goto-char (match-end 0)) @@ -18724,10 +18727,6 @@ which make use of the date at the cursor." ((looking-at org-drawer-regexp) (goto-char (1- (match-beginning 1))) (setq column (current-column))) - ;; The drawer had ended: indent like its :END: line. - ((looking-at "\\([ \t]*\\):END:") - (goto-char (match-end 1)) - (setq column (current-column))) ;; Else, nothing noticeable found: get indentation and go on. (t (setq column (org-get-indentation)))))) (goto-char pos) -- 1.7.3.2