From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#1806: dired-pop-to-buffer in wrong place Date: Sun, 03 May 2009 14:46:15 +0300 Organization: JURTA Message-ID: <87ws8yquig.fsf@mail.jurta.org> References: <87r63gzcap.fsf@jurta.org> <49671922.4080609@gmx.at> <87zlhubw10.fsf@jurta.org> <496DF4B9.3080805@gmx.at> <496E5F58.7030304@gmx.at> <496F11C0.4080700@gmx.at> <87ocy8fajt.fsf@jurta.org> <4975F4D5.5030000@gmx.at> <87y6tk1j47.fsf@mail.jurta.org> <49F7FE14.8010107@gmx.at> <49F969F9.5010603@gmx.at> <49FAC921.5010201@gmx.at> <878wlfk9lm.fsf@mail.jurta.org> <87y6tfdt99.fsf@mail.jurta.org> <49FD4CD9.8060907@gmx.at> Reply-To: Juri Linkov , 1806@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1241352742 22665 80.91.229.12 (3 May 2009 12:12:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 May 2009 12:12:22 +0000 (UTC) Cc: 1806@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 03 14:12:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M0aYH-000316-IE for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2009 14:12:13 +0200 Original-Received: from localhost ([127.0.0.1]:43810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0aYG-000553-Hv for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 May 2009 08:12:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0aYC-00054y-Dq for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 08:12:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0aY8-00051g-T8 for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 08:12:08 -0400 Original-Received: from [199.232.76.173] (port=54888 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0aY8-00051d-Qh for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 08:12:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40817) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M0aY8-0000HS-C2 for bug-gnu-emacs@gnu.org; Sun, 03 May 2009 08:12:04 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n43CBq5w006463; Sun, 3 May 2009 05:12:01 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n43C0386001522; Sun, 3 May 2009 05:00:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juri Linkov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 03 May 2009 12:00:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1806 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1806-submit@emacsbugs.donarmstrong.com id=B1806.124135147232342 (code B ref 1806); Sun, 03 May 2009 12:00:03 +0000 Original-Received: (at 1806) by emacsbugs.donarmstrong.com; 3 May 2009 11:51:12 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n43Bp7fq032336 for <1806@emacsbugs.donarmstrong.com>; Sun, 3 May 2009 04:51:09 -0700 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1M0aDq-000FfD-AC; Sun, 03 May 2009 14:51:06 +0300 In-Reply-To: <49FD4CD9.8060907@gmx.at> (martin rudalics's message of "Sun, 03 May 2009 09:50:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (x86_64-pc-linux-gnu) X-Scanner-Signature: 3f6c5f504711b4b2e39067d20b60c9d6 X-DrWeb-checked: yes X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 03 May 2009 08:12:08 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27645 Archived-At: >> Wrong >> >> Wrong > > Kto-to majskij prazdnik otmechajet ;-) > > BTW, here we call a bridge day "Fenstertag" (window day) and since we > didn't have any bridge day this week it _was_ the wrong day of the wrong > week indeed ... :-) > I don't have any problems hard-coding `split-window-vertically' in > `dired-pop-to-buffer' but: > > (1) `split-window-sensibly' with `split-width-threshold' nil _should_ do > `split-window-vertically' in the first place. If it doesn't, I have > a bug somewhere and must fix that. > > (2) Someone might want `split-window-sensibly' do something special for > dired buffers. > > So please try to debug this and tell me why it doesn't split the window > vertically with a dired-window-only-frame configuration in the first > attempt. It DTRT here for me. I tried to debug this. With your latest patch it works correctly with a dired-window-only-frame configuration, but fails when there are two horizontally split side-by-side windows with a dired buffer in one of them. It displays a list of dired files at the top of another side window. split-window-sensibly has three `or' branches: 1. Split window vertically. In my case this branch is not selected because my window-height (79) is less than split-height-threshold (80). 2. Split window horizontally. This branch is not selected since dired-pop-to-buffer sets split-width-threshold to nil (this is ok). 3. If the selected window is the only window on its frame and is not the minibuffer window, try to split it vertically. This branch is not selected since the dired buffer's window is not the only window on its frame. So display-buffer displays a list of dired files in the existing side window. I see one way to fix this - it is necessary to force the first branch to be selected. It works when I tried the following lambda in dired-pop-to-buffer: (lambda () (let ((split-height-threshold 0) (split-width-threshold nil)) (with-selected-window old-window (funcall old-fun)))) Setting split-height-threshold to 0 forces the vertical splitting. Setting split-width-threshold to nil prevents the horizontal splitting when the vertical splitting is not possible (the window is not splittable). -- Juri Linkov http://www.jurta.org/emacs/