(register--get-method-type): Fix one more case (bug#80894)

* lisp/register.el (register--get-method-type): Refine the cl-generic hack
yet a but further.
* test/lisp/register-tests.el (register--jumpable-p): Fix the test.
This commit is contained in:
Stefan Monnier 2026-04-26 12:18:04 -04:00
parent c6608ea050
commit 4bd5608513
2 changed files with 3 additions and 1 deletions

View file

@ -593,6 +593,8 @@ With a prefix argument, prompt for BUFFER as well."
;; then look for the best matching method. ;; then look for the best matching method.
(let* ((type (or (oclosure-type val) (cl-type-of val))) (let* ((type (or (oclosure-type val) (cl-type-of val)))
(types (cl--class-allparents (cl--find-class type)))) (types (cl--class-allparents (cl--find-class type))))
(if (eq type 'cons) (push `(head ,(car val)) types))
(push `(eql ',val) types)
(while (and types (not (cl-find-method genfun nil (while (and types (not (cl-find-method genfun nil
(cons (car types) other-args-type)))) (cons (car types) other-args-type))))
(setq types (cdr types))) (setq types (cdr types)))

View file

@ -72,7 +72,7 @@
(senator-make-register (senator-make-register
(list "foo" 'type nil nil (make-overlay 1 1))))) (list "foo" 'type nil nil (make-overlay 1 1)))))
;; DocView: FIXME -- this should pass! ;; DocView: FIXME -- this should pass!
(should-not (register--jumpable-p (should (register--jumpable-p
(cons 'doc-view (list (cons 'buffer (current-buffer)) (cons 'doc-view (list (cons 'buffer (current-buffer))
'(file . "foo") '(page . 1))))) '(file . "foo") '(page . 1)))))
(should-not (register--jumpable-p "test"))) (should-not (register--jumpable-p "test")))