emacs-devel
[Top][All Lists]
Advanced

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

Re: Window configurations


From: Juri Linkov
Subject: Re: Window configurations
Date: Sun, 02 May 2010 23:28:09 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> Could we add as an extra `buffer-file-name' alist element in the sexp
> of a window-configuration or is that a bad idea? (I was just tring to
> reconstruct a window-configuration after an emacs reboot but quickly
> found out filenames weren't just there.)

I think that information about file names is redundant.

To restore file buffers in windows of the saved window configuration,
you can prepare buffers (open files, call packages that create special
buffers, etc.), keep their buffer objects and use them later during
restoring the saved window configuration.  For instance,

(setq buffer1 (find-file-noselect "file1.txt"))
(setq buffer2 (find-file-noselect "file2.txt"))

(set-window-configuration-from-list
  '(window-configuration
     (frame-cols . 80)
     (frame-lines . 41)
     (window
       (buffer . buffer1)
       (left-col . 0)
       (top-line . 5)
       (total-cols . 86)
       (total-lines . 35)
       ...)
     (window
       (buffer . buffer2)
       (left-col . 0)
       (top-line . 5)
       (total-cols . 86)
       (total-lines . 35)
       ...)))

This is basically what desktop.el does: it restores buffers, and later
it can restore window configurations using restored buffer names.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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