diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-06-09 17:05:21 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-06-09 17:05:21 +0200 |
commit | 2e5981e003a4a47a0a3c3a11b574c9148c83436d (patch) | |
tree | 48feefba4017aedc37015e0c9631009b63109e36 | |
parent | 3924989b4f45a5c7ff89a4f7abdebc570cbaf7e2 (diff) | |
download | org-mode-2e5981e003a4a47a0a3c3a11b574c9148c83436d.tar.gz |
org-element: Fix structure for list elements containing a drawer
* lisp/org-element.el (org-element--list-struct): Fix return value
when a drawer is found within an item.
-rw-r--r-- | lisp/org-element.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el index be19dd2..5a7e578 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -1333,7 +1333,8 @@ CONTENTS is the contents of the element." (goto-char origin))))) ;; At some text line. Check if it ends any previous item. (t - (let ((ind (progn (skip-chars-forward " \t") (current-column)))) + (let ((ind (save-excursion (skip-chars-forward " \t") + (current-column)))) (when (<= ind top-ind) (skip-chars-backward " \r\t\n") (forward-line)) @@ -1342,10 +1343,10 @@ CONTENTS is the contents of the element." (setcar (nthcdr 6 item) (line-beginning-position)) (push item struct) (unless items - (throw 'exit (sort struct 'car-less-than-car)))))) + (throw 'exit (sort struct #'car-less-than-car)))))) ;; Skip blocks (any type) and drawers contents. (cond - ((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)") + ((and (looking-at "[ \t]*#\\+BEGIN\\(:\\|_\\S-+\\)") (re-search-forward (format "^[ \t]*#\\+END%s[ \t]*$" (match-string 1)) limit t))) |