From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Colorize objects by method dispatch type Date: Wed, 01 Apr 2020 22:25:13 +0200 Message-ID: <87zhbv6jiu.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31127"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 01 22:26:55 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJjwt-0007zo-Ln for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 01 Apr 2020 22:26:55 +0200 Original-Received: from localhost ([::1]:36962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJjws-0006bG-HB for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 01 Apr 2020 16:26:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46588) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJjvH-0006aT-VZ for help-gnu-emacs@gnu.org; Wed, 01 Apr 2020 16:25:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJjvG-0007JG-QY for help-gnu-emacs@gnu.org; Wed, 01 Apr 2020 16:25:15 -0400 Original-Received: from mout.web.de ([217.72.192.78]:33107) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJjvG-0007IT-DS for help-gnu-emacs@gnu.org; Wed, 01 Apr 2020 16:25:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1585772712; bh=IjHD3A8E3SkFNKCaFgdBGwXJt90rJAl8COX75X+N2hw=; h=X-UI-Sender-Class:From:To:Subject:Date; b=NV7SXMimi9qFYXteb+FjH2OmHFThtCFz5smRPItIAssvRBsVFxmRYKQV6a550iMk8 EuViWENckTs5M+Cqco2+EhF6Uz6c13Frts+9Et2YwF8EgLkfL56o/kiRM1bw9qQmAF QADvc/U48TbTXSQnPfi1syieFxMd0rlBp4Y3SnE8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.98.99.7]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MTh6a-1jk2ES2GHI-00QU1U; Wed, 01 Apr 2020 22:25:12 +0200 X-Provags-ID: V03:K1:mdzwZ/z7kAGsXiLGWP/WXEn0s9EZfm8RUdxErKxeCUOaEqqPI7R MEZNP0b7D1082nJwWzSkZYdmuAM1ZuEVR4TY9BPTdPxlafWQDSz2C/vyEE3uN7v48vbdpOe 0LgLdMvySHoF5qhUTPxvvHmQ869DdmtPSyi+06UEIo4ftD8uxefLnT48w1yANZx5WC5x3A8 ttCiUZTNEJ0Tww7pU1PmA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ADvd88PNUq0=:hOsS+yDedJ+RPW8hTGYbrj sr10YPHuOyyx0CAEPmP4ohJw+Xen9AbR/Zc/V1kQ2TGOzu8qIXKZYe7yUSPRtAmEI/8mec+kB UmIaeOaqmsZTeI0yyP/PiD95AtWccQfa+dFiSbnz+hMZq0pdgaTzQMVZZX3KeOQThNCgAMT4U 1aLsZLRgrNOfvwAeBm4IyMr0zblY0JzGp/npXCZraNZlEIk+o4kjqdWEDUtt7Udr5VtAG5lqw sJ+PrE2Q1Frl/D/aN4wHaZKxRWawc7pculTgNONDEjQMdfHBTLUPwSTo0BgAQoUxQsR5g9do0 V0XGxPCXAMGY5GNbCpJhZ5qoRCMtiVnDJ3ywyIDSC9Hzhbsbfa4PCxSsjmHZepHtMtUqRvp6y +80lIS8umhDKgG24xkQddM+Do7zcRG2xy6msyknetI8AmLv7vZt3a9NTZybGs/2D+a7+AFyEY HiElctaaRYcU/uGUwzk0fUNMwkuVhhPcInTFHji+LyMyAcINBJT5NY/Kuxw7BEv4nIp+DtUOa sT4TGJgP6wzWI/AxGR2RunSxjIF7ArYY1V2SqUSm9K2XcCIqtC2yAhgxknQ7W2L2DuO2LxMk9 qXEF1fhHDMAvx5/ZdAvsCC/Nnbj7HbvfXopfqvi2OmsleKF8nhtaHmFobTIs9kIf4oeCYXLNG yGCLREW0VYGC5e2v6xAfJeh9RxShoH7WqZ735XDptBa9hQ26uJ8CqiTE4dmf1iS9ez3QeYnOI bkEkPfUijqlE615RtG9como7owgIEEAG5lz58DypSkTWV1WwDMgApjZgx+w20MJdwy9TAhyc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.78 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122730 Archived-At: 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.