unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: 54079@debbugs.gnu.org
Cc: monnier@iro.umontreal.ca
Subject: bug#54079: 29.0.50; Method dispatching eratically fails
Date: Wed, 23 Feb 2022 00:55:18 +0100	[thread overview]
Message-ID: <87ilt6bgnt.fsf@web.de> (raw)
In-Reply-To: <87mtik3l54.fsf@web.de> (Michael Heerdegen's message of "Mon, 21 Feb 2022 05:21:11 +0100")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> > What does `type-of` return on VAL?

`type-of' returns the expected value, the symbol which is the name of
the class.  The return value is not different whether it works or not.

This for example returns t:

  (eq (type-of (cdr (assoc ?A register-alist))) 'my-window+pos-register)

OTOH, in the *trace-output* I am currently seeing this:

1 -> (my-register-val-describe-nicely #s(#<symbol my-window+pos-register at 704865> :#<symbol window at 704894> #<window 173> :#<symbol pos at 704901> #<marker at 699485 in .gnu-emacs.el>))      00:41:15.227
  (my-register-val-describe-nicely #s(#<symbol my-window+pos-register at 704865> :#<symbol window at 704894> #<window 173> :#<symbol pos at 704901> #<marker at 699485 in .gnu-emacs.el>))
  (register-val-describe #s(#<symbol my-window+pos-register at 704865> :#<symbol window at 704894> #<window 173> :#<symbol pos at 704901> #<marker at 699485 in .gnu-emacs.el>) nil)
  (describe-register-1 65)
  (register-describe-oneline 65)
  (my-register-preview (65 . #s(#<symbol my-window+pos-register at 704865> :#<symbol window at 704894> #<window 173> :#<symbol pos at 704901> #<marker at 699485 in .gnu-emacs.el>)))
  (my-register-preview-function (65 . #s(#<symbol my-window+pos-register at 704865> :#<symbol window at 704894> #<window 173> :#<symbol pos at 704901> #<marker at 699485 in .gnu-emacs.el>)))
  (my-register-preview--around-ad #f(compiled-function (buffer &optional show-empty) "Pop up a window to show register preview in BUFFER.\nIf SHOW-EMPTY is non-nil show the window even if no registers.\nFormat of each entry is controlled by the variable `register-preview-function'." #<bytecode 0x1e3c7c22968242f1>) "*Register Preview*")
  (register-preview "*Register Preview*")
  (timer-event-handler [t 25109 29850 770721 nil #f(compiled-function () #<bytecode 0x884d14a4ec654c5>) nil nil 4000 nil])
  (read-key #("Jump to register: " 0 18 (face minibuffer-prompt)))
  (register-read-with-preview "Jump to register: ")
  (command-execute jump-to-register)
1 <- my-register-val-describe-nicely: nil

Definitions are

  (cl-defstruct my-window+pos-register "Doc" window pos)

and

(cl-defgeneric my-register-val-describe-nicely (val)
  "Alternative to `register-val-describe' - the return value is used from this one."
  ;; This should support colors at least for some preview functions
  (ignore val)
  nil)

(cl-defmethod my-register-val-describe-nicely ((val my-window+pos-register))
  (my-register-val-describe-nicely (my-window+pos-register-pos val)))

The default implementation is used and the matching implementation is
ignored.

I have now re-evaluated some of the definitions.  Sometimes this helps -
ATM it didn't.  It made the symbols with positions disappear in the
trace however, now lines are traced like

(my-register-val-describe-nicely #s(my-window+pos-register :window #<window 263 on .gnu-emacs.el> :pos #<marker at 2820 in .gnu-emacs.el>))

So I'm not sure if symbols with positions are related.

Michael.





  reply	other threads:[~2022-02-22 23:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  0:12 bug#54079: 29.0.50; Method dispatching eratically fails Michael Heerdegen
2022-02-21  1:14 ` Michael Heerdegen
2022-03-04 16:12   ` Lars Ingebrigtsen
2022-02-21  3:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-21  4:21   ` Michael Heerdegen
2022-02-22 23:55     ` Michael Heerdegen [this message]
2022-02-23  0:27       ` Michael Heerdegen
2022-02-23  0:47         ` Michael Heerdegen
2022-03-04  2:08           ` Michael Heerdegen
2022-03-04 19:11             ` Alan Mackenzie
2022-03-05 16:37             ` Alan Mackenzie
2022-03-05 17:57               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-05 19:00                 ` Alan Mackenzie
2022-03-05 23:01                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-05 18:19               ` Eli Zaretskii
2022-03-05 19:07                 ` Alan Mackenzie
2022-03-06  2:19               ` Michael Heerdegen
2022-03-08 19:28                 ` Alan Mackenzie
2022-03-08 19:53                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-08 20:48                     ` Alan Mackenzie
2022-03-08 21:03                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-09 17:42                         ` Alan Mackenzie
2022-03-09 18:06                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-09 20:32                             ` Alan Mackenzie
2022-03-09 22:04                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-11 22:01                                 ` Alan Mackenzie
2022-03-12  4:23                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-13 16:49                                     ` Alan Mackenzie
2022-03-14 12:10                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-09  4:10                   ` Michael Heerdegen
2022-03-09 17:29                     ` Alan Mackenzie
2022-03-16  1:44                       ` Michael Heerdegen
2022-03-16 11:52                         ` Alan Mackenzie
2022-03-16 19:22                           ` Michael Heerdegen
2022-03-17  2:58                           ` Michael Heerdegen
2022-03-16 19:29                         ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilt6bgnt.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=54079@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).