Subject: Re: bug#72788: 30.0.50; multisession--ensure-db: Symbol’s function definition is void: sqlite-open [2 times]

From: Stefan Monnier <[email-masked]>
Date: Sat, 31 Aug 2024 10:09:05 -0400

> 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