Fix bug when retrieving time properties with modified keywords
* lisp/org.el (org-entry-properties): Make sure that standard property names are used even if the user has customized time keywords.
This commit is contained in:
parent
a77dce0eac
commit
1b2a21fdf7
34
lisp/org.el
34
lisp/org.el
|
@ -13278,7 +13278,7 @@ things up because then unnecessary parsing is avoided."
|
||||||
(let ((clockstr (substring org-clock-string 0 -1))
|
(let ((clockstr (substring org-clock-string 0 -1))
|
||||||
(excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
|
(excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
|
||||||
(case-fold-search nil)
|
(case-fold-search nil)
|
||||||
beg end range props sum-props key value string clocksum)
|
beg end range props sum-props key key1 value string clocksum)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(when (condition-case nil
|
(when (condition-case nil
|
||||||
(and (org-mode-p) (org-back-to-heading t))
|
(and (org-mode-p) (org-back-to-heading t))
|
||||||
|
@ -13309,23 +13309,35 @@ things up because then unnecessary parsing is avoided."
|
||||||
(when (or (not specific) (string= specific "BLOCKED"))
|
(when (or (not specific) (string= specific "BLOCKED"))
|
||||||
(push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
|
(push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
|
||||||
(when (or (not specific)
|
(when (or (not specific)
|
||||||
(member specific org-all-time-keywords)
|
(member specific
|
||||||
(member specific '("TIMESTAMP" "TIMESTAMP_IA")))
|
'("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED"
|
||||||
|
"TIMESTAMP" "TIMESTAMP_IA")))
|
||||||
(while (re-search-forward org-maybe-keyword-time-regexp end t)
|
(while (re-search-forward org-maybe-keyword-time-regexp end t)
|
||||||
(setq key (if (match-end 1) (substring (org-match-string-no-properties 1) 0 -1))
|
(setq key (if (match-end 1)
|
||||||
|
(substring (org-match-string-no-properties 1)
|
||||||
|
0 -1))
|
||||||
string (if (equal key clockstr)
|
string (if (equal key clockstr)
|
||||||
(org-no-properties
|
(org-no-properties
|
||||||
(org-trim
|
(org-trim
|
||||||
(buffer-substring
|
(buffer-substring
|
||||||
(match-beginning 3) (goto-char (point-at-eol)))))
|
(match-beginning 3) (goto-char
|
||||||
(substring (org-match-string-no-properties 3) 1 -1)))
|
(point-at-eol)))))
|
||||||
(unless key
|
(substring (org-match-string-no-properties 3)
|
||||||
|
1 -1)))
|
||||||
|
;; Get the correct property name from the key. This is
|
||||||
|
;; necessary if the user has configured time keywords.
|
||||||
|
(setq key1 (concat key ":"))
|
||||||
|
(cond
|
||||||
|
((not key)
|
||||||
|
(setq key
|
||||||
(if (= (char-after (match-beginning 3)) ?\[)
|
(if (= (char-after (match-beginning 3)) ?\[)
|
||||||
(setq key "TIMESTAMP_IA")
|
"TIMESTAMP_IA" "TIMESTAMP")))
|
||||||
(setq key "TIMESTAMP")))
|
((equal key1 org-scheduled-string) (setq key "SCHEDULED"))
|
||||||
(when (or (equal key clockstr) (not (assoc key props)))
|
((equal key1 org-deadline-string) (setq key "DEADLINE"))
|
||||||
|
((equal key1 org-closed-string) (setq key "CLOSED"))
|
||||||
|
((equal key1 org-clock-string) (setq key "CLOCK")))
|
||||||
|
(when (or (equal key "CLOCK") (not (assoc key props)))
|
||||||
(push (cons key string) props))))
|
(push (cons key string) props))))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(when (memq which '(all standard))
|
(when (memq which '(all standard))
|
||||||
|
|
Loading…
Reference in New Issue