By defining `foo' with (defun foo (arg) (interactive "p" org-mode) (message "foo")) M-x foo is still available in elisp-mode. I'm using GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2021-08-16 On Mon, Aug 16, 2021 at 9:24 PM Lars Ingebrigtsen wrote: > Jean-Christophe Helary writes: > > > Ok, that's what I eventually guessed. So, the idea is to check whether > > a function is interactive and try to guess whether it is limited to a > > given mode (most probably the mode it is defined in), and if yes tag > > it ? > > Yup. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > >