From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: =?UTF-8?Q?Re=3a_Customize_=e2=80=98window-state-get/put=e2=80=99?= Date: Fri, 11 Oct 2019 10:18:13 +0200 Message-ID: References: <87sgo4kyfp.fsf@mail.linkov.net> <87lfttbo70.fsf@mail.linkov.net> <874l0gqna8.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="238279"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Yuan Fu , Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 11 10:20:07 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIq9d-000zre-UF for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2019 10:20:06 +0200 Original-Received: from localhost ([::1]:47116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIq9b-0003u4-VW for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2019 04:20:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41908) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIq80-0003Wm-FK for emacs-devel@gnu.org; Fri, 11 Oct 2019 04:18:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIq7y-00082C-Cf for emacs-devel@gnu.org; Fri, 11 Oct 2019 04:18:24 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:34737) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIq7y-0007zq-3a for emacs-devel@gnu.org; Fri, 11 Oct 2019 04:18:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1570781896; bh=lBXmLQxGeuHAPEh2uw1dlphuYqbqNnlvyldeFNVnoQ0=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=G4gVNsEyOGDgAP2v3teN+yADWx9beubH0hGfO9T5F/ToNzKcr7zs1bNuMa6g9HHzB xIFQ0sOOJFC9Rjf9OHlZ5Gpxlereh6MVqEkN5HEFPI7VqT9UoL3L+Lhcem8F/6cTf8 u4hAxCzoAT8cTLvzlpXHM2m1HoaVsTFkLOOeHC9w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([46.125.249.9]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6KUT-1hzSk23Z29-016jVU; Fri, 11 Oct 2019 10:18:16 +0200 In-Reply-To: Content-Language: de-AT X-Provags-ID: V03:K1:JltsC/mKzpFaFRJMEi4NJ3msKnqsQsPiu2IMtBa8CHEXYIRoLOK KqIwNHgJHzqSahyJCzhzWLDYlucHqS7zjHsf4FHXI1cYS5d2nDXBG4o4qpwCpB+cunqu4sl IEMc6e/6i3TCRry5HzMxRPZG5Yz4o0O1h/Z9mmoySQmMc+548hAhUNnVeo7GUlcA8rwSLiB /1pahPw7UKJRAwfKkR52w== X-UI-Out-Filterresults: notjunk:1;V03:K0:TTbMvTFHlpw=:bFA/tWPdfACV1Q6wDLzE9x p61+F/hH0Ko9gy3wQKwZ+ofBvsc0hLTsTTUItzFjDwnH20NA/jwUK/6ePMydP9ReBG5B+Depp iDRbsKlA5iU6qv83WsrzVj+LoNup92lMliKXvY43YD5jCauKK5IhfpvjCoB/8tI4NimYwSJ/b bSERTNRqwaTNHfPjcArzIx8NWuD6FYH31DqHyZ10pVCo+gO9y9IYAms4HA2+8AKN169cCBoSS Otw9+A2afiJ/ZRUmmHtx79XO2Nn5w7uEs6Akg1IqXn22PFo+26xWixTI9ZSPNtMcLuNffsVdK GWF5b4s6noVE3YA0HzNB3/ln4epFBcHitLsAdXp8QiZF8Q+O/DUbDxo9JNJcju7/ih44MHNOV n4vrKAnBRdkeponJ2TAcpAa+/kwH8bdy7fXLANq4QFwM2tZOESHm5MsZBHZ3Tsq36HEJ46ad9 AfeLExKFFMDJpwpSbAb6NzAp09szsS5YHSvv8PxawkwlJmbUo3ZLwS0HU6hKp5WyTyciwzGNP af1ZF8NxDRxCpp/eqyJs6bCRHhC1kEDmFAgykd/9QlRzKAgMPoTD84hxO/NCTVPITTkt9CzpN FYIqjsmBUaVcqwwcDk5DC0x9faKwf87QHECL1yuox7OVBARZe2eDvyL4lQbLSPbZag+waDLQ5 FHgJYlcZ7W63tIg7usauDr9sdYLbC/IB3fUtyZ1cSr3OU7lvWot9+YGq1Bz001tGu92fm1TaR CtCr3xwTe63AK91S2HZsifCXSkOjEtI8jgojGMltvf/I78WWMwVNnWS0csb3xFsMhOGoarCE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.20 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240875 Archived-At: > After thinking about your suggestion, I start to believe my experiment= > isn=E2=80=99t the best approach (to solve the problem you mentioned ab= ove and > the problem I mentioned about gdb-mi). For your problem, since there a= re > tmp buffers that are not in any window, window.el clearly isn=E2=80=99= t the > right place to handle them. I think desktop.el should handle them. If I'm not mistaken, there are occasions where window.el is the only place to handle them. Think of a state saved somewhere during a session that contains references to dead temporary buffers. To resurrect such a state it might be nice to have a function that restores these buffers from information stored by 'window-state-get' or at least do something reasonable (whatever that is). > What=E2=80=99s more, above thought process reminded me that window-sta= te-get/put > should probably stay away from buffer manipulation. And I think I can > achieve what I want to do without modifying window-state-get/put. To > recap, I want to save the window configuration and the type of the > function (register, breakpoint, etc) of each window, so that I can > restore that buffer later. I can do this: Before calling the state-get= , > I go through each window and replace the buffers in them with > placeholder buffers I suppose that, as a rule, placeholder buffers never get killed. Right? > and store the buffer type (breakpoint, register, > etc) in a window parameter. When later I restored the window > configuration, I go through each window and restore each buffer by the= > window parameter I saved. Fine. But, I still think that a solution built into the window state functions would be more profitable. And if it's an empty buffer name advising 'window-state-put' to look up the associated window's parameter list for instrcutions on how to populate that window. martin