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: Mon, 01 Aug 2011 11:20:04 +0300 Organization: JURTA Message-ID: <87k4axzg7j.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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312188097 8509 80.91.229.12 (1 Aug 2011 08:41:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2011 08:41:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 01 10:41:34 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 1Qno42-0002LO-2V for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2011 10:41:30 +0200 Original-Received: from localhost ([::1]:56190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qno3y-0002a7-Eb for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2011 04:41:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qno3h-0001oJ-Pc for emacs-devel@gnu.org; Mon, 01 Aug 2011 04:41:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qno3g-0004z1-CS for emacs-devel@gnu.org; Mon, 01 Aug 2011 04:41:09 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:46546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qno3f-0004ye-Vr for emacs-devel@gnu.org; Mon, 01 Aug 2011 04:41:08 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 737E26E8078; Mon, 1 Aug 2011 01:41:07 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 793A1451C114; Mon, 1 Aug 2011 01:41:06 -0700 (PDT) In-Reply-To: <4E355D2C.40709@gmx.at> (martin rudalics's message of "Sun, 31 Jul 2011 15:48:28 +0200") 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:142625 Archived-At: > (:inherit > (repeat :tag "Inherit" > > in `custom-face-attributes'? If so, then this specifies inheritance > explicitly. The inheritance mechanism used by `display-buffer-alist' is > implicit. Yes, I meant exactly that. Explicit settings are easier to understand and customize for the users. > Let's consider the following example setup: > > (setq > display-buffer-alist > '((((regexp . ".*")) (pop-up-window (largest) (lru))) > (((regexp . "^\\*Help\\*$")) (pop-up-window-set-height . fit-window-to-buffer)) > (((regexp . "^\\*.+\\*$")) (pop-up-window-set-height . 20)) > (((regexp . ".*")) (pop-up-window-min-height . 15)))) This is a kind of inheritance by regexps, i.e. a set of buffer names matched by a stricter regexp is a subset of buffer names matched by a more loose regexp. ("Inheritance" is not the right term here, but acceptable in a sense that a set of objects instantiated by a subclass is a subset of the set of all objects instantiated by its parent.) > Now the questions are whether (1) writing such specifications is useful > in the first place, and (2) whether such implicit inheritance is useful. > If they are, I don't see a way to _explicitly_ specify that *Help* > buffers should inherit the minimum window height from the specifier for > all buffers. Yes, writing such specifications is useful and "inheritance by regexps" is useful. But actually I meant inheritance for named specifications like macro specifiers (and they are not required to use regexps). >> I also want to note that tags like `reuse-window' and `pop-up-window' >> are redundant in plists. Their meaning can be expressed as plists like >> `:window same', `:window other', `:buffer same'. > > These tags are mainly used to group items together for the customization > interface: A user caring about how to display a buffer on a separate > frame shouldn't be concerned with specifiers that describe how to pop up > a new window for that buffer. On the "top level" :window is ambiguous > because it can mean the window to reuse or the window to split. So we > would have to write ":window-to-reuse same" and ":window-to-split lru" > or something the like. This is the most difficult part of the design - to find a good balance between customization tags and parameters. >> This would bring >> them closer to the syntax of defface specs that is proven to be flexible >> and easy to configure. > > If I leave in inheritance, the form above could be simplified to say > > (setq > display-buffer-alist > '((".*" :pop-up-window largest) > (".*" :pop-up-window lru) > ("^\\*Help\\*$" :pop-up-window-set-height fit-window-to-buffer) > ("^\\*.+\\*$" :pop-up-window-set-height 20) > (".*" :pop-up-window-min-height 15))) This looks nicer. But currently I don't know how expressive it will be.