emacs-devel
[Top][All Lists]
Advanced

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

Re: master 6e5d79c048: Display show-paren-context-when-offscreen in chil


From: Tassilo Horn
Subject: Re: master 6e5d79c048: Display show-paren-context-when-offscreen in child frame
Date: Mon, 07 Feb 2022 15:08:56 +0100
User-agent: mu4e 1.7.7; emacs 29.0.50

Arash Esbati <arash@gnu.org> writes:

Hi all,

>> But you are right that an overlay could do the job, too.  I'll give
>> that a try.
>
> Many thanks for implementing this feature -- I was looking for this
> for a long time :-)

Thanks!

> In case you need some inspiration for an implementation with overlays,
> you can have a look here:

Too late, I'm already done. :-)

Here's a patch which implements both showing the context in an overlay
and in the header-line in addition to the already pushed child-frame
approach (just set show-paren-context-when-offscreen to either
'child-frame, 'overlay, or 'header-line for comparison).

In the overlay and header-line cases, I replace newlines in the context
string with spaces so that the context always only takes one line.
(Note to self: probably that should be cut to window-width, too, so that
you don't get continuation lines which would cause the buffer text to
"bounce down and back up again".)

The overlay approach has the problem that the context text isn't
outstanding visually.  With the child-frame approach, one can customize
the child-frame-border face's :background to get a nice and outstanding
look.  Is there a way to make the context text a bit more outstanding?
Since it's a buffer-substring, it's usually font-locked already and that
should be kept, of course.

The header-line approach has the problem that the text "bounces" because
usually there is no header-line, so its toggled on and off again.  But
at least, the context text is immediately distinguishable.

So all in all, I still like the child-frame approach best but have no
problem with offering the other options as well.

Bye,
Tassilo



reply via email to

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