From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Window configuration UI (was: Neat features in Eclipse editor) Date: Mon, 24 Mar 2008 23:53:45 -0400 Message-ID: References: <873aqia0eh.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206417260 22230 80.91.229.12 (25 Mar 2008 03:54:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2008 03:54:20 +0000 (UTC) Cc: pmr@pajato.com, cyd@stupidchicken.com, paul r , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 25 04:54:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Je0FD-0000w2-73 for ged-emacs-devel@m.gmane.org; Tue, 25 Mar 2008 04:54:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Je0Ec-0002Lk-3m for ged-emacs-devel@m.gmane.org; Mon, 24 Mar 2008 23:54:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Je0EW-0002Hy-M8 for emacs-devel@gnu.org; Mon, 24 Mar 2008 23:53:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Je0EV-0002GK-JY for emacs-devel@gnu.org; Mon, 24 Mar 2008 23:53:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Je0EV-0002G4-8n for emacs-devel@gnu.org; Mon, 24 Mar 2008 23:53:55 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182] helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Je0EQ-0000Wq-19; Mon, 24 Mar 2008 23:53:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIEADcU6EdMCrTo/2dsb2JhbACBWqcF X-IronPort-AV: E=Sophos;i="4.25,550,1199682000"; d="scan'208";a="16577236" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 24 Mar 2008 23:53:46 -0400 Original-Received: from pastel.home ([76.10.180.232]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id FGA39846; Mon, 24 Mar 2008 23:53:46 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id F0B838069; Mon, 24 Mar 2008 23:53:45 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Mon, 24 Mar 2008 21:50:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93387 Archived-At: > 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 "")) 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)))