From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Window configurations (was: Gtk tabs in emacs, new branch) Date: Sun, 25 Apr 2010 21:33:17 +0300 Organization: JURTA Message-ID: <87zl0rtmqy.fsf@mail.jurta.org> References: <4BB4CF6B.2000007@alice.it> <4BB9A469.6050608@alice.it> <4BC072C3.2080302@swipnet.se> <4BC0B692.2000702@alice.it> <4BC0BD6D.3060103@swipnet.se> <4BC0F715.2060605@alice.it> <45EB8DD4-B0F8-4FB3-941F-13FADA4DAD66@swipnet.se> <4BC1854B.2060409@alice.it> <4BC1A9D2.8050607@swipnet.se> <4BC206C0.2010202@alice.it> <87fx2pdvfq.fsf@mail.jurta.org> <87y6gg95ad.fsf@mail.jurta.org> <750140A47B7D4FBD93371813D65478F8@us.oracle.com> <87eii63v4j.fsf@mail.jurta.org> <0840B3F4D9E84706874EDD2CA2CC4236@us.oracle.com> <87vdbhgqgd.fsf@mail.jurta.org> <828BB36311A84C43B96D1F2A559DACAE@us.oracle.com> <87d3xo662u.fsf@mail.jurta.org> <69D40D69CC6F4982A8E91D8D8F0F494F@us.oracle.com> <87r5m4hz39.fsf@mail.jurta.org> <4BD40821.70808@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272220807 12268 80.91.229.12 (25 Apr 2010 18:40:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Apr 2010 18:40:07 +0000 (UTC) Cc: 'Emacs' To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 25 20:40:06 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O66kA-00035g-OW for ged-emacs-devel@m.gmane.org; Sun, 25 Apr 2010 20:39:51 +0200 Original-Received: from localhost ([127.0.0.1]:55939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O66k9-0004Ey-2f for ged-emacs-devel@m.gmane.org; Sun, 25 Apr 2010 14:39:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O66k4-0004Ee-1L for emacs-devel@gnu.org; Sun, 25 Apr 2010 14:39:44 -0400 Original-Received: from [140.186.70.92] (port=32844 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O66k1-0004Dn-Oj for emacs-devel@gnu.org; Sun, 25 Apr 2010 14:39:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O66jy-0000s9-Kt for emacs-devel@gnu.org; Sun, 25 Apr 2010 14:39:40 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:56904 helo=mx1.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O66jy-0000s1-AC for emacs-devel@gnu.org; Sun, 25 Apr 2010 14:39:38 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.70.99.cable.starman.ee [82.131.70.99]) by mx1.starman.ee (Postfix) with ESMTP id 7B63E3F412D; Sun, 25 Apr 2010 21:39:34 +0300 (EEST) In-Reply-To: <4BD40821.70808@gmx.at> (martin rudalics's message of "Sun, 25 Apr 2010 11:15:13 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:124201 Archived-At: >> ... Currently the design >> is at the stage of deciding what format is better to represent the >> window configuration. There are two options: a window tree and >> a plain list of windows. I am inclined to the second option >> since when saved it would be more compact. > > There's absolutely no need to make window configurations saved by > `current-window-configuration' (I call them CWCs here) and window > configurations saved for later reconstruction in a possibly different > session (called EWCs) save the same states of things. Yes. That's why I added a new argument `live-p' to `current-window-configuration-to-sexp'. When non-nil, it adds live data (window objects, buffer objects, markers, etc.) that are necessary when its Lisp expression will be used in the same session. When nil, it returns bare minimum necessary to save and restore in another session. > EWCs should IMHO strip window configurations to the absolutely needed > bare minimum. In particular `orig-top-line' and `orig-total-lines' do > more harm than good in EWCs (BTW, I've completely done away with these > in my rewrite of window.c) Do you plan to create a branch for your rewrite of window.c? It would be very interesting to look at it. > Coordinates should probably be rather stored as fractions instead of > absolute lines and columns. This would make it easier to (1) eventually > switch to pixel based coordinates and (2) put an EWC into an Emacs > window (that is, put an Emacs frame into an Emacs window) as some IDE > advocats mentioned earlier. There are no problems with storing coordinates as absolute lines and columns. After restoring absolute coordinates `set-window-configuration' resizes the frame thus keeping original relative sizes unchanged. > Since I suppose you're running `split-window' to restore configurations > you'd probably also want to remember whether a "split" was a vertical or > a horizontal one in EWCs. Note that CWCs don't do this since they need > to restore the configuration from the stored "coordinates" anyway, but > the design is a bit awkward as code like > > if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) > > in `set-window-configuration' shows. No, I don't use `split-window'. I use exactly the same algorithm as in `set-window-configuration', and additionally make new windows. In my tests, this works correctly. > That said, the *entire* coordinate information of a particular window in > an EWC would consist of (1) whether it is a horizontal or a vertical > combination and (2) the proportional space - either a float or the > fraction of "some largest integer" - occupied by the window wrt to its > parent window. Currently `set-window-configuration-from-sexp' works without these parameters. But maybe they would be useful for user-defined window configurations. > BTW in the earlier example structure you posted here I'm missing entries > for window-point, window-start, ... Was that intentional? There are entries `pointm' and `start' in the output of of the really working function `current-window-configuration-to-sexp'. But the example of the output of `window-configuration-to-sexp' is for demonstration purposes only. It doesn't work yet, because I'm not sure yet whether it's better than `current-window-configuration-to-sexp'. -- Juri Linkov http://www.jurta.org/emacs/