emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to implement mouse highlighing in tabulated list mode, just like


From: Eli Zaretskii
Subject: Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
Date: Sun, 05 Feb 2023 12:19:50 +0200

> Date: Sun, 5 Feb 2023 12:06:16 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: emacs-devel@gnu.org
> 
> Can I could just add face with 'mouse-face as text property?

'face' and 'mouse-face' are two different text properties, so a face
cannot "have" another text property.

Also, only 'mouse-face' text property is handled in the way that makes
the text highlighted when the mouse pointer is above it.

> 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. 

I doubt this will slow down.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]