Subject: Re: bug#78186: 31.0.50; Register Selection Broken

From: Stefan Monnier <[email-masked]>
Date: Thu, 01 May 2025 12:39:59 -0400

> Actually, this appears to be broken with everything but the default value?

Yes, the problem was in `register--jumpable-p` which always
returned nil.
I pushed the patch to `master` which should fix it.

        Stefan
commit 311ea96ccfae813f5cb55a5bc9a13be19c0a4127
Author: Stefan Monnier <[email-masked]>
Date:   Thu May 1 12:38:33 2025 -0400

    register.el (register--jumpable-p): Fix bug#78186
    
    While `register--get-method-type` worked fine for `register-val-insert`
    it always returns nil for `register-val-jump-to` because it presumed the
    method took a single argument.  Make it work for multi-arg generic functions.
    
    * lisp/register.el (register--get-method-type): Add `other-args-type` arg.
    (register--jumpable-p): Use it.

diff --git a/lisp/register.el b/lisp/register.el
index a36d0e6648e..a7afc7e08e4 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -575,16 +575,17 @@ buffer-to-register
     (add-hook 'kill-buffer-hook #'register-buffer-to-file-query nil t))
   (set-register register (cons 'buffer buffer)))
 
-(defun register--get-method-type (val genfun)
+(defun register--get-method-type (val genfun &optional other-args-type)
   (let* ((type (cl-type-of val))
 	 (types (cl--class-allparents (cl-find-class type))))
-    (while (and types (not (cl-find-method genfun nil (list (car types)))))
+    (while (and types (not (cl-find-method genfun nil
+                                           (cons (car types) other-args-type))))
       (setq types (cdr types)))
     (car types)))
 
 (defun register--jumpable-p (regval)
   "Return non-nil if `register-val-insert' is implemented for REGVAL."
-  (pcase (register--get-method-type regval 'register-val-jump-to)
+  (pcase (register--get-method-type regval 'register-val-jump-to '(t))
     ('t nil)
     ('registerv (registerv-jump-func regval))
     ('cons