bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#27517: 26.0.50; 25.2.2; Cannot add "help-echo" property to buffer re


From: Stefan Monnier
Subject: bug#27517: 26.0.50; 25.2.2; Cannot add "help-echo" property to buffer regions in *lisp-mode
Date: Fri, 13 Aug 2021 23:06:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen [2021-08-13 15:18:23] wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>> This happens because lisp-mode.el wants itself to manage the help-echo
>> property:
>
> [...]
>
>>          (font-lock-extra-managed-props help-echo)
>>
>> When a property appears in font-lock-extra-managed-props, font-lock
>> removes that property when it's about to re-fontify some region, see
>> font-lock-default-unfontify-region.
>
> This is presumably so that font-locking can add help-echo warnings like
>
> +       (lisp--match-hidden-arg
> +        (0 '(face font-lock-warning-face
> +             help-echo "Hidden behind deeper element; move to another 
> line?")))
>
> which seems useful.
>
> But it'd also be nice to allow other packages to also add help-echo on
> bits and bobs.  Is there no way to achieve that?

There is sadly no easy way to do that currently.
You can do things like:
- Use an overlay instead of a text-property.
- Apply the text-property via `font-lock-add-keywords` rather than directly.
- Add support for "multiple planes" in text-properties.  This means that
  font-lock would use its own "plane" and your package could use another
  plane, and the two would be correctly merged and font-lock wouldn't
  erase your properties.
  It's been on my todo list for many years.  I've proposed it to as
  a summer project to some of my students but so far to no avail.


        Stefan






reply via email to

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