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, 08 Aug 2011 12:45:36 +0300 Organization: JURTA Message-ID: <8739hccjrv.fsf@mail.jurta.org> References: <87mxgem09k.fsf@stupidchicken.com> <4E22AE2B.5040806@gmx.at> <4E248102.6080904@gmx.at> <4E380918.3060806@gmx.at> <4E397611.5020603@gmx.at> <87oc037qwj.fsf@mail.jurta.org> <8762m9ytdi.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312797513 24226 80.91.229.12 (8 Aug 2011 09:58:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2011 09:58:33 +0000 (UTC) Cc: martin rudalics , Chong Yidong , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 08 11:58:29 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 1QqMbK-0005M7-QT for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2011 11:58:26 +0200 Original-Received: from localhost ([::1]:39408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqMbJ-0005wM-Jx for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2011 05:58:25 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqMbG-0005vK-SX for emacs-devel@gnu.org; Mon, 08 Aug 2011 05:58:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqMbE-0001ks-MN for emacs-devel@gnu.org; Mon, 08 Aug 2011 05:58:22 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:34499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqMbE-0001kZ-IB for emacs-devel@gnu.org; Mon, 08 Aug 2011 05:58:20 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 5128A6E807D; Mon, 8 Aug 2011 02:58:19 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A89B8451C33A; Mon, 8 Aug 2011 02:58:15 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 07 Aug 2011 20:54:49 -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:143008 Archived-At: > You can already do that since Emacs-20 by setting special-display-regexp > to something like > > (add-to-list 'special-display-regexps > '("\\*Completions\\*" my-display-completions)) > > Tho I haven't seen any sample "my-display-completions" yet. A possible explanation is that users don't like to write functions to specify buffer-displaying behavior :) >> I expect this eventually will turn `display-buffer-alist' into > >> (("\\*\\(vc-\\)?diff*" >> display-buffer-according-to-specifiers (spec . val)) >> ("\\*\\(compilation\\|grep\\)\\*" >> display-buffer-according-to-specifiers (spec . val)) >> ...) > >> because predefined spec values are easier to customize. > > Easier than what? Selecting from the set of predefined values is easier than writing a new function to customize the buffer-displaying behavior. >> Yes, a single variable would be enough to override the display-buffer's arg >> (maybe a better name would be `display-buffer-specifiers'). > > In my proposal, these things are called "rule", where RULE has the form > (FUNCTION . ARGS). In classical logic, necessary part of "rule" is "condition". So "rule" is rather such an element if `display-buffer-alist': ("*Completions*" display-buffer-according-to-specifiers (spec . val)) But since "condition" part is unnecessary in the call of `display-buffer', what remains is just specifiers. According to your earlier proposals such specifiers should be as short as possible like: (display-buffer buffer 'same-frame) (display-buffer buffer 'same-window) (display-buffer buffer 'other-window) (display-buffer buffer 'nearby) (display-buffer buffer 'near-minibuffer) (display-buffer buffer 'below-selected) (display-buffer buffer 'side-window) But now you propose to use function names. So it seems that instead of (display-buffer buffer 'reuse-window) (display-buffer buffer 'pop-up-window) using function names as an argument of `display-buffer' would look very weird: (display-buffer buffer 'display-buffer-reuse-window) (display-buffer buffer 'display-buffer-pop-up-window) It will cause the callers to ask the questions like why this can't be written simply as: (display-buffer-reuse-window buffer) (display-buffer-pop-up-window buffer)