From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 27517@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
Vitalie Spinu <spinuvit@gmail.com>
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 [thread overview]
Message-ID: <jwvy2959m07.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87lf55bi00.fsf_-_@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Aug 2021 15:18:23 +0200")
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
next prev parent reply other threads:[~2021-08-14 3:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 12:35 bug#27517: 26.0.50; 25.2.2; Cannot add "help-echo" property to buffer regions Vitalie Spinu
2017-06-28 16:38 ` Eli Zaretskii
2017-06-28 22:22 ` Vitalie Spinu
2021-08-13 13:18 ` bug#27517: 26.0.50; 25.2.2; Cannot add "help-echo" property to buffer regions in *lisp-mode Lars Ingebrigtsen
2021-08-14 3:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-08-14 12:03 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy2959m07.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=27517@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
--cc=spinuvit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).