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: Tue, 08 Oct 2019 01:01:14 +0300	[thread overview]
Message-ID: <87sgo4kyfp.fsf@mail.linkov.net> (raw)
In-Reply-To: <m24l0kwmtf.fsf@gmail.com> (Yuan Fu's message of "Mon, 07 Oct 2019 12:19:08 -0400")

> I’m adding the ability to store and restore window configuration for
> gdb-mi. To make it work for gdb-mi I need to change what
> ‘window-state-get’ save - now it saves buffers and I need to not save
> buffers. That’s because the buffer names for each window will change
> across gdb sessions debugging different programs. Instead of buffer
> name I need to store a symbol representing the ”buffer type” of the
> window. E.g., register, memory, breakpoint, etc.
>
> So instead of
>
>     (buffer "*scratch*"
>               (selected . t)
>               (hscroll . 0)
>               (fringes 8 8 nil)
>               (margins nil)
>               (scroll-bars nil 0 t nil 0 t)
>               (vscroll . 0)
>               (dedicated)
>               (point . #<marker at 193 in *scratch*>)
>               (start . #<marker at 1 in *scratch*>))
>
> I would store something like
>
>     (buffer 'register)
>
> I would just add an optional argument that handles the extraction of
> buffer information and another to restore a buffer from that
> information. Does it sound like a good idea?

Is this needed because of such dynamically generated buffer names?

  (defun gdb-memory-buffer-name ()
    (concat "*memory of " (gdb-get-target-string) "*"))

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.

BTW, while you are working on gdb-mi, you could also try to replace
the ad-hoc tabs implemented in the header-line, with real tabs in
the tab-line for “Locals”, “Registers”, “Breakpoints”, “Threads”, etc.
Just display these buffers in their dedicated window, and the tab-line
will show them as tabs.



  reply	other threads:[~2019-10-07 22:01 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 [this message]
2019-10-08  0:13   ` Yuan Fu
2019-10-09 22:31     ` Juri Linkov
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=87sgo4kyfp.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.