From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: delete-windows-on Date: Fri, 2 Oct 2009 09:47:15 -0700 Message-ID: <8EA9172832C04915909AE7B506260481@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254502076 980 80.91.229.12 (2 Oct 2009 16:47:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 16:47:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Juanma Barranquero'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 02 18:47:49 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MtlII-0006kI-7Y for ged-emacs-devel@m.gmane.org; Fri, 02 Oct 2009 18:47:46 +0200 Original-Received: from localhost ([127.0.0.1]:48937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtlIH-000367-Fp for ged-emacs-devel@m.gmane.org; Fri, 02 Oct 2009 12:47:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtlI5-00031z-ND for emacs-devel@gnu.org; Fri, 02 Oct 2009 12:47:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtlHy-0002um-12 for emacs-devel@gnu.org; Fri, 02 Oct 2009 12:47:30 -0400 Original-Received: from [199.232.76.173] (port=53075 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtlHx-0002uR-Fi for emacs-devel@gnu.org; Fri, 02 Oct 2009 12:47:25 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:60617 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtlHw-00007J-N2 for emacs-devel@gnu.org; Fri, 02 Oct 2009 12:47:24 -0400 Original-Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n92Gl2bT020897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Oct 2009 16:47:03 GMT Original-Received: from abhmt008.oracle.com (abhmt008.oracle.com [141.146.116.17]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n92GlnDq007410; Fri, 2 Oct 2009 16:47:49 GMT Original-Received: from dradamslap1 (/24.5.184.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 02 Oct 2009 09:47:18 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcpDfcBR263Qa91TQAC1mIt8pVealgAAGKZQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt008.oracle.com [141.146.116.17] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4AC62E97.0100:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115850 Archived-At: > From: Juanma Barranquero Sent: Friday, October 02, 2009 9:31 AM > > > 3. It raises an error if you pass the name of a non-existent > > buffer, or if you pass anything that is not a string or a > > buffer (except nil - see #2). Why? Why doesn't it just do > > nothing if the BUFFER arg is not an existing buffer or its > > name? > > > > A nil value of BUFFER means there is no such buffer. The > > same is true of a string that doesn't name an existing > > buffer. The same is true of a non-string such as the > > number 42. In one case (#2), we currently do nothing and > > return nil; in all other cases (#3), we currently raise > > an error. That's not very consistent. > > I think it is quite consistent. Passing "whatever" (when "whatever" > exists) is a clear way to say 'act upon "whatever"'. Passing nil (or > omitting the 1st arg) clearly says "act upon the default buffer". > IMHO, passing 42 or "nonexistent-buffer-name" clearly means "Oops, > someone or something just fucked up". 1. What "default buffer"? No such default is defined/implemented here, AFAICT. If nil actually stood for the "default buffer" here (whatever that might mean), then passing nil would delete the window of the "default buffer". It does not do that - passing nil does nothing. 2. Besides, it is not the purpose of `delete-windows-on' to determine whether the BUFFER arg in fact corresponds to an existing buffer or someone just fucked up. Its purpose is to delete a window (or do nothing). We have other ways to test whether an object is a buffer. (And those ways do _not_ consider nil to be a buffer, BTW.) 3. Besides even that, the point is that there is a design choice to make wrt: a. What to return, and whether the return value is significant (hence documented) or the function is instead called only for its side effect. b. What to do when BUFFER does not represent a buffer. Raise an error? Do nothing? Whatever choice is made, the documentation should reflect it. 4. You claim that nil represents a buffer here. I don't think that's in fact the case. But even if it were, the above choices would still need to be made. (And just which buffer nil represents would need to be documented.) Please read the entire mail I sent.