From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: display-buffer-alist simplifications Date: Sat, 23 Jul 2011 15:26:25 -0400 Message-ID: <87wrf8iyse.fsf@stupidchicken.com> References: <87mxgem09k.fsf@stupidchicken.com> <4E2A7EBD.7050300@gmx.at> <87livooqt6.fsf@stupidchicken.com> <4E2B158B.1080101@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1311449204 26136 80.91.229.12 (23 Jul 2011 19:26:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2011 19:26:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 23 21:26:40 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 1QkhqQ-0000oE-NU for ged-emacs-devel@m.gmane.org; Sat, 23 Jul 2011 21:26:38 +0200 Original-Received: from localhost ([::1]:56445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhqQ-0000iv-75 for ged-emacs-devel@m.gmane.org; Sat, 23 Jul 2011 15:26:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhqN-0000in-U2 for emacs-devel@gnu.org; Sat, 23 Jul 2011 15:26:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkhqM-0005yH-7H for emacs-devel@gnu.org; Sat, 23 Jul 2011 15:26:35 -0400 Original-Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]:34480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhqM-0005yD-3u for emacs-devel@gnu.org; Sat, 23 Jul 2011 15:26:34 -0400 Original-Received: from furball ([64.134.67.152]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id p6NJQThk017376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 23 Jul 2011 15:26:30 -0400 In-Reply-To: <4E2B158B.1080101@gmx.at> (martin rudalics's message of "Sat, 23 Jul 2011 20:40:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.144 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:142239 Archived-At: martin rudalics writes: > This has the disadvantage that Lisp users would have to set the value > of every specifier like even-sizes unless it's nil. In practice, this > means that you have to repeat the values of min-height and min-width > for pop-up-windows and the value of pop-up-frame-alist for each and > every entry that wants to use them. This is not important. If this is an issue, it would be cleaner to use global variables to specify defaults. > The major problem with this approach, however, is an inconsistency > when handling specifiers passed by the application. Currently, these > specifiers are merged into the user's specifiers. Suppose I write > > (setq > display-buffer-alist > '((((regexp . ".*")) > (reuse-window nil same) > (reuse-window-even-sizes . t)))) > > (display-buffer "*scratch*" '((reuse-window other))) > > then the `display-buffer' call does even window sizes because it's > specified in `display-buffer-alist'. What would you propose here? IIUC, the current system also has a limitation: there is no way to use display-buffer-alist to tell Emacs to apply even-sizes selectively, e.g. only when reusing a window already containing the buffer. I think this indicates that the idea of "merging" specifiers is flawed. display-buffer-alist is trying to serve two purposes: "merging" specifiers passed to display-buffer, and "overriding" them completely. That makes it very complicated to use/understand. Why not let display-buffer-alist exclusively perform the "override" case---i.e. let it take precedence over display-buffer's argument specifiers? As for the "merge" functionality, some of it is already handled using global variables, like `even-window-heights'. In the future, we could provide a more versatile way to do merging (e.g. provide an abnormal hook that accepts the display specifier that Emacs is told to use, and return a modified specifier for it to actually use). But I think we can defer that part to post-24.1.