Change: Simplify a pcase
This commit is contained in:
parent
df5d5e2387
commit
50fab59fec
1 changed files with 7 additions and 7 deletions
14
org-ql.el
14
org-ql.el
|
|
@ -281,13 +281,13 @@ With COMPARATOR and TARGET-DATE, return non-nil if entry's
|
||||||
scheduled date compares with TARGET-DATE according to COMPARATOR.
|
scheduled date compares with TARGET-DATE according to COMPARATOR.
|
||||||
TARGET-DATE may be a string like \"2017-08-05\", or an integer
|
TARGET-DATE may be a string like \"2017-08-05\", or an integer
|
||||||
like one returned by `date-to-day'."
|
like one returned by `date-to-day'."
|
||||||
(when-let ((timestamp (pcase type
|
(when-let (;; FIXME: Add :date selector, since I put it
|
||||||
;; FIXME: Add :date selector, since I put it
|
;; in the examples but forgot to actually
|
||||||
;; in the examples but forgot to actually
|
;; make it.
|
||||||
;; make it.
|
(timestamp (org-entry-get (point) (pcase type
|
||||||
(:deadline (org-entry-get (point) "DEADLINE"))
|
(:deadline "DEADLINE")
|
||||||
(:scheduled (org-entry-get (point) "SCHEDULED"))
|
(:scheduled "SCHEDULED")
|
||||||
(:closed (org-entry-get (point) "CLOSED"))))
|
(:closed "CLOSED"))))
|
||||||
(date-element (with-temp-buffer
|
(date-element (with-temp-buffer
|
||||||
;; FIXME: Hack: since we're using
|
;; FIXME: Hack: since we're using
|
||||||
;; (org-element-property :type date-element)
|
;; (org-element-property :type date-element)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue