From f03ea46b3a997da8a4c1d296b650df6423da94df Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 7 Sep 2008 08:29:16 +0200 Subject: [PATCH] The note buffer for clocking out now mentions the task. --- ORGWEBPAGE/Changes.org | 4 ++++ lisp/ChangeLog | 4 ++++ lisp/org-clock.el | 3 ++- lisp/org.el | 12 +++++++++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 57f260491..3136ea8e6 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -32,6 +32,10 @@ ** Details +*** The note buffer for clocking out now mentions the task + + This was a request by Peter Frings. + *** Secondary filtering of agenda views. You can now easily and interactively filter an existing diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 401dfe4b1..4b45232e3 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-09-07 Carsten Dominik + + * org.el (org-log-note-extra): New variable. + 2008-09-05 Bastien Guerry * org.el (org-additional-option-like-keywords): Added keywords for diff --git a/lisp/org-clock.el b/lisp/org-clock.el index dcaa8a081..80eb5145c 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -368,7 +368,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (delete-char 1))) (move-marker org-clock-marker nil) (when org-log-note-clock-out - (org-add-log-setup 'clock-out)) + (org-add-log-setup 'clock-out nil nil nil + (concat "# Task: " (org-get-heading t) "\n\n"))) (when org-mode-line-timer (cancel-timer org-mode-line-timer) (setq org-mode-line-timer nil)) diff --git a/lisp/org.el b/lisp/org.el index a738e5f84..684892af5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8747,6 +8747,7 @@ Returns the new TODO keyword, or nil if no state change should occur." (defvar org-log-post-message) (defvar org-log-note-purpose) (defvar org-log-note-how) +(defvar org-log-note-extra) (defun org-auto-repeat-maybe (done-word) "Check if the current headline contains a repeated deadline/schedule. If yes, set TODO state back to what it was and change the base date @@ -8985,6 +8986,7 @@ be removed." (defvar org-log-note-purpose nil) (defvar org-log-note-state nil) (defvar org-log-note-how nil) +(defvar org-log-note-extra nil) (defvar org-log-note-window-configuration nil) (defvar org-log-note-return-to (make-marker)) (defvar org-log-post-message nil @@ -8997,11 +8999,13 @@ This is done in the same way as adding a state change note." (interactive) (org-add-log-setup 'note nil t nil)) -(defun org-add-log-setup (&optional purpose state findpos how) +(defun org-add-log-setup (&optional purpose state findpos how extra) "Set up the post command hook to take a note. If this is about to TODO state change, the new state is expected in STATE. When FINDPOS is non-nil, find the correct position for the note in -the current entry. If not, assume that it can be inserted at point." +the current entry. If not, assume that it can be inserted at point. +HOW is an indicator what kind of note should be created. +EXTRA is additional text that will be inserted into the notes buffer." (save-excursion (when findpos (org-back-to-heading t) @@ -9016,7 +9020,8 @@ the current entry. If not, assume that it can be inserted at point." (move-marker org-log-note-marker (point)) (setq org-log-note-purpose purpose org-log-note-state state - org-log-note-how how) + org-log-note-how how + org-log-note-extra extra) (add-hook 'post-command-hook 'org-add-log-note 'append))) (defun org-skip-over-state-notes () @@ -9050,6 +9055,7 @@ the current entry. If not, assume that it can be inserted at point." ((eq org-log-note-purpose 'note) "this entry") (t (error "This should not happen"))))) + (if org-log-note-extra (insert org-log-note-extra)) (org-set-local 'org-finish-function 'org-store-log-note))) (defvar org-note-abort nil) ; dynamically scoped