diff --git a/lisp/org.el b/lisp/org.el index 3d4de5b4f..978850199 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10146,6 +10146,8 @@ EXTRA is additional text that will be inserted into the notes buffer." org-log-note-how how org-log-note-extra extra org-log-note-effective-time (org-current-effective-time) + org-log-note-this-command this-command + org-log-note-recursion-depth (recursion-depth) org-log-setup t) (add-hook 'post-command-hook 'org-add-log-note 'append)) @@ -10174,6 +10176,8 @@ EXTRA is additional text that will be inserted into the notes buffer." (defun org-add-log-note (&optional _purpose) "Pop up a window for taking a note, and add this note later." + (when (and (equal org-log-note-this-command this-command) + (= org-log-note-recursion-depth (recursion-depth))) (remove-hook 'post-command-hook 'org-add-log-note) (setq org-log-setup nil) (setq org-log-note-window-configuration (current-window-configuration)) @@ -10204,7 +10208,7 @@ EXTRA is additional text that will be inserted into the notes buffer." (t (error "This should not happen"))))) (when org-log-note-extra (insert org-log-note-extra)) (setq-local org-finish-function 'org-store-log-note) - (run-hooks 'org-log-buffer-setup-hook))) + (run-hooks 'org-log-buffer-setup-hook)))) (defvar org-note-abort nil) ; dynamically scoped (defun org-store-log-note ()