Ver Fonte

Remember: Allow to file as sibling of current clock

Patch by Lukasz Stelmach.
Carsten Dominik há 15 anos atrás
pai
commit
a27d1c2963
3 ficheiros alterados com 18 adições e 10 exclusões
  1. 7 7
      doc/org.texi
  2. 5 0
      lisp/ChangeLog
  3. 6 3
      lisp/org-remember.el

+ 7 - 7
doc/org.texi

@@ -5968,13 +5968,13 @@ now@footnote{To avoid this query, configure the variable
 will continue to run after the note was filed away.
 
 The handler will then store the note in the file and under the headline
-specified in the template, or it will use the default file and headline.
-The window configuration will be restored, sending you back to the working
-context before the call to Remember.  To re-use the location found
-during the last call to Remember, exit the Remember buffer with
-@kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
-Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
-the currently clocked item.
+specified in the template, or it will use the default file and headline.  The
+window configuration will be restored, sending you back to the working
+context before the call to Remember.  To re-use the location found during the
+last call to Remember, exit the Remember buffer with @kbd{C-0 C-c C-c},
+i.e. specify a zero prefix argument to @kbd{C-c C-c}.  Another special case
+is @kbd{C-2 C-c C-c} which files the note as a child of the currently clocked
+item, and @kbd{C-3 C-c C-c} files as a sibling of the currently clocked item.
 
 @vindex org-remember-store-without-prompt
 If you want to store the note directly to a different place, use

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2010-02-24  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-remember.el (org-remember-apply-template): Extend comment.
+	(org-remember-handler): Implement clock sibling filing.
+
 2010-02-23  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-publish.el (org-publish-all, org-publish-current-file)

+ 6 - 3
lisp/org-remember.el

@@ -479,7 +479,7 @@ to be run from that hook to function properly."
 ## C-u C-c C-c  like C-c C-c, and immediately visit note at target location
 ## C-0 C-c C-c  \"%s\" -> \"* %s\"
 ## %s  to select file and header location interactively.
-## C-2 C-c C-c  as child of the currently clocked item
+## C-2 C-c C-c  as child (C-3: as sibling) of the currently clocked item
 ## To switch templates, use `\\[org-remember]'.  To abort use `C-c C-k'.\n\n"
 		  (if org-remember-store-without-prompt "    C-c C-c" "    C-1 C-c C-c")
 		  (abbreviate-file-name (or file org-default-notes-file))
@@ -869,6 +869,7 @@ See also the variable `org-reverse-note-order'."
 	   (previousp (and (member current-prefix-arg '((16) 0))
 			   org-remember-previous-location))
 	   (clockp (equal current-prefix-arg 2))
+	   (clocksp (equal current-prefix-arg 3))
 	   (fastp (org-xor (equal current-prefix-arg 1)
 			   org-remember-store-without-prompt))
 	   (file (cond
@@ -891,7 +892,7 @@ See also the variable `org-reverse-note-order'."
 	      visiting (and file (org-find-base-buffer-visiting file))
 	      heading (cdr org-remember-previous-location)
 	      fastp t))
-      (when clockp
+      (when (or clockp clocksp)
 	(setq file (buffer-file-name (marker-buffer org-clock-marker))
 	      visiting (and file (org-find-base-buffer-visiting file))
 	      heading org-clock-heading-for-remember
@@ -1024,7 +1025,9 @@ See also the variable `org-reverse-note-order'."
 			       (beginning-of-line 2)
 			     (end-of-line 1)
 			     (insert "\n"))))
-		     (org-paste-subtree (org-get-valid-level level 1) txt)
+		     (org-paste-subtree (if clocksp 
+					    level
+					  (org-get-valid-level level 1)) txt)
 		     (and org-auto-align-tags (org-set-tags nil t))
 		     (bookmark-set "org-remember-last-stored")
 		     (move-marker org-remember-last-stored-marker (point)))