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

From: Stephen Leake <[email-masked]>
Date: Tue, 01 Dec 2015 12:30:15 -0600

[email-masked] writes:

> This comes from cl-generic.el line 803:
>
> (define-error 'cl-no-applicable-method "No applicable method for %S"
>   'cl-no-method)

This patch fixes the problem for me, and seems appropriate for Emacs 25.

diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 9e6102c..23d53ac 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -797,23 +797,24 @@ methods.")
 
 ;;; Define some pre-defined generic functions, used internally.
 
-(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)
 
 (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.

-- 
-- Stephe