--- Begin Message ---
Subject: |
27.0.50; interactive spec with cl-defgeneric/method |
Date: |
Fri, 26 Oct 2018 17:19:44 -0500 |
User-agent: |
mu4e 1.1.0; emacs 27.0.50 |
I'm struggling to understand how to make functions defined with
cl-defgeneric interactive:
(require 'cl-lib)
(cl-defgeneric my/test ()
(interactive)
(message "generic"))
If you evaluate that you can do M-x my/test, as expected. However, as
soon as you evaluate this:
(cl-defgeneric my/test (&context (major-mode emacs-lisp-mode))
(interactive)
(message "method"))
M-x my/test no longer works.
Is this a bug or am I misunderstanding how this works?
Thanks,
Alex
signature.asc
Description: PGP signature
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#33170: 27.0.50; interactive spec with cl-defgeneric/method |
Date: |
Tue, 30 Oct 2018 12:15:37 +0200 |
> From: Alex Branham <address@hidden>
> Cc: Eli Zaretskii <address@hidden>, address@hidden
> Date: Mon, 29 Oct 2018 09:18:53 -0500
>
> On Sat 27 Oct 2018 at 16:49, Stefan Monnier <address@hidden> wrote:
>
> > AFAIC it's a limitation. We could support interactive specs, but I'm
> > really not convinced it's worth the trouble. If using 2 functions (one
> > generic and one interactive, which calls the generic one) is really
> > annoying for some reason, I guess you could use
> >
> > (put '<GENERIC> 'interactive-form <FORM>)
> >
> > but I think this property should be deprecated, so don't tell anyone
> > (especially don't tell me) that I even mentioned it to you,
>
> Thanks for the response. Seems like the two-function solution is the way
> to go I guess. I do think this should be documented as a limitation
> somewhere though.
Done.
--- End Message ---