From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Customize =?utf-8?Q?=E2=80=98window-state-get=2Fput=E2=80=99?= Date: Thu, 10 Oct 2019 01:31:47 +0300 Organization: LINKOV.NET Message-ID: <87lfttbo70.fsf@mail.linkov.net> References: <87sgo4kyfp.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="167391"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: Emacs developers To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 01:05:05 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 1iIL0y-000hNi-TK for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 01:05:05 +0200 Original-Received: from localhost ([::1]:60770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIL0x-0007tZ-3G for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 19:05:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32932) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIKyI-0005yu-ID for emacs-devel@gnu.org; Wed, 09 Oct 2019 19:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIKyH-0001PY-3u for emacs-devel@gnu.org; Wed, 09 Oct 2019 19:02:18 -0400 Original-Received: from crocodile.birch.relay.mailchannels.net ([23.83.209.45]:60671) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIKyG-0001Ot-Ji for emacs-devel@gnu.org; Wed, 09 Oct 2019 19:02:17 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 61A718C1F6A; Wed, 9 Oct 2019 23:02:14 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a88.g.dreamhost.com (100-96-91-110.trex.outbound.svc.cluster.local [100.96.91.110]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A22B18C0281; Wed, 9 Oct 2019 23:02:13 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a88.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 09 Oct 2019 23:02:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Imminent-Grain: 6b3452252a67404e_1570662134031_3590550203 X-MC-Loop-Signature: 1570662134031:3836614700 X-MC-Ingress-Time: 1570662134031 Original-Received: from pdx1-sub0-mail-a88.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a88.g.dreamhost.com (Postfix) with ESMTP id 62B4C8138D; Wed, 9 Oct 2019 16:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=lwatIF k4tQo82StDw6+Dhnvewc4=; b=25GZNSrAR2r+ugyODEw2NWWKHk/p4Figkvx27c imRNZQkqQB1sMPYFE3EGr4ADG/K0iF5neyFY5cxDsoCxipSLTY0f+Hq4HhLcXeth wOgVxEoOQntshnd/+bKnMa3LUN2+H2xlbwyynor71SdRGm2Yaaouzeu2o3BLjjs7 GRmks= Original-Received: from mail.jurta.org (m91-129-99-99.cust.tele2.ee [91.129.99.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a88.g.dreamhost.com (Postfix) with ESMTPSA id D092D8139E; Wed, 9 Oct 2019 16:02:06 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a88 In-Reply-To: (Yuan Fu's message of "Mon, 07 Oct 2019 20:13:37 -0400") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedriedvgddukecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucffohhmrghinhepghhnuhdrohhrghenucfkphepledurdduvdelrdelledrleelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledrleelrdelledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.209.45 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:240802 Archived-At: >> Not too long ago we discussed an idea of defining a =E2=80=9Cwindow la= yout=E2=80=9D - >> a data structure similar to the returned by =E2=80=98window-state-get=E2= =80=99, but >> where instead of buffer names there are buffer regexps, so when >> =E2=80=98display-buffer=E2=80=99 needs to display a buffer, it consult= s a predefined >> layout, finds the right window in its window tree, and displays the >> buffer in the window whose buffer regexp matches the displayed >> buffer name. A new function like =E2=80=98window-state-get=E2=80=99 c= ould generate >> a layout from the current window configuration, or even from the >> window state. Then such layout could be exported to anywhere: >> saved in the init file, in packages, etc. > > Did you reach any conclusions? What was the title of that thread? I > couldn=E2=80=99t find it on emacs-devel archive with keywords like =E2=80= =9Dwindow > layout=E2=80=9D or =E2=80=9Dwindow-state-get=E2=80=9D. I tried to find a more recent discussion but search found this: https://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00458.html But fortunately now we have window-states that are better suitable to bui= ld the feature that you are adding. So if you will have such template based on exported window-state layout: (hc (vc (leaf (buffer "\\`\\*\\(locals\\|registers\\) of .*\\*\\'")) (leaf (buffer "\\`\\*\\(breakpoints\\|threads\\) of .*\\*\\'"))) (vc (leaf (buffer "\\`\\*memory of .*\\*\\'")) (leaf (buffer "\\`\\*stack frames of .*\\*\\'")))) (window-sizes are omitted in this example, but they could be expressed as percentage of relative window dimensions) then calling (display-buffer "*memory of emacs*") could search in such window-tree, find a window that matches the buffer name and display this buffer in it. This could be implemented by just adding a new display-buffer action.