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 09:50:49 +0200 Message-ID: <16ddb4bc-2027-37db-326f-5b11b24a2132@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> 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="10229"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: JD Smith , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 03 09:51:44 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 1ldTMl-0002ax-Tx for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 09:51:43 +0200 Original-Received: from localhost ([::1]:36046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldTMl-0004T6-1H for ged-emacs-devel@m.gmane-mx.org; Mon, 03 May 2021 03:51:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldTM1-0003vL-3H for emacs-devel@gnu.org; Mon, 03 May 2021 03:50:57 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:42117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldTLz-00062h-55; Mon, 03 May 2021 03:50:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620028250; bh=0an5iXb+ClBmooQsBeVA6+8NqkL28lX/sDnR7oA9uCo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=T6U7iaySiMxdXnGnePBenL7i8dM8rSa3rFL+yefAYHgrQbeIVE0cPbCh/PGsM/VYc BBF8TWm3PGpHmB6+oY5i9238zUrQ/wh8hMD1WzgpfwMQEo5istNQbPGTPgjZSAbST+ rvCocMQPBThXjvLvvA7MRjlaofITJc60XpltaI6g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.3]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MPogF-1lyjE11iJH-00Mvtp; Mon, 03 May 2021 09:50:50 +0200 In-Reply-To: <1941D505-E603-41DD-904E-9BD7E4F28155@gmail.com> Content-Language: en-US X-Provags-ID: V03:K1:jyO1Xr+H/fhs1vI5d5RApc1B8IDlAONWosSvGlgkgcKuXWeaSzt JChbHYdowU6iugQmbOZjyCK73a4RIpxbGQCfHNfFUY5AGaNESS23OqPWQXVv31wkD8SBQDP ebHTEzqdm3e3wY4llEujFYqhUD1UBh2yDQAaSb/l1wvcckjFBjhpJS5PuO42vb2JNE/PJ49 ceomMyydixtECTarl2v4A== X-UI-Out-Filterresults: notjunk:1;V03:K0:gllqGa7bjZ8=:VXI2GY+/IfZdnhYzfx4zs1 GNFeuPP8vCzCIrmtIAbkgMbBVWgrOv39fM2a6uUYvJBu44sIoQ7wAI9frg3wiCw/phkwi/fRb shoEWIGw1/8HCHCEnxtGJN0Tw2FhouCmj9zFflGhekGBJ9ARookhy3Ow5W10PfMUPKGWQQBId v3JXtUNn1G7Ex014aawzMY8k5QdvrHSo55sgmPPOAuub59WQAGvqYhpfd0pbHsoipx8PyzMC3 1DB9i4PCwFqbAVCU0AO4hgcE6SOQ3kdoUc+kx4zH8KvF/sPJpGNGH9s8wbOD44uWuFrdGamTk ruvX+gZtWVi4SXgFFZALTjI+F6dSa56sgIZ2KexgqqulRDwhO26hXMMW4NG7kCSq1sFUBeOyE txyyFDZeQwoF+BxprMU7gmRaPdGuO1ZhcNGtZZKRWvPXUSGg06SzOj8jSp+CQs0m2XpDU8qEs +KOJGVkLBcycSuLxzXDYJpXirIivxB/yItAUXFKloojPnsF76abrygMxqLl05FWCjftUMfOGf ldm5BcPvRZrO6uUYH/e4hmHGcoHNP/Mgs5D2JdqXsxUz46i9EKlWUWwetffLu1KiOqHOYji9I 5n6oYLJ8L25xB0BYoVII0yfMJoAuF90BRFHHVcd+T7uk01wL0pwuri7NK9oEq5ewOL+H/6rDx N0Ic9HEdbZeSOJhgr8lKetWt6y1AjINftfAPqX0X2PdOmueg/jmAbTV11U0Rh33WkYcFW10ll IlNfjc2G9c/hQR9E2ESlTTU/mC1C1VmWscD9HmN2E9sFgTKNkVhepzF7Lb2OaJsQKa/hH8/1 Received-SPF: pass client-ip=212.227.17.22; 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:268799 Archived-At: >> Sure, but the event gives you the window, and through it the buffer o= f >> that window, so I see no particular reason to make the window >> selected. > > > A given buffer may appear in multiple windows, which likely will have > different =E2=80=9Cwindow-start=E2=80=9D and =E2=80=9Cwindow-end=E2=80= =9D. So you have to find the > line position in the buffer relevant for that particular window. Also= > tying me to this is the fact that the format-mode-line method > obviously uses windows, not buffers. I'm still missing you. Both `window-start' and `window-point' have a WINDOW argument. So running `get-buffer-window-list' for the buffer you want to manage and calling the former for each window you get that way should all do what you want. And please keep in mind: Calling `select-window' in an :eval form within `mode-line-format' means asking for trouble. Calling `set-window-start' and `set-window-point' anywhere within `mode-line-format' or a hook like `window-scroll-functions' or `window-state-change-functions' means asking for more trouble. All these serve to react to changes in the window configuration but should never change that configuration itself. martin