all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Colorize objects by method dispatch type
@ 2020-04-01 20:25 Michael Heerdegen
  2020-04-01 21:46 ` Michael Heerdegen
  2020-04-02  3:00 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Heerdegen @ 2020-04-01 20:25 UTC (permalink / raw
  To: Emacs mailing list

Hi,

Question first: For `cl-defmethod's, is there a way to get a method
dispatch for a given generic name and a set of parameters, e.g. a
reference to the dispatched method?

The background:

On my phone, every contact automatically gets assigned a color.  It's
random but stays always the same for a contact, and in the long run, I
get used to the assigned colors and this is very helpful.

I now want to teach Emacs to automatically colorize objects presented in
some buffer by types in a similar way.  For example, I want to colorize
registers in the register preview by the type of their contents so that
registers containing stuff of the same type all get the same color.  I
don't want to define the colors myself, at least not always.

What I currently do, and this already works very nicely, is to use the
result of `type-of' called on the registers, hash it with `secure-hash'
and use a part of the hash, which is hex code, as color definition.

But in the case of registers, the already existing method
implementations defined by the developers for the different types of
registers provide a better source for an equality relation on registers
than `type-of.'  That's why I would rather use references to the
appropriate method implementations for hashing.


Thanks,

Michael.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-03 23:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-01 20:25 Colorize objects by method dispatch type Michael Heerdegen
2020-04-01 21:46 ` Michael Heerdegen
2020-04-02  3:00 ` Stefan Monnier
2020-04-02  3:45   ` Michael Heerdegen
2020-04-02 12:56     ` Stefan Monnier
2020-04-02 23:46       ` Michael Heerdegen
2020-04-03 16:01         ` Stefan Monnier
2020-04-03 23:23           ` Michael Heerdegen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.