From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Start keybinding combination Date: Mon, 31 Jan 2022 14:23:34 +0200 Message-ID: <831r0o9jqx.fsf@gnu.org> References: <20220130191539.mkbq77zpn7ugizfi.ref@Ergus> <20220130191539.mkbq77zpn7ugizfi@Ergus> <837dah9fet.fsf@gnu.org> <20220130205447.hcdwnne5twp4f6sv@Ergus> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30286"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 31 13:24:31 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nEVjS-0007k4-Sb for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 Jan 2022 13:24:31 +0100 Original-Received: from localhost ([::1]:47234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEVjR-0002rB-Jg for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 Jan 2022 07:24:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEVic-0002pS-SC for help-gnu-emacs@gnu.org; Mon, 31 Jan 2022 07:23:40 -0500 Original-Received: from [2001:470:142:3::e] (port=43096 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEVic-0000HX-IO for help-gnu-emacs@gnu.org; Mon, 31 Jan 2022 07:23:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gBE2ywxFj6nxZ8+aHvFyrYetRPQR7PLZhqqxsldSGjI=; b=F9PiqyAfOHX+ aDzYi6uhTC1QYKEgsai/jlBUz9Tz1K5V/spgt/LAvNEdLOoy5gYnnb4Eczip3vgJb5Toar3eMrpTG 13/AB5CgDFr0rId7FpDiAyxnAQhZfpHMrMtVFbC8UbqJoHt6t2urffaLGbMfyNT2omQxjNuTk5e6J 2QeXkMx8nS1Rbk0IGO22CKoebDfQC9H5/Uky/cuD9S3rJhY5dpFktVXnlPc2yzPBtRXHY++VME0Dy dTDckvopUbH7Jm/VzZVkV7WirJ7uUc2xQQ2sWsgevFGbHYloFUvtv5Rx81XP7fm+Ldm8pU+T2paSE HcggEKZqaKf516LPLXC1tg==; Original-Received: from [87.69.77.57] (port=1437 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEVia-0008TN-Sn for help-gnu-emacs@gnu.org; Mon, 31 Jan 2022 07:23:37 -0500 In-Reply-To: <20220130205447.hcdwnne5twp4f6sv@Ergus> (message from Ergus on Sun, 30 Jan 2022 21:54:47 +0100) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135610 Archived-At: > Date: Sun, 30 Jan 2022 21:54:47 +0100 > From: Ergus > 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. > 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.