[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customize ‘window-state-get/put’

From: Juri Linkov
Subject: Re: Customize ‘window-state-get/put’
Date: Thu, 10 Oct 2019 01:31:47 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 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:

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 via email to

[Prev in Thread] Current Thread [Next in Thread]