> Stefan, do we have a way of causing the cl-defmethod dispatch reject a
> method due to a failed predicate?  The relevant method of
> multisession.el says:
>
>   (cl-defmethod multisession-backend-value ((_type (eql 'sqlite)) object)
>
> How can I modify this (or its callers?) to make this implementation be
> called only if sqlite-available-p returns non-nil?
AFAIK, the standard way to do that is:

    (cl-defmethod multisession-backend-value ((_type (eql 'sqlite)) object)
      (if (not (sqlite-available-p))
          (cl-call-next-method)
        ...do the usual thing...))

> Btw, it looks like it's okay to have cl-defmethod without a
> cl-defgeneric for the same method?  Is that expected?

Yes.  It's a bit like having a `setq` on a global var without
a matching `defvar`.


        Stefan




  • bug#72788:... Eli Zaretskii
    • bug#7... Bug reports for GNU Emacs, the Swiss army knife of text editors
      • b... Eli Zaretskii
    • bug#7... Eli Zaretskii

Reply via email to