From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Temporarily select-window, without updating mode-line face and cursor fill? Date: Mon, 3 May 2021 19:32:08 +0200 Message-ID: <74920c94-594c-c63b-01c6-056a339d2c59@gmx.at> References: <56F746A2-B842-421E-8FBF-EA5E93EA26CE@gmail.com> <83pmya8d49.fsf@gnu.org> <6168853E-E5B1-4247-A0D7-4D4191DCED0A@gmail.com> <83im418wap.fsf@gnu.org> <1941D505-E603-41DD-904E-9BD7E4F28155@gmail.com> <16ddb4bc-2027-37db-326f-5b11b24a2132@gmx.at> <40C17378-A4BF-4E70-A77D-E5034FA42C91@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29606"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 03 19:40:23 2021 Return-path: Envelope-to: ged-emacs-devel@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 1ldcYQ-0007Zm-VS for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 19:40:22 +0200 Original-Received: from localhost ([::1]:54184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldcYP-0004YQ-UT for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 13:40:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldcQZ-0007Dr-OW for emacs-devel@gnu.org; Mon, 03 May 2021 13:32:15 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:39599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldcQX-0006Hc-Qd; Mon, 03 May 2021 13:32:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620063131; bh=uSSl7cmUygJmSylloF+KeqjMPyKNCd9olSMnsxlCnh8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ZgQg6pilBgAnrYB2MYvYYlA+iKmt9DwixNskB0DBQHePamZanVdBw+jEaShNYGshZ 5BXi2KyVCsMqh9Fk8Go7q44YmgKzdvYKm2YYzpQmsPe100N9Eqs5D7ofGfOtnC9I9L WljRpe/+gFFauBAEnIfUS7W5jRZSWEL/CT/cHc6Y= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([46.125.249.118]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MsHnm-1lOyx61oOw-00tkVP; Mon, 03 May 2021 19:32:11 +0200 In-Reply-To: <40C17378-A4BF-4E70-A77D-E5034FA42C91@gmail.com> Content-Language: en-US X-Provags-ID: V03:K1:/yofZWhhRv5wASt5wEWQLMhUFTITtHgTsKbJcJm1X9ogXh598NB RkaOnlrbIJjov38itjVeO08HorgA723FxGaf0SNBKzUQV8xYkjVtf+zcUUlFly1MVNr3QGR QymEg07OH6Hf6xC+lf402H2kG3zw+6b+GtSJ03drXE5j7A587QKLHZkaXyoOiLpylUm4A7x t4Fy8+pShxqzJR0JFE5rQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:b+id5JURpPI=:9JVgLGr2HO5kHi7XfHbQne KyMvtFFB5FFGy4IJiIJpbwi26KL5wBgzzwa0wzQq4leIZ+nRW/lqEWUWvXW8F48DgAY5F+wJT 3iajNwdMak01z8zkFD/xmYq61aZTL9G/6mebCM+jhBm8R7S//fxebGNR0OLRjISnX8rExmLEY odK5HeIurZC44kl/gL23HbJWnI+PL0Msho5ofupp79dmyB/2VHCspjMXankAdJWn0GZgXt8KP SUKOqWsNx8SYHJMQ/oFuV5RZLol9ctM9OauB8s0GotHo67+Yx1D7KVashhA176tZfDmDq6l/+ +3DVwn8JL1dUrTtLuIW6aFl/+mW/BtF7FQlZsA2OiLkhGTR8xqgSx9AigCpRR0w2wpinqeJkU JbrTbkXacHJU+94eJPu14kOhmPLzrUGVCdv/AjUfdqoM/Hnhej4N+9FOVHG7m1N8cuJUTZMEu 7YZCLaNK8ZHqufqLM57EbWREDK/gVdTPNxsfKgP5Eid2FnMYyfefDJ2mjoDud76MOSrV6/fX5 eHussbQvFJnAOVMrfkTqyJRy1vWY31xTVXb+hcRDMqkdauZwlo8Ut/o5hDCROSB9tX0h3KdUU 4T3stR76G4Cz79o2d6bREiUA0XODW4aVmYYAHYFwsBgj22K+eFuoUoLtLNfd/tah4oqPM1e0i DJCH21x1miYjkF10LN1SbumKo3iAvE+W/vivEVV/pAvd7yh/3NyftKTuhvgqg831zUDwWIrHS RfdYRkhILrDtUBcwdFlFMwTgTZZw1HJoCoi0f0A7oOK2Yj7O9bXSo98oPMCgDaBNsfxGkE69 Received-SPF: pass client-ip=212.227.17.21; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268827 Archived-At: > For calculating the line number in a window which may or may not be > selected, (format-mode-line "%l=E2=80=9D 0 win) has a window argument,= but it > does *not* have a position argument. It takes its position from (as > far as I can tell) the window-point of its window argument. So I need= > to move window-point and immediately restore it if I want to use > format-mode-line. If the window were selected, a simple > save-excursion would be enough. But I cannot first select the window > or I get =E2=80=9Cmode line flashing". I need a mythical > `save-excursion-in-window', if you will. If you just want to evaluate forms like the above (format-mode-line "%l" 0 win) then all I said does not apply. I thought you wanted to do such things via an :eval in the mode line format. So I probably misunderstood you. If all you want to do is to exploit the "%l" construct for getting the line number at window start or window end, then `set-window-point' should at least not harm (though it might not work due to scrolling). > But I will certainly need set-window-start for handling mouse-based > events on the mode line (click/drag/scroll). Perhaps I didn=E2=80=99t= make it > clear that set-window-start will only be called in mouse-based event > callbacks on the mode line; apologies if so. If even this is > problematic in your view, could you clarify the sort of =E2=80=9Ctroub= le=E2=80=9D it > would cause? Other mouse events in the mode-line call things like > =E2=80=98previous-buffer, so it=E2=80=99s not clear to me why set-wind= ow-start would > lead to any special issues when driven by mouse events. If you mean `set-window-start' as the effect (or a side effect) of a mouse-based event on the mode line I see no problem. martin