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

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

Re: Start keybinding combination


From: Ergus
Subject: Re: Start keybinding combination
Date: Mon, 31 Jan 2022 16:42:24 +0100

On Mon, Jan 31, 2022 at 02:23:34PM +0200, Eli Zaretskii wrote:
Date: Sun, 30 Jan 2022 21:54:47 +0100
From: Ergus <spacibba@aol.com>
Cc: help-gnu-emacs@gnu.org

>What would such a hook do to produce the effect that you want?  The
>mode-line color change will not be visible unless you force redisplay
>of the mode line.
>
Hi Eli:

My question comes from the fact that I see the prefix in the echo area
and it looks inconspicuous. So, some redisplay is actually done
right?

A very limited variant of redisplay, which only updates the echo-area.

Oh, I see.

Something like:

(add-hook the-new-hook (lambda ()
           (face-remap-add-relative 'mode-line :background some-color)))

And then call `face-remap-remove-relative` in the opposed|symmetric exit
hook... similar to what minibuffer-setup-hook/minibuffer-exit-hook do.

But I could be wrong.

Does it makes sense?

It would make the prompt much slower, because updating the mode line
requires a very thorough redisplay, the way it is implemented.  And if
you on top of that change the mode-line face, Emacs will need to
recompute all the faces (twice) as well.  I wonder if it's worth it.

I understand. I don't think that in practice that slowness may be even
noticeable in our days, but considering I am always concerned about
performance, then probably you are right.

Very thanks,
Ergus


reply via email to

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