[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"fall-through" generic function args plus &context
From: |
Eric Abrahamsen |
Subject: |
"fall-through" generic function args plus &context |
Date: |
Mon, 26 Dec 2016 12:34:46 -0800 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) |
I have a few defmethods that use the &context construct to dispatch on
the value of major mode:
(cl-defmethod my-make-buffer-name (&context (major-mode gnus-summary-mode))
;; etc...
)
I need a catch-all method, for default behavior when we're in other
modes that aren't targeted by an existing method.
I've tried things like:
(&context _major-mode)
(&context (major-mode t))
(&context (major-mode nil))
(&context (major-mode (eql _nuthin))
And a few other things. Everything raises cl-no-applicable-method.
What's the correct way to do this? Or do I need to override
`cl-no-applicable-method' and catch the error?
Thanks,
Eric
- "fall-through" generic function args plus &context,
Eric Abrahamsen <=
- Re: "fall-through" generic function args plus &context, Eric Abrahamsen, 2016/12/26
- Re: "fall-through" generic function args plus &context, Stefan Monnier, 2016/12/27
- Re: "fall-through" generic function args plus &context, Eric Abrahamsen, 2016/12/27
- Re: "fall-through" generic function args plus &context, Stefan Monnier, 2016/12/28
- Re: "fall-through" generic function args plus &context, Eric Abrahamsen, 2016/12/29
- Re: "fall-through" generic function args plus &context, Stefan Monnier, 2016/12/29
- Re: "fall-through" generic function args plus &context, Eric Abrahamsen, 2016/12/30
- Re: "fall-through" generic function args plus &context, Stefan Monnier, 2016/12/30
Re: "fall-through" generic function args plus &context, Stefan Monnier, 2016/12/26