unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vladimir Kazanov <vekazanov@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] User-defined fringe tooltips (a request for review)
Date: Tue, 26 Mar 2024 22:16:02 +0000	[thread overview]
Message-ID: <CAAs=0-1JKV5GVzk6_s6eFogyJccKBvjyxxnzf7K5Lb1BFiHxbQ@mail.gmail.com> (raw)
In-Reply-To: <86frwejkxe.fsf@gnu.org>

Hey,

I just did a deep dive into the code again - looking for a cleaner solution.

> The condition is only evaluated at glyph generation time, as for any
> other display property.  When the tooltip should be displayed, the
> condition is not relevant, since if it were false when the glyphs were
> generated, you wouldn't have had the fringe bitmap shown in the first
> place.
>
> However, I think there's an easy way of making the implementation
> easier: just introduce a new overlay property called, say,
> fringe-help-echo, and put that property on the same text as the
> display property which produces the fringe.  Then the code in
> note_fringe_highlight should simply check if the text which yielded
> the fringe bitmap also has this special property on it, and if so,
> display the tooltip.

Maybe an even easier solution would work:

1. Record buffer position of the fringe display spec in struct it.
Then move it to glyph_row the same way user_fringe_bitmap_id's are
copied over.  It is just a ptrdiff so nothing out of place for
glyph_rows.

2. In note_fringe_highlight it becomes easy to retrieve the fringe
display spec using a single call to get_char_property_and_overlay(),
no need to iterate over a line, or have the implementation detail leak
into text properties.

What I don't really understand is whether I should handle overlays
with after-string/before-string properties. Overlays can contain
strings propertized with fringe display specs as well. In fact, there
is an example showing this trick in the manual
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html).

Should I just go through all overlays touching the spec position and
parse into the after-string/before-string as well?

Pardon the many questions, display code has many moving parts.

Thank you

-- 
Regards,

Vladimir Kazanov



  reply	other threads:[~2024-03-26 22:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 19:38 [PATCH] User-defined fringe tooltips (a request for review) Vladimir Kazanov
2023-12-20 12:31 ` Eli Zaretskii
2023-12-21 16:51   ` Vladimir Kazanov
2023-12-21 17:37     ` Eli Zaretskii
2023-12-23 13:28       ` Vladimir Kazanov
2023-12-23 13:40         ` Eli Zaretskii
2023-12-24 11:31           ` Vladimir Kazanov
2023-12-24 16:54             ` Eli Zaretskii
2024-03-25 15:55               ` Vladimir Kazanov
2024-03-25 17:11                 ` Eli Zaretskii
2024-03-26 22:16                   ` Vladimir Kazanov [this message]
2024-03-27 10:59                     ` Vladimir Kazanov
2024-03-27 11:25                       ` Po Lu
2024-03-27 12:48                         ` Vladimir Kazanov
2024-03-27 11:25                       ` Po Lu
2024-03-31  8:36                       ` Eli Zaretskii
2024-04-07 11:14                         ` Vladimir Kazanov
2024-04-07 12:44                           ` Eli Zaretskii
2024-04-07 17:07                             ` Vladimir Kazanov
2024-04-07 18:40                               ` Eli Zaretskii
2024-04-08 14:41                                 ` Vladimir Kazanov
2024-04-13  9:14                                   ` Eli Zaretskii
2024-04-13  9:32                                     ` Vladimir Kazanov
2024-04-13 11:21                                       ` Eli Zaretskii
2024-04-13 14:53                                         ` Vladimir Kazanov
2024-04-13 15:47                                           ` Eli Zaretskii
2024-03-27 12:14                     ` Eli Zaretskii
2024-03-27 12:48                       ` Vladimir Kazanov

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='CAAs=0-1JKV5GVzk6_s6eFogyJccKBvjyxxnzf7K5Lb1BFiHxbQ@mail.gmail.com' \
    --to=vekazanov@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).