From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: How to implement mouse highlighing in tabulated list mode, just like for buttons? Date: Sun, 5 Feb 2023 12:06:16 +0300 Message-ID: References: <3a7d15dca834fe52fb6470c3564b7cd2.support1@rcdrun.com> <83ilghtl6w.fsf@gnu.org> <837cwxtfv5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30358"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 05 10:36:03 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pObRL-0007f9-IW for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Feb 2023 10:36:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pObQL-0000A9-9Z; Sun, 05 Feb 2023 04:35:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pObQJ-00009d-3c for emacs-devel@gnu.org; Sun, 05 Feb 2023 04:34:59 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pObQH-0007nO-Ai; Sun, 05 Feb 2023 04:34:58 -0500 Original-Received: from localhost ([::ffff:102.83.69.138]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000010B845.0000000063DF7841.000016AD; Sun, 05 Feb 2023 02:34:57 -0700 Mail-Followup-To: Eli Zaretskii , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: <837cwxtfv5.fsf@gnu.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302995 Archived-At: * Eli Zaretskii [2023-02-04 22:01]: > What do you mean by "that property"? > > mouse-face is a text property, and 'highlight' is on of its possible > values. I don't think we have a feature whereby an arbitrary text > property can be put on every line of buffer text. Thanks, I was researching, and I got it! I understand `mouse-face' is a text property, and I can give it `highlight'. First I was thinking that I could make face with text property, but that I am not sure. Can I could just add face with 'mouse-face as text property? I did not finish the research. I just understood that I can add text property, but if I can add text property to face, if those 2 are at all connected, I do not know yet. I am achieving now the effect by using `propertize` on the element of each entry of `tabulated-list-entries': (let ((name (propertize (aref item 1) 'mouse-face 'highlight))) So that works now well! > > I wonder if it would slow down the listings in tabulated-list-mode. > > When the mouse-face has the value 'highlight', it is only shown when > the mouse pointer is above the text with that property. Otherwise, > the text is displayed normally. Yes. I am thinking that if I wish to place mouse-face as text property line by line, I better avoid making it after the tabulated-list-mode, as that would slow down. But now I do not see difference that I can feel. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/