all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* switch-to-buffer-other-window to split vertically by default ?
@ 2006-06-08 23:44 Bastien
  2006-06-09  9:15 ` Romain Francoise
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2006-06-08 23:44 UTC (permalink / raw)


Hi,

everything is in the subject line: i would like
`switch-to-buffer-other-window' to split the window 
*vertically* when no other window is open.

Any hint ?

-- 
Bastien

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

* Re: switch-to-buffer-other-window to split vertically by default ?
  2006-06-08 23:44 switch-to-buffer-other-window to split vertically by default ? Bastien
@ 2006-06-09  9:15 ` Romain Francoise
  2006-06-09  9:43   ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Romain Francoise @ 2006-06-09  9:15 UTC (permalink / raw)


Bastien <bzgNOSPAM@altern.org> writes:

> everything is in the subject line: i would like
> `switch-to-buffer-other-window' to split the window *vertically* when
> no other window is open.

It's not possible at the moment with a vanilla Emacs, the function that
splits the window (`display-buffer') is in the C code and isn't easily
customizable.  This will change after the 22.1 release.

However, if you use Debian's emacs-snapshot version, the following will
do the trick:

(defadvice switch-to-buffer-other-window (around change-split activate)
  (let ((display-buffer-prefer-horizontal-split t))
    ad-do-it))

-- 
Romain Francoise <romain@orebokech.com> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter

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

* Re: switch-to-buffer-other-window to split vertically by default ?
  2006-06-09  9:15 ` Romain Francoise
@ 2006-06-09  9:43   ` Bastien
  2006-06-09  9:53     ` Romain Francoise
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2006-06-09  9:43 UTC (permalink / raw)


Romain Francoise <romain@orebokech.com> writes:

> It's not possible at the moment with a vanilla Emacs, the function that
> splits the window (`display-buffer') is in the C code and isn't easily
> customizable.  This will change after the 22.1 release.

All right, thanks.

> However, if you use Debian's emacs-snapshot version, the following will
> do the trick:
>
> (defadvice switch-to-buffer-other-window (around change-split activate)
>   (let ((display-buffer-prefer-horizontal-split t))
>     ad-do-it))

I use Debian's emacs-snapshot but it doesn't work for me, even with
`display-buffer-prefer-horizontal-split' set to nil (wich seems more
appropriate). 

I can't find any reference to `display-buffer-prefer-horizontal-split'
nor `display-buffer-prefer-vertical-split' with C-h v.

Note that I tried to activate the advice with 

(ad-activate 'switch-to-buffer-other-window)

-- 
bastien

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

* Re: switch-to-buffer-other-window to split vertically by default ?
  2006-06-09  9:43   ` Bastien
@ 2006-06-09  9:53     ` Romain Francoise
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Francoise @ 2006-06-09  9:53 UTC (permalink / raw)


Bastien <bzgNOSPAM@altern.org> writes:

> `display-buffer-prefer-horizontal-split' set to nil (wich seems more
> appropriate).

C-x 2 runs the command split-window-vertically
                                    ^^^^^^^^^^
C-x 3 runs the command split-window-horizontally
                                    ^^^^^^^^^^^^

> I can't find any reference to `display-buffer-prefer-horizontal-split'
> nor `display-buffer-prefer-vertical-split' with C-h v.

Which version are you using?

(Feel free to take this to private email if you like.)

-- 
Romain Francoise <romain@orebokech.com> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter

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

* Re: switch-to-buffer-other-window to split vertically by default ?
@ 2006-06-09 13:28 martin rudalics
  0 siblings, 0 replies; 6+ messages in thread
From: martin rudalics @ 2006-06-09 13:28 UTC (permalink / raw)
  Cc: help-gnu-emacs

With complete disregard for frames:

(defun my-display-buffer (buffer &optional not-this-window frame)
   (if (one-window-p)
       (let ((window (split-window-horizontally)))
	(set-window-buffer window buffer)
	window)
     (let (display-buffer-function)
       (display-buffer buffer not-this-window frame))))

(setq display-buffer-function 'my-display-buffer)

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

* Re: switch-to-buffer-other-window to split vertically by default ?
       [not found] <mailman.2797.1149859770.9609.help-gnu-emacs@gnu.org>
@ 2006-06-09 16:32 ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2006-06-09 16:32 UTC (permalink / raw)


martin rudalics <rudalics@gmx.at> writes:

> With complete disregard for frames:
>
> (defun my-display-buffer (buffer &optional not-this-window frame)

Works great - thanks !

-- 
Bastien

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

end of thread, other threads:[~2006-06-09 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 23:44 switch-to-buffer-other-window to split vertically by default ? Bastien
2006-06-09  9:15 ` Romain Francoise
2006-06-09  9:43   ` Bastien
2006-06-09  9:53     ` Romain Francoise
  -- strict thread matches above, loose matches on Subject: below --
2006-06-09 13:28 martin rudalics
     [not found] <mailman.2797.1149859770.9609.help-gnu-emacs@gnu.org>
2006-06-09 16:32 ` Bastien

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.