diff --git a/doc/org-manual.org b/doc/org-manual.org index 245a728e0..c0a91ab3e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -4028,7 +4028,7 @@ property (see [[*Properties and Columns]]): - {{{kbd(C-u C-u C-u C-c C-t)}}} :: - #+kindex: C-u C-u C-u C-c C-t + #+kindex: C-u C-u C-u C-u C-c C-t Change TODO state, regardless of any state blocking. #+vindex: org-agenda-dim-blocked-tasks @@ -4170,6 +4170,12 @@ specific settings like =TODO(!)=. For example: :END: #+end_example +#+kindex: C-u C-u C-u C-c C-t +#+cindex: @samp{LOGGING}, forcing +Even if you have not set up logging for a state, you can force logging +the state change by giving three {{{kbd(C-u)}}} to the =org-todo= +command, i.e. press {{{kbd(C-u C-u C-u C-c C-t)}}}. + *** Tracking your habits :PROPERTIES: :DESCRIPTION: How consistent have you been? diff --git a/lisp/org.el b/lisp/org.el index 7648b028d..bb5691048 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9987,6 +9987,9 @@ With a `\\[universal-argument] \\[universal-argument]' prefix, switch to the \ next set of TODO \ keywords (nextset). With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' \ +prefix, force logging the state change and take +a logging note. +With a `\\[universal-argument] \\[universal-argument] \\[universal-argument] \\[universal-argument]' \ prefix, circumvent any state blocking. With a numeric prefix arg of 0, inhibit note taking for the change. With a numeric prefix arg of -1, cancel repeater to allow marking as DONE. @@ -10013,7 +10016,7 @@ When called through ELisp, arg is also interpreted in the following way: (let ((org-blocker-hook org-blocker-hook) commentp case-fold-search) - (when (equal arg '(64)) + (when (equal arg '(256)) (setq arg nil org-blocker-hook nil)) (when (and org-blocker-hook (or org-inhibit-blocking @@ -10030,6 +10033,7 @@ When called through ELisp, arg is also interpreted in the following way: (looking-at "\\(?: *\\|[ \t]*$\\)")) (let* ((match-data (match-data)) (startpos (copy-marker (line-beginning-position))) + (force-log (equal arg '(64))) (logging (save-match-data (org-entry-get nil "LOGGING" t t))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) @@ -10156,11 +10160,13 @@ When called through ELisp, arg is also interpreted in the following way: (setq now-done-p (and (member org-state org-done-keywords) (not (member this org-done-keywords)))) (and logging (org-local-logging logging)) - (when (and (or org-todo-log-states org-log-done) - (not (eq org-inhibit-logging t)) - (not (memq arg '(nextset previousset)))) + (when (or (and (or org-todo-log-states org-log-done) + (not (eq org-inhibit-logging t)) + (not (memq arg '(nextset previousset)))) + force-log) ;; We need to look at recording a time and note. - (setq dolog (or (nth 1 (assoc org-state org-todo-log-states)) + (setq dolog (or (if force-log 'note) + (nth 1 (assoc org-state org-todo-log-states)) (nth 2 (assoc this org-todo-log-states)))) (when (and (eq dolog 'note) (eq org-inhibit-logging 'note)) (setq dolog 'time))