From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: list-buffers - winwod-height Date: Tue, 04 Apr 2006 10:38:45 -0600 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1144168842 7973 80.91.229.2 (4 Apr 2006 16:40:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Apr 2006 16:40:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 04 18:40:40 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FQoZu-0000FE-DZ for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Apr 2006 18:40:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FQoZt-0000wG-Sl for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Apr 2006 12:40:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FQoZh-0000uf-T7 for help-gnu-emacs@gnu.org; Tue, 04 Apr 2006 12:40:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FQoZg-0000u0-4P for help-gnu-emacs@gnu.org; Tue, 04 Apr 2006 12:40:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FQoZg-0000tk-0T for help-gnu-emacs@gnu.org; Tue, 04 Apr 2006 12:40:12 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FQocz-0005Kt-WE for help-gnu-emacs@gnu.org; Tue, 04 Apr 2006 12:43:38 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FQoZN-00008U-QB for help-gnu-emacs@gnu.org; Tue, 04 Apr 2006 18:39:53 +0200 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Apr 2006 18:39:53 +0200 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Apr 2006 18:39:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:34157 Archived-At: Katsumi Yamaoka wrote: >>>>>>In 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