From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: moving window handling into lisp Date: Mon, 27 Jul 2009 23:00:53 +0900 Message-ID: <87tz0yb4yy.fsf@catnip.gol.com> References: <4A6DAD94.8040006@gmx.at> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248703824 31945 80.91.229.12 (27 Jul 2009 14:10:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jul 2009 14:10:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 27 16:10:17 2009 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 1MVQu9-0002YU-4Q for ged-emacs-devel@m.gmane.org; Mon, 27 Jul 2009 16:10:17 +0200 Original-Received: from localhost ([127.0.0.1]:56100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVQu8-0000Bd-DN for ged-emacs-devel@m.gmane.org; Mon, 27 Jul 2009 10:10:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVQlI-0004dF-Bb for emacs-devel@gnu.org; Mon, 27 Jul 2009 10:01:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVQlC-0004Zh-TT for emacs-devel@gnu.org; Mon, 27 Jul 2009 10:01:07 -0400 Original-Received: from [199.232.76.173] (port=35585 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVQlC-0004ZN-IA for emacs-devel@gnu.org; Mon, 27 Jul 2009 10:01:02 -0400 Original-Received: from smtp12.dentaku.gol.com ([203.216.5.74]:55280) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVQl7-0005bb-GK; Mon, 27 Jul 2009 10:00:58 -0400 Original-Received: from 218.231.109.150.eo.eaccess.ne.jp ([218.231.109.150] helo=catnip.gol.com) by smtp12.dentaku.gol.com with esmtpa (Dentaku) id 1MVQl4-0000E7-3b; Mon, 27 Jul 2009 23:00:54 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 44B3C2BD7B; Mon, 27 Jul 2009 23:00:53 +0900 (JST) System-Type: x86_64-unknown-linux-gnu In-Reply-To: <4A6DAD94.8040006@gmx.at> (martin rudalics's message of "Mon, 27 Jul 2009 15:37:24 +0200") Original-Lines: 42 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:113218 Archived-At: martin rudalics writes: >> window-parent WINDOW => PARENT-WIN >> set-window-children WINDOW LEFT-CHILD-WIN RIGHT-CHILD-WIN > > `window-parent' and `window-children' would be trivial. Providing > `set-window-children' is hardly feasible IMHO. Who'd be responsible for > calculating the respective sizes? Currently split-window does, and that doesn't seem particularly complicated. Certainly set-window-children has to do a fair bit of sanity checking, but it's not going to be any greater than that currently done by split-window, and that function isn't all that complicated. >> A brief look suggests that much of the traditional window handling >> code (`window-list', `other-window', `split-window', `delete-window', >> `delete-other-windows', etc) could then be moved into lisp; none of >> that code looks very complicated or dangerous. > > The problem with `split-window' and `delete-window' is that you can > easily mess up things when you create windows that don't have the right > size. From my experience this usually makes Emacs crash pretty soon and > we shouldn't allow Elisp code crash Emacs. OTOH doing all the necessary > checks wrt window sizes in `set-window-children' would mean hard work. Hmm, I dunno why it's hard -- just copy the appropriate bits from split-window. Maybe set-window-children would end up being mostly sanity-checking code, but that's OK -- it'll probably be smaller than split-window, and will serve as a nice low-level interface. > martin, whose `switch-to-buffer' is in window.el Wait... switch-to-buffer is in C... -Miles -- Generous, adj. Originally this word meant noble by birth and was rightly applied to a great multitude of persons. It now means noble by nature and is taking a bit of a rest.