From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Klaus Berndl Newsgroups: gmane.emacs.help Subject: How to best use the display-buffer-function? Date: 05 Feb 2004 08:50:10 +0100 Organization: "sd&m AG, Muenchen, Germany" Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1075968217 31657 80.91.224.253 (5 Feb 2004 08:03:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2004 08:03:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 05 09:03:30 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AoeTx-0003Ky-01 for ; Thu, 05 Feb 2004 09:03:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AoeTi-00084M-6S for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Feb 2004 03:03:14 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!news.sdm.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: sachrang.muc.sdm.de Original-X-Trace: news.sdm.de 1075967410 15834 193.102.181.40 (5 Feb 2004 07:50:10 GMT) Original-X-Complaints-To: usenet@news.sdm.de Original-NNTP-Posting-Date: Thu, 5 Feb 2004 07:50:10 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:120707 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16654 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16654 Suppose i want to some checks before `display-buffer'. If the checks are true then i always want to display the buffer in a special window at my frame, if the checks fail i want to proceed with standard display-buffer, i.e. `display-buffer' should choose the window according to all its rules. Currently i have something like (simplified): (defun my-display-buffer-function (buffer not-this-window) (if (my-pre-checks) ;; then display the BUFFER in a special window at the frame (my-display-buffer-in-special-window buffer) ;; otherwise delegate the buffer-display to the original `display-buffer' (let ((display-buffer-function nil)) (display-buffer buffer not-this-window)))) (setq display-buffer-function my-display-buffer-function) Is this a good way to do this? Another question: Why a display-buffer-function gets only two args and not three like the `display-buffer'? Thanks for comments, hints and help, Klaus -- Klaus Berndl mailto: klaus.berndl@sdm.de sd&m AG http://www.sdm.de software design & management Carl-Wery-Str. 42, 81739 Muenchen, Germany Tel +49 89 63812-392, Fax -220