diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-09-09 14:13:24 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-09-09 14:13:24 +0200 |
commit | f29131c3d2581a3089a5862dd84eb6cb435d2e45 (patch) | |
tree | 11cb2634bda7b4b33c3281cd53bb2db76baf17e0 | |
parent | 9d334897e3c6be7bc567b1ad489e7b815e8a87f6 (diff) | |
download | org-mode-f29131c3d2581a3089a5862dd84eb6cb435d2e45.tar.gz |
org-element: Handle nil titles in headlines
* lisp/org-element.el (org-element-headline-parser): Handle nil
titles.
(org-element-inlinetask-parser): Add :raw-value property. Also handle
nil titles.
-rw-r--r-- | lisp/org-element.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el index ebaf3f6..456ed15 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -701,7 +701,7 @@ Assume point is at beginning of the headline." (and todo (if (member todo org-done-keywords) 'done 'todo))) (tags (let ((raw-tags (nth 5 components))) (and raw-tags (org-split-string raw-tags ":")))) - (raw-value (nth 4 components)) + (raw-value (or (nth 4 components) "")) (quotedp (let ((case-fold-search nil)) (string-match (format "^%s +" org-quote-string) raw-value))) @@ -844,8 +844,9 @@ CONTENTS is the contents of the element." Return a list whose CAR is `inlinetask' and CDR is a plist containing `:title', `:begin', `:end', `:hiddenp', `:contents-begin' and `:contents-end', `:level', `:priority', -`:tags', `:todo-keyword', `:todo-type', `:scheduled', -`:deadline', `:timestamp', `:clock' and `:post-blank' keywords. +`:raw-value', `:tags', `:todo-keyword', `:todo-type', +`:scheduled', `:deadline', `:timestamp', `:clock' and +`:post-blank' keywords. The plist also contains any property set in the property drawer, with its name in lowercase, the underscores replaced with hyphens @@ -865,6 +866,7 @@ Assume point is at beginning of the inline task." (if (member todo org-done-keywords) 'done 'todo))) (tags (let ((raw-tags (nth 5 components))) (and raw-tags (org-split-string raw-tags ":")))) + (raw-value (or (nth 4 components) "")) ;; Normalize property names: ":SOME_PROP:" becomes ;; ":some-prop". (standard-props (let (plist) @@ -901,7 +903,8 @@ Assume point is at beginning of the inline task." (inlinetask (list 'inlinetask (nconc - (list :begin begin + (list :raw-value raw-value + :begin begin :end end :hiddenp hidden :contents-begin contents-begin @@ -920,9 +923,9 @@ Assume point is at beginning of the inline task." (cadr keywords))))) (org-element-put-property inlinetask :title - (if raw-secondary-p (nth 4 components) + (if raw-secondary-p raw-value (org-element-parse-secondary-string - (nth 4 components) + raw-value (org-element-restriction 'inlinetask) inlinetask)))))) |