help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Horizontal split in display-buffer?


From: John McCabe
Subject: Re: Horizontal split in display-buffer?
Date: Thu, 12 Jun 2003 11:09:58 +0000 (UTC)

On Thu, 12 Jun 2003 02:20:28 -0700, Chris Stork
<address@hidden> wrote:

>I use emacs with wide frames that easily fit two windows next to each 
>other.  Often Emacs (version 21.3) destroys this this horizontal split, 
>eg when I type `2' over a buffer in buffer-list.  The documentation 
>hints at display-buffer.
>
>Is it possible to make display-buffer split the frame horizontally 
>instad of vertically if the frame width is greater than, say, 160 columns?
>
>(BTW, in which file is display-buffer defined?)
>
>Thanks for your help, I appreciate it,

display-buffer is a built-in function so it's implemented
[effectively] in the emacs binary rather than in any of the .el files.

As far as I can see, if you execute C-x 3, you get side-by-side
windows. If you then C-x C-b to List all buffers, typing C-h k 2 shows
that the 2 key executes Buffer-menu-2-window in buff-menu.el.

(defun Buffer-menu-2-window ()
  "Select this line's buffer, with previous buffer in second window."
  (interactive)
  (let ((buff (Buffer-menu-buffer t))
        (menu (current-buffer))
        (pop-up-windows t))
    (delete-other-windows)
    (switch-to-buffer (other-buffer))
    (pop-to-buffer buff)
    (bury-buffer menu)))

As far as I can see, pop-up-windows does something to control the
behaviour of display-buffer but my guess is that there isn't anything
you can customise in this case to prevent it doing what it's doing. It
may be worth creating your own version of Buffer-menu-2-window and
binding the keystroke to it to see what you can manage.

Best of luck.


Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]