Adam Porter <a...@alphapapa.net> writes: > #+BEGIN_SRC elisp > (defmacro with-org-today-date (date &rest body) > "Run BODY with the `org-today' function set to return simply DATE. > DATE should be a date-time string (both date and time must be included)." > (declare (indent defun)) > `(let ((day (date-to-day ,date)) > (orig (symbol-function 'org-today))) > (unwind-protect > (progn > (fset 'org-today (lambda () day)) > ,@body) > (fset 'org-today orig)))) > #+END_SRC
You should be able to simplify the macro body to `(cl-letf (((symbol-function 'org-today) (lambda () (date-to-day ,date)))) ,@body) -- Kyle