GNU bug report logs -
#33170
27.0.50; interactive spec with cl-defgeneric/method
Previous Next
Reported by: Alex Branham <alex.branham <at> gmail.com>
Date: Fri, 26 Oct 2018 22:20:03 UTC
Severity: normal
Found in version 27.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 33170 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat 27 Oct 2018 at 01:54, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Alex Branham <alex.branham <at> gmail.com>
>> Date: Fri, 26 Oct 2018 17:19:44 -0500
>>
>> 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.
>
> '&context' is documented only as part of cl-defmethod, so why are you
> trying to use it with cl-defgeneric?
Sorry, that was a typo. The same thing happens if you use defmethod:
(require 'cl-lib)
(cl-defgeneric my/test ()
(interactive)
(message "generic"))
here, M-x my/test works
(cl-defmethod my/test (&context (major-mode emacs-lisp-mode))
(interactive)
(message "method"))
Here, M-x my/test does not work.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 6 years and 260 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.