From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: display-buffer-alist simplifications Date: Sun, 07 Aug 2011 21:12:47 +0300 Organization: JURTA Message-ID: <877h6pytdw.fsf@mail.jurta.org> References: <87mxgem09k.fsf@stupidchicken.com> <4E2A7EBD.7050300@gmx.at> <87livooqt6.fsf@stupidchicken.com> <4E2B158B.1080101@gmx.at> <87wrf8iyse.fsf@stupidchicken.com> <4E2BEED2.5040608@gmx.at> <8739hvu6lh.fsf@stupidchicken.com> <4E2C50E6.3020103@gmx.at> <878vrnweju.fsf@stupidchicken.com> <4E2D34D7.4040002@gmx.at> <87r55cjvef.fsf@stupidchicken.com> <87sjpsnerd.fsf@mail.jurta.org> <4E355D2C.40709@gmx.at> <87k4axzg7j.fsf@mail.jurta.org> <87oc092gy0.fsf@stupidchicken.com> <4E380897.5000406@gmx.at> <871ux2nsrw.fsf@stupidchicken.com> <4E3AA5DA.8030403@gmx.at> <87mxfnn414.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312741719 2962 80.91.229.12 (7 Aug 2011 18:28:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 7 Aug 2011 18:28:39 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 07 20:28:35 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qq85T-0001qc-0v for ged-emacs-devel@m.gmane.org; Sun, 07 Aug 2011 20:28:35 +0200 Original-Received: from localhost ([::1]:40912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq85S-0006Xh-Fe for ged-emacs-devel@m.gmane.org; Sun, 07 Aug 2011 14:28:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq85O-0006IG-0H for emacs-devel@gnu.org; Sun, 07 Aug 2011 14:28:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qq85N-000100-1h for emacs-devel@gnu.org; Sun, 07 Aug 2011 14:28:29 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:41684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq85M-0000zh-TQ for emacs-devel@gnu.org; Sun, 07 Aug 2011 14:28:29 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id A36E06E8074; Sun, 7 Aug 2011 11:28:26 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 46FA2451C247; Sun, 7 Aug 2011 11:28:25 -0700 (PDT) In-Reply-To: <87mxfnn414.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 05 Aug 2011 13:48:07 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.113.175.8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142968 Archived-At: > (setq display-buffer-fallback-alist > '("\\*\\(shell\\|unsent mail\\|mail\\|inferior-lisp\\|ielm\\)\\*" > (display-buffer-method reuse-window same-frame) > (reuse-window-window same))) > > Just to be sure we are one the same page, here is how I imagine the > system would work: > > - "Display specifiers" are cons cells (VAR . VALUE). For example, > (reuse-window-window other) means that when Emacs is trying to reuse > a window, it must use a window other than the selected one. > > - `display-buffer-method' is a special display specifier. Its VALUE is > a list of "display-methods", one of `reuse-window', `pop-up-window', > etc., or a "macro specifier" (any symbol except the reserved symbols > `reuse-window' etc). Adding `display-buffer-method' in the same common format (VAR . VALUES) to specify priorities of methods is a nice way to simplify the current complex merging behavior of `display-buffer-alist'. > (I'll use the word "macro" for now, but we might want to pick another > word since "macro" can be confused with keyboard macros.) Why do we need "macro specifiers" at all? With a well-designed list of possible specifiers and values for (VAR . VALUE), "macro specifiers" should be unnecessary. Another reason to doubt their usefulness is that they can't help to define such complex specifiers like `near-minibuffer'. So if the user doesn't like how a hard-coded specifier behaves, then the user could override its default behavior with other parameters (VAR . VALUE), and finally when this turns out to be impossible to do, then write own function and specify it's name in `display-buffer-alist'. > - `display-buffer-alist' is an alist that maps a matcher (regexp, > label, or matcher function) to an alist of display specifiers. > > - `display-buffer-fallback-alist' is an alist of display specifiers. Perhaps a better name is `display-buffer-default-alist'.