summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-17 22:36:44 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2013-02-17 23:01:52 (GMT)
commitae5932282d44742d932d40136edf441bc18609a9 (patch)
treea78c8b0dd08c7475ceccee0f926383e6dd9a6102
parent45442fbfb765239cbf79baf88e418c4746cbddd4 (diff)
downloadorg-mode-ae5932282d44742d932d40136edf441bc18609a9.zip
org-mode-ae5932282d44742d932d40136edf441bc18609a9.tar.gz
org-element: Headlines properties from property drawer are upcased
* lisp/org-element.el (org-element-headline-parser, org-element-inlinetask-parser): Upcase properties. This is done to avoid confusion between properties from parser (e.g. `:end') and properties from the property drawer (e.g. :END:). In particular, it means that :CUSTOM_ID: property is accessed through: (org-element-property :CUSTOM_ID headline)
-rw-r--r--lisp/org-element.el18
1 files changed, 8 insertions, 10 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 04b5df8..d00004d 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -763,17 +763,16 @@ Assume point is at beginning of the headline."
(archivedp (member org-archive-tag tags))
(footnote-section-p (and org-footnote-section
(string= org-footnote-section raw-value)))
- ;; Normalize property names: ":SOME_PROP:" becomes
- ;; ":some-prop".
+ ;; Upcase property names. It avoids confusion between
+ ;; properties obtained through property drawer and default
+ ;; properties from the parser (e.g. `:end' and :END:)
(standard-props
(let (plist)
(mapc
(lambda (p)
(setq plist
(plist-put plist
- (intern (concat ":"
- (replace-regexp-in-string
- "_" "-" (downcase (car p)))))
+ (intern (concat ":" (upcase (car p))))
(cdr p))))
(org-entry-properties nil 'standard))
plist))
@@ -930,17 +929,16 @@ Assume point is at beginning of the inline task."
(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".
+ ;; Upcase property names. It avoids confusion between
+ ;; properties obtained through property drawer and default
+ ;; properties from the parser (e.g. `:end' and :END:)
(standard-props
(let (plist)
(mapc
(lambda (p)
(setq plist
(plist-put plist
- (intern (concat ":"
- (replace-regexp-in-string
- "_" "-" (downcase (car p)))))
+ (intern (concat ":" (upcase (car p))))
(cdr p))))
(org-entry-properties nil 'standard))
plist))