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

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

Re: list-buffers - winwod-height


From: Kevin Rodgers
Subject: Re: list-buffers - winwod-height
Date: Wed, 05 Apr 2006 09:15:01 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Rares Vernica wrote:
I guess I can extend this to other secondary buffers, like *Help* or *Python Output*.

Is there a way to uniformly specify the default height of a secondary buffer like these?

The best way is to display them in their own frame as Katsumi suggested.

For uniformity, put only the buffer names in special-display-buffer-names,
and put the frame parameters in special-display-frame-alist.

Kevin Rodgers wrote:

Katsumi Yamaoka wrote:

In <address@hidden> Rares Vernica wrote:



How can I set the default height of the list-buffers window?



There seems to be no way other than using your own command.
How about this?

--8<---------------cut here---------------start------------->8---
(setq my-list-buffers-window-height 16)

(defun my-list-buffers (&optional files-only)
  (interactive "P")
  (let ((buffer (list-buffers-noselect files-only)))
    (display-buffer buffer)
    (enlarge-window (max (- (window-height (get-buffer-window buffer))
                my-list-buffers-window-height)
             (- window-min-height (window-height))))))

(substitute-key-definition 'list-buffers 'my-list-buffers global-map)
--8<---------------cut here---------------end--------------->8---

Otherwise, you can use the `special-display-buffer-names'
variable if you'd like to pop up a frame.  For example:

(add-to-list 'special-display-buffer-names
         '("*Buffer List*" (height . 16) (width . 80)))


Here's another way to implement that:

(defvar list-buffers-window-height 16)

(defadvice list-buffers (after window-height activate)
"Make the *Buffer List* window `list-buffers-window-height' lines high."
  (when (interactive-p)
(enlarge-window (max (- (window-height (get-buffer-window "*Buffer List*"))
                list-buffers-window-height)
             (- window-min-height (window-height))))))




--
Kevin Rodgers





reply via email to

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