From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: display-buffer-alist simplifications Date: Sat, 23 Jul 2011 09:56:45 +0200 Message-ID: <4E2A7EBD.7050300@gmx.at> References: <87mxgem09k.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311407819 11608 80.91.229.12 (23 Jul 2011 07:56:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2011 07:56:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 23 09:56:56 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 1QkX4x-00081D-Ba for ged-emacs-devel@m.gmane.org; Sat, 23 Jul 2011 09:56:55 +0200 Original-Received: from localhost ([::1]:33343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkX4x-0003QX-1n for ged-emacs-devel@m.gmane.org; Sat, 23 Jul 2011 03:56:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkX4u-0003QG-DV for emacs-devel@gnu.org; Sat, 23 Jul 2011 03:56:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkX4t-0007fo-G4 for emacs-devel@gnu.org; Sat, 23 Jul 2011 03:56:52 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:43473) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QkX4t-0007fj-4T for emacs-devel@gnu.org; Sat, 23 Jul 2011 03:56:51 -0400 Original-Received: (qmail invoked by alias); 23 Jul 2011 07:56:48 -0000 Original-Received: from 62-47-45-34.adsl.highway.telekom.at (EHLO [62.47.45.34]) [62.47.45.34] by mail.gmx.net (mp053) with SMTP; 23 Jul 2011 09:56:48 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/kJ2Qzn8XkAwq3zB9A5hXfHUeOKpL9uhXolx30qg CFl5qeIZBIy0NW User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <87mxgem09k.fsf@stupidchicken.com> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.23 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:142223 Archived-At: > It would be cleaner to use a > plist, like this: > > (reuse-window :window same :reuse-window-even-sizes t) > > where ALL the behaviors are grouped together. With the current `display-buffer-alist' writing (setq display-buffer-alist '((((regexp . ".*")) (reuse-window nil same) (reuse-window other) (reuse-window-even-sizes . t)))) means to (1) try finding any window on the selected frame that shows the buffer already, or (2) reuse any but the selected window on the selected frame, evening out window sizes in both cases, if applicable. A naive rewrite of this specifier according to your proposal would yield (setq display-buffer-alist '(".*" (reuse-window :buffer same) (reuse-window :window other) (reuse-window :even-sizes t))) The problem here is that the (reuse-window :window other) specifier would change the semantics of the (reuse-window :buffer same) specifier to _not reuse_ the selected window even if it shows the buffer. Hence the entry is not semantically equivalent to the former one. There are various ways to achieve equivalence, neither of them entirely satisfactory: (1) Use a list as value for the method specifier similar to the current approach, for example (setq display-buffer-alist '(".*" (reuse-window :which '(nil same)) (reuse-window :which '(other)) (reuse-window :even-sizes t))) (2) Require that an entry for :window is present for any reuse-window method specifier, so we'd have to write (setq display-buffer-alist '(".*" (reuse-window :window nil :buffer same :frame nil) (reuse-window :window other :buffer nil :frame nil) (reuse-window :even-sizes t))) (3) Disallow lookup for further occurrences of the same specifier. This implies that we'd have to write (setq display-buffer-alist '(".*" (reuse-window :buffer same :even-sizes t) (reuse-window :window other :even-sizes t))) Which one would you prefer? Any other suggestions? martin