GNU bug report logs - #23246
25.0.92; Local face-remapping-alist doesn't affect tooltips

Previous Next

Package: emacs;

Reported by: Artur Malabarba <bruce.connor.am <at> gmail.com>

Date: Fri, 8 Apr 2016 19:23:01 UTC

Severity: wishlist

Found in version 25.0.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23246 in the body.
You can then email your comments to 23246 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Fri, 08 Apr 2016 19:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Artur Malabarba <bruce.connor.am <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 08 Apr 2016 19:23:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.92; Local face-remapping-alist doesn't affect tooltips
Date: Fri, 08 Apr 2016 16:22:11 -0300
1. Start emacs -q

2. Create a buffer in fundamental-mode and type some text.

3. Evaluate this:

    (setq x-gtk-use-system-tooltips nil)
    (add-text-properties (point-min) (point-max) '(help-echo "OKOK"))
    (face-remap-add-relative 'tooltip '((:foreground "blue")))

4. Tooltips displayed are NOT blue.

5. If, instead, I add an entry to face-remapping-alist without making it
buffer-local, the tooltip does indeed display blue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Fri, 08 Apr 2016 19:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92;
 Local face-remapping-alist doesn't affect tooltips
Date: Fri, 08 Apr 2016 22:34:50 +0300
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Date: Fri, 08 Apr 2016 16:22:11 -0300
> 
>     (setq x-gtk-use-system-tooltips nil)
>     (add-text-properties (point-min) (point-max) '(help-echo "OKOK"))
>     (face-remap-add-relative 'tooltip '((:foreground "blue")))
> 
> 4. Tooltips displayed are NOT blue.

Why did you expect them to be blue?  Tooltips are special frames that
don't display any buffer, whereas face-remap-add-relative is
documented as affecting only the buffer that was current at the time
it was called.

More generally, face remapping is designed to allow buffer-local
changes to faces.  If you want to affect the way tooltips are
displayed, you should instead customize the 'tooltip' face or the
parameters in 'tooltip-frame-parameters'.

IOW, I don't see any bug here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Fri, 08 Apr 2016 20:07:01 GMT) Full text and rfc822 format available.

Message #11 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92;
 Local face-remapping-alist doesn't affect tooltips
Date: Fri, 08 Apr 2016 17:06:01 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

> Why did you expect them to be blue?  Tooltips are special frames that
> don't display any buffer, whereas face-remap-add-relative is
> documented as affecting only the buffer that was current at the time
> it was called.

Sorry, to me it wasn't obvious that tooltips are different frames.

> More generally, face remapping is designed to allow buffer-local
> changes to faces.  If you want to affect the way tooltips are
> displayed, you should instead customize the 'tooltip' face or the
> parameters in 'tooltip-frame-parameters'.

I want to change the way tooltips are displayed in a major-mode I'm
writing. I don't want to change this face globally for the user, only
change it in the buffers where this major-mode is active.

I understand that might not be possible, in which case feel free to
close.


Artur




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 09:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Sat, 09 Apr 2016 11:04:09 +0200
> Why did you expect them to be blue?  Tooltips are special frames that
> don't display any buffer,

A tooltip frame displays a buffer called "*tip*".

> whereas face-remap-add-relative is
> documented as affecting only the buffer that was current at the time
> it was called.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 09:05:02 GMT) Full text and rfc822 format available.

Message #17 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Sat, 09 Apr 2016 11:04:17 +0200
> I want to change the way tooltips are displayed in a major-mode I'm
> writing. I don't want to change this face globally for the user, only
> change it in the buffers where this major-mode is active.
>
> I understand that might not be possible, in which case feel free to
> close.

Try using ‘x-show-tip’ directly.

martin





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 09:36:01 GMT) Full text and rfc822 format available.

Message #20 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92;
 Local face-remapping-alist doesn't affect tooltips
