Explicitly define setter functions for timeline tooling

This is more explicitly and allows for more flexiblity.  Let's hope the
performance impact is not prohibitive, though.
master
Daniel Borchmann 2 years ago
parent dd27018420
commit 2e229c5af9
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
  1. 24
      site-lisp/timeline-tools.el

@ -119,14 +119,22 @@ end date of the timeline."
;; Model
(defalias 'timeline-tools-entry-start-time 'car
"Start time of ENTRY.")
(defalias 'timeline-tools-entry-end-time 'cadr
"End time of ENTRY.")
(defalias 'timeline-tools-entry-marker 'caddr
"Marker to org task of ENTRY.")
(defun timeline-tools-entry-start-time (entry)
"Start time of ENTRY."
(car entry))
(defun timeline-tools-entry-end-time (entry)
"End time of ENTRY."
(cadr entry))
(defun timeline-tools-entry-marker (entry)
"Marker to org task of ENTRY."
(caddr entry))
(gv-define-setter timeline-tools-entry-start-time
(time entry) `(setcar ,entry ,time))
(gv-define-setter timeline-tools-entry-end-time
(time entry) `(setcar (cdr ,entry) ,time))
(defun timeline-tools-make-entry (start-time end-time marker)
"Return a timeline entry made up of START-TIME, END-TIME, and MARKER.

Loading…
Cancel
Save