all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Yuan Fu <casouri@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Customize ‘window-state-get/put’
Date: Thu, 10 Oct 2019 01:31:47 +0300	[thread overview]
Message-ID: <87lfttbo70.fsf@mail.linkov.net> (raw)
In-Reply-To: <m21rvow0um.fsf@gmail.com> (Yuan Fu's message of "Mon, 07 Oct 2019 20:13:37 -0400")

>> Not too long ago we discussed an idea of defining a “window layout” -
>> a data structure similar to the returned by ‘window-state-get’, but
>> where instead of buffer names there are buffer regexps, so when
>> ‘display-buffer’ needs to display a buffer, it consults 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 ‘window-state-get’ could 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’t find it on emacs-devel archive with keywords like ”window
> layout” or ”window-state-get”.

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 build
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.



  reply	other threads:[~2019-10-09 22:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 16:19 Customize ‘window-state-get/put’ Yuan Fu
2019-10-07 22:01 ` Juri Linkov
2019-10-08  0:13   ` Yuan Fu
2019-10-09 22:31     ` Juri Linkov [this message]
2019-10-10  0:35       ` Yuan Fu
2019-10-10 21:54         ` Juri Linkov
2019-10-11  1:38           ` Yuan Fu
2019-10-11  8:18             ` martin rudalics
2019-10-12 16:25               ` Yuan Fu
2019-10-13  8:17                 ` martin rudalics
2019-10-12 20:58             ` Juri Linkov
2019-10-14  3:39               ` Yuan Fu
2019-10-15 18:14                 ` Juri Linkov
2019-10-08  8:05   ` Eli Zaretskii
2019-10-08  8:45 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfttbo70.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.