[Top][All Lists]

[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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]