Subject: bug#22069: 25.0.50; bogus %S in cl-no-applicable-method message

From: Stefan Monnier <[email-masked]>
Date: Tue, 01 Dec 2015 16:25:07 -0500

>    cl-no-applicable-method: No applicable method for %S: xref-backend-definitions, my-xref-backend, "foo"

> The %S is not used as a `format' argument.

Indeed, I was confused.

> (define-error 'cl-no-applicable-method "No applicable method for %S"
>   'cl-no-method)

This should just be 

  (define-error 'cl-no-applicable-method "No applicable method"
    'cl-no-method)

> -(define-error 'cl-no-method "No method for %S")
> -(define-error 'cl-no-next-method "No next method for %S" 'cl-no-method)
> -(define-error 'cl-no-primary-method "No primary method for %S" 'cl-no-method)
> -(define-error 'cl-no-applicable-method "No applicable method for %S"
> +(define-error 'cl-no-method "No method")
> +(define-error 'cl-no-next-method "No next method" 'cl-no-method)
> +(define-error 'cl-no-primary-method "No primary method" 'cl-no-method)
> +(define-error 'cl-no-applicable-method "No applicable method"
>    'cl-no-method)

Looks good.

>  (cl-defgeneric cl-no-next-method (generic method &rest args)
>    "Function called when `cl-call-next-method' finds no next method."
> -  (signal 'cl-no-next-method `(,(cl--generic-name generic) ,method ,@args)))
> +  (signal 'cl-no-next-method (append (list (format "%S" (cl--generic-name generic)) method) args)))
>
>  (cl-defgeneric cl-no-applicable-method (generic &rest args)
>    "Function called when a method call finds no applicable method."
> -  (signal 'cl-no-applicable-method `(,(cl--generic-name generic) ,@args)))
> +  (signal 'cl-no-applicable-method
> +          (append (list (format "%S" (cl--generic-name generic))) args)))
>
>  (cl-defgeneric cl-no-primary-method (generic &rest args)
>    "Function called when a method call finds no primary method."
> -  (signal 'cl-no-primary-method `(,(cl--generic-name generic) ,@args)))
> +  (signal 'cl-no-primary-method (append (list (format (cl--generic-name generic))) args)))
>
>  (defun cl-call-next-method (&rest _args)
>    "Function to call the next applicable method.

No, these should stay as they are, I think.

        Stefan