Hello,

>>>>> Anthony Lander writes:

> With regards to the discussion below, if I set
> org-list-ending-method to 'regex

The correct value is 'regexp.

> it seems to get confused if there is a drawer between the headline
> and the first line of text, so pressing TAB with the cursor at the
> vertical bar in this example:

----> 8-------
> ** Headline 
> :PROPERTIES:
> :FOO:  Bar
> :END:
> |
----> 8-------

> Does not indent to the position under the "H" in the headline. The
> TAB key silently does nothing. Same effect with the properties
> drawer folded. Is it possible to indent correctly, ignoring the
> drawer?

Actually, this has nothing to do with the value of
org-list-ending-method, but I think you are right, indentation should
ignore drawers.

Here is a patch to do so. Does it work for you ?

Regards,

-- Nicolas

>From 8aa0a33e36be4593ad605d9a3c283942a275e580 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaz...@gmail.com>
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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to