From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Dedicated window troubles Date: Thu, 19 Feb 2015 11:06:45 +0100 Message-ID: <87lhjujjuy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424340433 25374 80.91.229.3 (19 Feb 2015 10:07:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2015 10:07:13 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 11:07:04 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YOO0e-0006rA-43 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 11:07:04 +0100 Original-Received: from localhost ([::1]:55573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOO0d-0003Qv-CB for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Feb 2015 05:07:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOO0R-0003Qh-NV for help-gnu-emacs@gnu.org; Thu, 19 Feb 2015 05:06:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOO0O-00011k-H7 for help-gnu-emacs@gnu.org; Thu, 19 Feb 2015 05:06:51 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:58455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOO0O-00010g-B1 for help-gnu-emacs@gnu.org; Thu, 19 Feb 2015 05:06:48 -0500 Original-Received: from thinkpad-t440p (dhcp159.uni-koblenz.de [141.26.71.159]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id B09F21A8436 for ; Thu, 19 Feb 2015 11:06:45 +0100 (CET) Mail-Followup-To: help-gnu-emacs X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102805 Archived-At: Hi all, I have a wide screen, so I use (setq split-width-threshold 152 split-height-threshold nil) so that Emacs favors splitting horizontally so that I end up with two side-by-side windows. That works ok, but I run into troubles when I decide to make one of the side-by-side windows dedicated to its buffer. For example, now I have a buffer for editing a latex document shown in the left window, and the right window displays the resulting PDF file and is dedicated to that buffer. +------------------------------+---------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | latex-file | PDF | +------------------------------+---------------------------------+ What I'd like to have now when doing, e.g., `C-h f defun RET' is that the left window is split vertically, and the *Help* buffer is now shown in the new, lower-left window. What actually happens is that the left window's buffer switches to *Help*. That might be reasonable but other functions exhibit even stranger behavior: (switch-to-buffer-other-window "*Help*") ;; Pops up a new *frame* (pop-to-buffer "*Help*") ;; Swiches buffer in the current window Especially that `switch-to-buffer-other-window' pops up a new frame (and I have `pop-up-frames' set to nil) is really annoying. And I'd usually expect from `pop-to-buffer' that it creates a new window if there's enough space (and here the left window is more than 80 lines tall) but it doesn't. I think the reason for that inconvenience is that by setting `split-height-threshold' to nil, I have effectively forbidden `split-window-sensibly' to perform a vertical split in case there are more than one window. Well, that's properly documented, but what configuration am I supposed to use so that Emacs prefers horizontal splits if the window to be split is wide enough and falls back to vertical splitting otherwise? Currently, the only way I see is to have my own `split-window-preferred-function' which is exactly like `split-window-sensibly' but tries horizontal splits first, then vertical splits, and then the fallback case. Then I could go with `split-width-threshold' set to 152 as its now and `split-height-threshold' set to something like 60 or so. But since wide displays are so common nowadays, there must be an easy way to achieve what I'm looking for, no? Bye, Tassilo