Change: Simplify a pcase

This commit is contained in:
Adam Porter 2018-11-19 03:24:33 -06:00
parent df5d5e2387
commit 50fab59fec

View file

@ -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.
(:deadline (org-entry-get (point) "DEADLINE")) (timestamp (org-entry-get (point) (pcase type
(:scheduled (org-entry-get (point) "SCHEDULED")) (:deadline "DEADLINE")
(:closed (org-entry-get (point) "CLOSED")))) (:scheduled "SCHEDULED")
(: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)