On Fri, 1 Jul 2022 at 07:43, Ihor Radchenko <yanta...@gmail.com> wrote: > > Currently, when we call `org-auto-repeat-maybe', it adds > > `org-add-log-note' to post-command-hook using `org-add-log-setup'. As > > soon as we reach the question about 10 repeater intervals (the call to > > `y-or-n-p' from `org-auto-repeat-maybe'), the post-command-hook gets > > executed.[1] > > Bhavin, did you have a chance to send a bug report on this to Emacs > devs?
Haven't done that yet. But it seems like we will have to find a fix to make sure `delete-other-windows' is not called for the minibuffer. My modified example: (defvar my-hook-counter) (defun my-test-command () (interactive) (message "my-test-command: setting post-command-hook") (setq my-hook-counter 3) (add-hook 'post-command-hook 'my-own-hook) (y-or-n-p "Some question: ") (message "my-test-command: message after setting the hook") ) (defun my-own-hook () (print (format "hook: this: %s, real: %s, last: %s" this-command real-this-command last-command)) (message "my-own-hook: hopefully executing at the end") (setq my-hook-counter (- my-hook-counter 1)) (if (eq my-hook-counter 0) (remove-hook 'post-command-hook 'my-own-hook)) ) While looking at the *Messages* buffer, I came across the command y-or-n-p-insert-y. There are commands for n, and other keys. When we press y, M-p etc, these commands get executed. So, even if we manage to fix the initial example in Emacs, the hook will still run while one is in the minibuffer. -- Bhavin Gandhi (bhavin192) | https://geeksocket.in