Date: Sat, 09 Apr 2016 12:35:00 +0300
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Cc: 23246 <at> debbugs.gnu.org
> Date: Fri, 08 Apr 2016 17:06:01 -0300
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Why did you expect them to be blue?  Tooltips are special frames that
> > don't display any buffer, whereas face-remap-add-relative is
> > documented as affecting only the buffer that was current at the time
> > it was called.
> 
> Sorry, to me it wasn't obvious that tooltips are different frames.

I've added to the ELisp manual some documentation about that, which
makes it clear these are frames.

> I want to change the way tooltips are displayed in a major-mode I'm
> writing. I don't want to change this face globally for the user, only
> change it in the buffers where this major-mode is active.
> 
> I understand that might not be possible, in which case feel free to
> close.

I think you can achieve that by putting your own hook function on the
tooltip-functions list.

Let me know if there's anything else to do about this bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 09:41:01 GMT) Full text and rfc822 format available.

Message #23 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 23246 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Sat, 09 Apr 2016 12:39:54 +0300
> Date: Sat, 09 Apr 2016 11:04:09 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> CC: 23246 <at> debbugs.gnu.org
> 
>  > Why did you expect them to be blue?  Tooltips are special frames that
>  > don't display any buffer,
> 
> A tooltip frame displays a buffer called "*tip*".

Right, I should have been more accurate, and say "any of your own
buffers".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 12:52:02 GMT) Full text and rfc822 format available.

Message #26 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Sat, 09 Apr 2016 14:50:44 +0200
> I've added to the ELisp manual some documentation about that, which
> makes it clear these are frames.

Perfectly done.

Congratulations, martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Sat, 09 Apr 2016 13:20:02 GMT) Full text and rfc822 format available.

Message #29 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 23246 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Sat, 09 Apr 2016 16:18:48 +0300
> Date: Sat, 09 Apr 2016 14:50:44 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> CC: 23246 <at> debbugs.gnu.org
> 
>  > I've added to the ELisp manual some documentation about that, which
>  > makes it clear these are frames.
> 
> Perfectly done.
> 
> Congratulations, martin

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Mon, 11 Apr 2016 03:16:01 GMT) Full text and rfc822 format available.

Message #32 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 23246 <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92;
 Local face-remapping-alist doesn't affect tooltips
Date: Mon, 11 Apr 2016 03:15:20 +0000
[Message part 1 (text/plain, inline)]
On Sat, Apr 9, 2016 at 6:35 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> > Cc: 23246 <at> debbugs.gnu.org
> > Date: Fri, 08 Apr 2016 17:06:01 -0300
> >
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > > Why did you expect them to be blue?  Tooltips are special frames that
> > > don't display any buffer, whereas face-remap-add-relative is
> > > documented as affecting only the buffer that was current at the time
> > > it was called.
> >
> > Sorry, to me it wasn't obvious that tooltips are different frames.
>
> I've added to the ELisp manual some documentation about that, which
> makes it clear these are frames.
>
> > I want to change the way tooltips are displayed in a major-mode I'm
> > writing. I don't want to change this face globally for the user, only
> > change it in the buffers where this major-mode is active.
> >
> > I understand that might not be possible, in which case feel free to
> > close.
>
> I think you can achieve that by putting your own hook function on the
> tooltip-functions list.
>
> Let me know if there's anything else to do about this bug report.
>

No, I think we can close this. Thanks for the help.
And thanks to martin too. `x-show-tip' just might work.
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 11 Apr 2016 15:42:02 GMT) Full text and rfc822 format available.

Notification sent to Artur Malabarba <bruce.connor.am <at> gmail.com>:
bug acknowledged by developer. (Mon, 11 Apr 2016 15:42:02 GMT) Full text and rfc822 format available.

Message #37 received at 23246-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Artur Malabarba <bruce.connor.am <at> gmail.com>
Cc: 23246-done <at> debbugs.gnu.org
Subject: Re: bug#23246: 25.0.92;
 Local face-remapping-alist doesn't affect tooltips
Date: Mon, 11 Apr 2016 18:40:49 +0300
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Date: Mon, 11 Apr 2016 03:15:20 +0000
> Cc: 23246 <at> debbugs.gnu.org
> 
>  I think you can achieve that by putting your own hook function on the
>  tooltip-functions list.
> 
>  Let me know if there's anything else to do about this bug report.
> 
> No, I think we can close this. Thanks for the help. 

Done.

> And thanks to martin too. `x-show-tip' just might work.

