summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2019-08-01 08:10:20 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2019-08-01 08:10:20 +0200
commit64739aa0659b8c72388d2ffd8d5e60478e43b4c4 (patch)
tree7aa431a32f699ed27abaa2367a363d21d5b77395
parent2d08e9d4be87489045c33792ddbc368eba188e04 (diff)
downloadorg-mode-64739aa0659b8c72388d2ffd8d5e60478e43b4c4.tar.gz
Implement force logging of a TODO state change
* lisp/org.el (org-todo): Make a tripple `C-u' prefix force logging the todo state change with timestamp and a note. Ignoting blocking a change now needs four `C-u' prefixes, because this is probably hardly ever used. * doc/org-manual.org (Tracking TODO state changes): Document forcing of state change logging with `C-u C-u C-u C-c C-t'.
-rw-r--r--doc/org-manual.org8
-rw-r--r--lisp/org.el16
2 files changed, 18 insertions, 6 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 245a728..c0a91ab 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 7648b02..bb56910 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))