I'm trying to use org-habit to track my habits and sometimes I don't get around to mark stuff as done on the day I do them. I've found two different functions for marking stuff as done in the past, but I can't get either of them to work.
Here are the two different approaches I found. The first was at https://www.emacswiki.org/emacs/OrgMode#toc22 and is the most general: #+BEGIN_SRC emacs-lisp (defun org-todo-at-date (date) (interactive (list (org-time-string-to-time (org-read-date)))) (cl-flet ((org-current-effective-time (&rest r) date) (org-today (&rest r) (time-to-days date))) (org-todo))) #+END_SRC The second is from https://joelmccracken.github.io/entries/emacs-hack-set-todo-done-yesterday/ and looks like this: #+BEGIN_SRC emacs-lisp (defun org-todo-toggle-yesterday () (interactive) (let ((time-in-question (decode-time))) (decf (nth 3 time-in-question)) (setq time-in-question (apply 'encode-time time-in-question)) (flet ((current-time () time-in-question)) (org-todo)))) #+END_SRC Unfortunately, I haven't been able to get either to work. I've tested with Org 9, and with =emacs -Q= (which gives me Org 8.2) but can't get it to work in either. Perhaps the tricks employed do not work in Emacs 25? FWIW: : GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-21 : Org mode version 9.0.3 (9.0.3-elpaplus @ /Users/stig/.emacs.d/elpa/org-plus-contrib-20161224/) Stig