org-dynamic-block-insert-dblock: Do not call non-commands interactively

* lisp/org.el (org-dynamic-block-insert-dblock): When insert command
for a dynamic block is not interactive, do not try to call it
interactively.

Reported-by: chris <inkbottle007@gmail.com>
Link: https://orgmode.org/list/5790810.DvuYhMxLoT@nixos
This commit is contained in:
Ihor Radchenko 2024-02-19 13:18:10 +03:00
parent 85aafac417
commit d6c3ab08b4
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -8796,7 +8796,7 @@ is non-nil, call the dynamic block function interactively."
(pcase (org-dynamic-block-function type)
(`nil (error "No such dynamic block: %S" type))
((and f (pred functionp))
(if interactive-p (call-interactively f) (funcall f)))
(if (and interactive-p (commandp f)) (call-interactively f) (funcall f)))
(_ (error "Invalid function for dynamic block %S" type))))
(defun org-dblock-update (&optional arg)