all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Dedicated window troubles
@ 2015-02-19 10:06 Tassilo Horn
  2015-02-19 12:35 ` Alexis
  0 siblings, 1 reply; 4+ messages in thread
From: Tassilo Horn @ 2015-02-19 10:06 UTC (permalink / raw
  To: help-gnu-emacs

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 <dedicated>                |
+------------------------------+---------------------------------+

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-19 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-19 10:06 Dedicated window troubles Tassilo Horn
2015-02-19 12:35 ` Alexis
2015-02-19 13:26   ` Tassilo Horn
2015-02-19 13:32     ` Tassilo Horn

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.