From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: pop-up-windows value to force a new window Date: Tue, 5 Sep 2006 14:33:38 -0700 Message-ID: References: <33742.128.165.123.18.1157486375.squirrel@webmail.lanl.gov> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1157492057 3842 80.91.229.2 (5 Sep 2006 21:34:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2006 21:34:17 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 05 23:34:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKiYa-0003qe-MZ for ged-emacs-devel@m.gmane.org; Tue, 05 Sep 2006 23:34:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKiYa-0004iY-1M for ged-emacs-devel@m.gmane.org; Tue, 05 Sep 2006 17:34:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GKiYN-0004cY-1k for emacs-devel@gnu.org; Tue, 05 Sep 2006 17:33:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GKiYL-0004XF-Eq for emacs-devel@gnu.org; Tue, 05 Sep 2006 17:33:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKiYL-0004Wu-69 for emacs-devel@gnu.org; Tue, 05 Sep 2006 17:33:53 -0400 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1GKiYL-0006L6-D9 for emacs-devel@gnu.org; Tue, 05 Sep 2006 17:33:53 -0400 Original-Received: from rgmsgw02.us.oracle.com (rgmsgw02.us.oracle.com [138.1.186.52]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k85LXpYR024083 for ; Tue, 5 Sep 2006 16:33:51 -0500 Original-Received: from dradamslap (dhcp-amer-csvpn-gw2-141-144-74-150.vpn.oracle.com [141.144.74.150]) by rgmsgw02.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k85LXoqH030154 for ; Tue, 5 Sep 2006 15:33:50 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <33742.128.165.123.18.1157486375.squirrel@webmail.lanl.gov> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59396 Archived-At: > I don't see a good way to force `display-buffer' and related > functions to always use another window, even when there is > more than one window displayed currently. Is there some way > (besides defining `display-buffer-function' > in such a way that it does this)? First, you need to define what "always use another window" means. What if the current frame is divided into so many windows (or is itself so small) that no splitting can occur because of the minimum window size variables? What if the current frame is unsplittable (where you shouldn't split it automatically), or worse is a minibuffer-only frame that you -can't- split? Yes, of course. Before heading down the highway, corner cases would need to be dealt with. > This would let Lisp code, for example, bind to that value, and be sure > that > `display-buffer' etc. will always create a new window. Subsequently > deleting > that window will not leave fewer windows than before the display. IOW, > this > would let you use `display-buffer' to always pop up an extra window. If you want to "not leave fewer windows", what you probably want is to restore the window configuration. If that's what you want, just do it: use `current-window-configuration' and `set-window-configuration'. (There are a few other useful related functions which can be found with Apropos.) If it interests, I have written a small "temporary window configurations" package which aims to automate that process. I don't really recall what I was trying to do. I believe that I started with `with-output-to-temp-buffer', and I wanted to have it always open a new window, so deleting that window would not reduce the original config. IIRC, I tried to use `save-window-configuration' with it, but things didn't proceed as I wanted. I don't remember the details, and I don't have time now to look into it.