emacs-devel
[Top][All Lists]
Advanced

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

Window configuration UI (was: Neat features in Eclipse editor)


From: Stefan Monnier
Subject: Window configuration UI (was: Neat features in Eclipse editor)
Date: Mon, 24 Mar 2008 23:53:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> When you switch from workspace A to workspace B, does your current
> window configuration get recorded as workspace A?
> That is an important aspect of Eclipse perspectives.

Indeed.  Try out my naive attempt at it (see attached) immediately bumps
into a significant problem: window-configurations are frame-specific, so
I can't create a winconf "test1" in a frame and then use it in
another frame.

> needs to be possible to get all the right behavior.  For instance, we
> want GUD to be able to take advantage of this, with a predefined "gud"
> perspective.  This predefined "gud" perspective should have a window

This is another problem: window-configurations can't be saved&loaded.
I.e. the tool we need is not `window-configuration' but some
other object.  We can construct it all in Elisp from window-tree, but
someone needs to write the code.


        Stefan


;; Window config management

(defvar winconf-alist nil)
(defvar winconf-hist nil)

(defun switch-to-winconf (conf-name)
  (interactive
   (let* ((oldname (frame-parameter nil 'winconf-name))
          (comp (remove (assoc oldname winconf-alist) winconf-alist)))
     (list (completing-read (format "Switch winconf from %s to: "
                                    (or oldname "<none>"))
                            comp nil (when winconf-alist 'confirm-only)
                            nil 'winconf-hist))))
  (let* ((oldname (frame-parameter nil 'winconf-name))
         (oldconf (assoc oldname winconf-alist))
         (newconf (assoc conf-name winconf-alist)))
    (when oldname
      (if oldconf
          (setcdr oldconf (current-window-configuration))
        (push (cons oldname (current-window-configuration)) winconf-alist)))
    (if newconf (set-window-configuration (cdr newconf)))
    (set-frame-parameter nil 'winconf-name conf-name)))




reply via email to

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