You mean, tooltip-functions doesn't?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Tue, 12 Apr 2016 07:31:02 GMT) Full text and rfc822 format available.

Message #40 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: 23246 <at> debbugs.gnu.org, eliz <at> gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Tue, 12 Apr 2016 09:30:17 +0200
>> `x-show-tip' just might work.
>
> You mean, tooltip-functions doesn't?

The doc-string of ‘x-show-tip’ advises that

  This is an internal function; Lisp code should call ‘tooltip-show’.

but ‘tooltip-show’ overrides any face properties of TEXT via

  (propertize text 'face 'tooltip)

in a hardcoded fashion.  So if you want to display your own face
attributes, you currently have to call ‘x-show-tip’ directly despite of
its advice.

Obviously, GTK+ (and probably OS X) tooltips override such attributes
anyway, so changing this might probably never given high priority.
Still, Emacs tooltip frames provide the possibility so why not use it?

martin





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Tue, 12 Apr 2016 14:27:01 GMT) Full text and rfc822 format available.

Message #43 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: martin rudalics <rudalics <at> gmx.at>, 23246 <at> debbugs.gnu.org, eliz <at> gnu.org,
 bruce.connor.am <at> gmail.com
Subject: RE: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Tue, 12 Apr 2016 07:26:47 -0700 (PDT)
>  >> `x-show-tip' just might work.
>  > You mean, tooltip-functions doesn't?
> 
> The doc-string of ‘x-show-tip’ advises that
>    This is an internal function; Lisp code should call ‘tooltip-show’.

Yes, and that's misguided, at least for the reason you give.

> but ‘tooltip-show’ overrides any face properties of TEXT via
>    (propertize text 'face 'tooltip)
> in a hardcoded fashion.  So if you want to display your own face
> attributes, you currently have to call ‘x-show-tip’ directly despite of
> its advice.

Exactly.  Plus ‘x-show-tip’ works across Emacs versions.
It is preferable, IMO.

> Obviously, GTK+ (and probably OS X) tooltips override such attributes
> anyway, so changing this might probably never given high priority.
> Still, Emacs tooltip frames provide the possibility so why not use it?

Yes.  Just do it.

When Emacs wants to steer users away from X toward Y, especially
because the name X is misleading (e.g. `x-<something'), it had
better make sure that Y is really an adequate replacement for X.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23246; Package emacs. (Tue, 12 Apr 2016 15:15:02 GMT) Full text and rfc822 format available.

Message #46 received at 23246 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 23246 <at> debbugs.gnu.org, bruce.connor.am <at> gmail.com
Subject: Re: bug#23246: 25.0.92; Local face-remapping-alist doesn't affect
 tooltips
Date: Tue, 12 Apr 2016 18:14:05 +0300
> Date: Tue, 12 Apr 2016 09:30:17 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  >> `x-show-tip' just might work.
>  >
>  > You mean, tooltip-functions doesn't?
> 
> The doc-string of ‘x-show-tip’ advises that
> 
>    This is an internal function; Lisp code should call ‘tooltip-show’.

It doesn't really matter, IMO.

> but ‘tooltip-show’ overrides any face properties of TEXT via
> 
>    (propertize text 'face 'tooltip)
> 
> in a hardcoded fashion.  So if you want to display your own face
> attributes, you currently have to call ‘x-show-tip’ directly despite of
> its advice.

I agree, but I thought that the function which calls x-show-tip should
be put in tooltip-functions, to avoid the need to copycat the
machinery of popping up and popping down tooltips.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 May 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.