Here's a patch which cleans up some magic numbers in `org-attach.el` and gets rif of the use of the second arg of `commandp`, by making `org-attach-commands` accept any commands (including keyboard macros).
Stefan diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index 36c21b7021..bba7fd7690 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el @@ -314,14 +314,14 @@ org-attach (concat (mapcar #'caar org-attach-commands))))) (message msg) (while (and (setq c (read-char-exclusive)) - (memq c '(14 16 22 134217846))) + (memq c '(?\C-n ?\C-p ?\C-v ?\M-v))) (org-scroll c t))) (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*")))) (let ((command (cl-some (lambda (entry) (and (memq c (nth 0 entry)) (nth 1 entry))) org-attach-commands))) - (if (commandp command t) - (call-interactively command) + (if (commandp command) + (command-execute command) (error "No such attachment command: %c" c)))))) (defun org-attach-dir (&optional create-if-not-exists-p no-fs-check)