* How to implement mouse highlighing in tabulated list mode, just like for buttons?
@ 2023-02-04 16:52 Jean Louis
2023-02-04 17:05 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2023-02-04 16:52 UTC (permalink / raw)
To: Emacs Developers
On the video below, one can see highlighting of Emacs buttons on the
right side. That is neat and better, as it gives to user sense what
one can click with the mouse.
https://gnu.support/images/2023/02/2023-02-04/2023-02-04-17:31:58.ogv
On the left side, one can see mouse hovering over the list of items in
tabulated-list-mode whereby in echo area there are messages with the
text of items where user hovers the mouse pointer.
In the same time, one can see hl-line-mode turned on.
I would like to improve that what is on the left side.
I would prefer if I can hover hl-line-mode highlighted line up and
down by only moving the mouse in tabulated list mode.
Is that possible somehow?
Or if highlighted line from hl-line-mode is not movable, then maybe it
could be possible to highlight lines in tabulated list mode, in the
same way how lines are highlighted when mouse hovers over Emacs buttons.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
2023-02-04 16:52 How to implement mouse highlighing in tabulated list mode, just like for buttons? Jean Louis
@ 2023-02-04 17:05 ` Eli Zaretskii
2023-02-04 18:47 ` Jean Louis
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-02-04 17:05 UTC (permalink / raw)
To: Jean Louis; +Cc: emacs-devel
> Date: Sat, 04 Feb 2023 17:52:41 +0100
> From: Jean Louis <bugs@gnu.support>
>
> I would prefer if I can hover hl-line-mode highlighted line up and
> down by only moving the mouse in tabulated list mode.
>
> Is that possible somehow?
>
> Or if highlighted line from hl-line-mode is not movable, then maybe it
> could be possible to highlight lines in tabulated list mode, in the
> same way how lines are highlighted when mouse hovers over Emacs buttons.
Put the mouse-face property on each line, and you have it.
(add-text-properties (line-beginning-position) (line-end-position)
'(mouse-face highlight))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
2023-02-04 17:05 ` Eli Zaretskii
@ 2023-02-04 18:47 ` Jean Louis
2023-02-04 19:01 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2023-02-04 18:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
* Eli Zaretskii <eliz@gnu.org> [2023-02-04 20:06]:
> > Date: Sat, 04 Feb 2023 17:52:41 +0100
> > From: Jean Louis <bugs@gnu.support>
> >
> > I would prefer if I can hover hl-line-mode highlighted line up and
> > down by only moving the mouse in tabulated list mode.
> >
> > Is that possible somehow?
> >
> > Or if highlighted line from hl-line-mode is not movable, then maybe it
> > could be possible to highlight lines in tabulated list mode, in the
> > same way how lines are highlighted when mouse hovers over Emacs buttons.
>
> Put the mouse-face property on each line, and you have it.
>
(add-text-properties (line-beginning-position) (line-end-position)
'(mouse-face highlight))
Thank you.
Is there any way to make something like this automatically? Maybe by
defining mouse face to have that property?
I wonder if it would slow down the listings in tabulated-list-mode.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
2023-02-04 18:47 ` Jean Louis
@ 2023-02-04 19:01 ` Eli Zaretskii
2023-02-05 9:06 ` Jean Louis
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-02-04 19:01 UTC (permalink / raw)
To: Jean Louis; +Cc: emacs-devel
> Date: Sat, 4 Feb 2023 21:47:07 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: emacs-devel@gnu.org
>
> (add-text-properties (line-beginning-position) (line-end-position)
> '(mouse-face highlight))
>
> Thank you.
>
> Is there any way to make something like this automatically? Maybe by
> defining mouse face to have that property?
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.
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
2023-02-04 19:01 ` Eli Zaretskii
@ 2023-02-05 9:06 ` Jean Louis
2023-02-05 10:19 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Jean Louis @ 2023-02-05 9:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
* Eli Zaretskii <eliz@gnu.org> [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/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to implement mouse highlighing in tabulated list mode, just like for buttons?
2023-02-05 9:06 ` Jean Louis
@ 2023-02-05 10:19 ` Eli Zaretskii
2023-02-05 11:52 ` [SOLVED] " Jean Louis
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-02-05 10:19 UTC (permalink / raw)
To: Jean Louis; +Cc: emacs-devel
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-05 11:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-04 16:52 How to implement mouse highlighing in tabulated list mode, just like for buttons? Jean Louis
2023-02-04 17:05 ` Eli Zaretskii
2023-02-04 18:47 ` Jean Louis
2023-02-04 19:01 ` Eli Zaretskii
2023-02-05 9:06 ` Jean Louis
2023-02-05 10:19 ` Eli Zaretskii
2023-02-05 11:52 ` [SOLVED] " Jean Louis
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).