emacs-devel
[Top][All Lists]
Advanced

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

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


From: martin rudalics
Subject: Re: Customize ‘window-state-get/put’
Date: Fri, 11 Oct 2019 10:18:13 +0200

> After thinking about your suggestion, I start to believe my experiment
> isn’t the best approach (to solve the problem you mentioned above and
> the problem I mentioned about gdb-mi). For your problem, since there are
> tmp buffers that are not in any window, window.el clearly isn’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’s more, above thought process reminded me that window-state-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




reply via email to

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