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: Re: split-window-preferred-function Date: Sat, 29 Mar 2008 02:45:15 +0200 Organization: JURTA Message-ID: <871w5utnac.fsf@jurta.org> References: <47E188D5.5030502@gmx.at> <87hcf1rrdj.fsf@jurta.org> <87r6e3k3hc.fsf@jurta.org> <87d4pfzt2j.fsf@jurta.org> <47ED4BF7.9060507@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206751962 5164 80.91.229.12 (29 Mar 2008 00:52:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Mar 2008 00:52:42 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 29 01:53:13 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 1JfPJp-0005tq-1f for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 01:53:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfPJD-00054A-Jn for ged-emacs-devel@m.gmane.org; Fri, 28 Mar 2008 20:52:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfPJ9-00052f-EG for emacs-devel@gnu.org; Fri, 28 Mar 2008 20:52:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfPJ8-00051j-Px for emacs-devel@gnu.org; Fri, 28 Mar 2008 20:52:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfPJ8-00051g-Mp for emacs-devel@gnu.org; Fri, 28 Mar 2008 20:52:30 -0400 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JfPJ8-0002M7-7q for emacs-devel@gnu.org; Fri, 28 Mar 2008 20:52:30 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JfPIv-0007Kp-VW; Sat, 29 Mar 2008 02:52:24 +0200 In-Reply-To: <47ED4BF7.9060507@gmx.at> (martin rudalics's message of "Fri, 28 Mar 2008 20:50:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 69470ef176344869aa12c1af2e75e870 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2516 [Mar 28 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 10 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) 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:93727 Archived-At: > Wouldn't it be nicer to use something like > > (or (get-lru-window nil nil) > ;; Try visible frames first. > (get-buffer-window (current-buffer) 'visible) > (get-largest-window 'visible) > ;; If that didn't work, try iconified frames. > (get-buffer-window (current-buffer) 0) > (get-largest-window 0) > ;; As a last resort, make a new frame. > (frame-selected-window (funcall pop-up-frame-function))) > > at the end of `split-window-preferred-horizontally'? Of course, I already noticed that this part is eligible for optimization in one `or', but I decided to try writing a close equivalent of C code in Lisp, so it would be easier to put both versions side-by-side (in horizontally split windows ;-) and compare their logics. And I wrote about this fact in the docstring as: This function tries to match the implementation of vertical splitting in `display-buffer' as close as possible but with the logic of horizontal splitting. Not a big deal, I think. -- Juri Linkov http://www.jurta.org/emacs/