|
@@ -9563,7 +9563,12 @@ EXTRA is additional text that will be inserted into the notes buffer."
|
|
|
"\"\"")))))
|
|
|
(if lines (setq note (concat note " \\\\")))
|
|
|
(push note lines))
|
|
|
- (when (or current-prefix-arg org-note-abort) (setq lines nil))
|
|
|
+ (when (or current-prefix-arg org-note-abort)
|
|
|
+ (when org-log-into-drawer
|
|
|
+ (org-remove-empty-drawer-at
|
|
|
+ (if (stringp org-log-into-drawer) org-log-into-drawer "LOGBOOK")
|
|
|
+ org-log-note-marker))
|
|
|
+ (setq lines nil))
|
|
|
(when lines
|
|
|
(save-excursion
|
|
|
(set-buffer (marker-buffer org-log-note-marker))
|
|
@@ -9588,6 +9593,18 @@ EXTRA is additional text that will be inserted into the notes buffer."
|
|
|
(move-marker org-log-note-return-to nil)
|
|
|
(and org-log-post-message (message "%s" org-log-post-message)))
|
|
|
|
|
|
+(defun org-remove-empty-drawer-at (drawer pos)
|
|
|
+ "Remove an emptyr DARWER drawer at position POS.
|
|
|
+POS may also be a marker."
|
|
|
+ (with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer))
|
|
|
+ (save-excursion
|
|
|
+ (save-restriction
|
|
|
+ (widen)
|
|
|
+ (goto-char pos)
|
|
|
+ (if (org-in-regexp
|
|
|
+ (concat "^[ \t]*:" drawer ":[ \t]*\n[ \t]*:END:[ \t]*\n?") 2)
|
|
|
+ (replace-match ""))))))
|
|
|
+
|
|
|
(defun org-sparse-tree (&optional arg)
|
|
|
"Create a sparse tree, prompt for the details.
|
|
|
This command can create sparse trees. You first need to select the type
|