GNU bug report logs - #78186
31.0.50; Register Selection Broken

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Thu, 1 May 2025 12:15:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 78186 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 78186 <at> debbugs.gnu.org
Subject: Re: bug#78186: 31.0.50; Register Selection Broken
Date: Thu, 01 May 2025 12:39:59 -0400
[Message part 1 (text/plain, inline)]
> 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
[register.patch (text/x-diff, inline)]
commit 311ea96ccfae813f5cb55a5bc9a13be19c0a4127
Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
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

This bug report was last modified 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.