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: interactive-p and called-interactively-p Date: Sun, 16 Aug 2009 08:51:24 -0700 Message-ID: <70B076926F274D5380D733383E6EE5DE@us.oracle.com> References: <8AD328622F5645B282D1E72CB4582EF3@us.oracle.com> <87my5zopji.fsf@cyd.mit.edu> 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 1250437887 25968 80.91.229.12 (16 Aug 2009 15:51:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Aug 2009 15:51:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Chong Yidong'" , "'Stefan Monnier'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 16 17:51:20 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 1Mci0s-0002GT-OJ for ged-emacs-devel@m.gmane.org; Sun, 16 Aug 2009 17:51:19 +0200 Original-Received: from localhost ([127.0.0.1]:52596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mci0s-0000wZ-8g for ged-emacs-devel@m.gmane.org; Sun, 16 Aug 2009 11:51:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mci0m-0000wT-FQ for emacs-devel@gnu.org; Sun, 16 Aug 2009 11:51:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mci0f-0000vT-UB for emacs-devel@gnu.org; Sun, 16 Aug 2009 11:51:11 -0400 Original-Received: from [199.232.76.173] (port=42217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mci0f-0000vQ-QY for emacs-devel@gnu.org; Sun, 16 Aug 2009 11:51:05 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:37071 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 1Mci0f-0007Aa-Cs for emacs-devel@gnu.org; Sun, 16 Aug 2009 11:51:05 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n7GFouei028298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Aug 2009 15:50:58 GMT Original-Received: from abhmt001.oracle.com (abhmt001.oracle.com [141.146.116.10]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n7GFp2Jn021296; Sun, 16 Aug 2009 15:51:03 GMT Original-Received: from dradamslap1 (/141.144.88.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Aug 2009 08:50:59 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcoedZHSbOlakBVBSlmPtI42nWYCVQAEXU5Q In-Reply-To: <87my5zopji.fsf@cyd.mit.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt001.oracle.com [141.146.116.10] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4A882AE4.0225: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:114318 Archived-At: > >> It would have been far better to just add an optional argument to > >> `interactive-p' than to create a new, similarly named function. > > > > Agreed. Any objection? > > Since called-interactively-p has been around since Emacs 22, and the > benefit in cleanliness is rather minute, Cleanliness? This is about helping users (of Emacs Lisp). The existence of these two functions, with different names that nevertheless mean the same thing (even though the functions don't mean the same thing), just confuses their use. Which in turn makes their use error-prone. Which complicates code and maintenance. Which leads to further confusion about what these are for and how to use them... Look at the doc for this stuff - it's a mess. Think how simple the doc will be when there is only one function with an optional arg: we'll just explain what the arg does - QED. Compare that with the current doc (take a look, including both doc strings and the explanations in the manual) - it's nearly incomprehensible (and incorrect). > I don't think it's worth the hassle. What hassle? Just defalias `called-interactively-p' to the equivalent call of `interactive-p' that uses the new argument appropriately. And mark it as deprecated. This kind of thing is nothing new. A simple mistake such as this can, and should, be rectified. Sooner is better than later. Now is late, but later is even later. But fixing it *never*, simply because it was introduced in Emacs 22, is definitely NOT TRT. By that philosophy, we should never fix any bugs that are older than the current release. This is simply a silly design bug - `called-interactively-p' should never have seen the light of day; and it should be put to rest now. > We can't just remove called-interactively-p because > that would break backward compatibility, Huh? Deprecating a function is not some new invention. Defalias it now, and let users know it is deprecated and that in the future they should use `interactive-p' with the new arg instead. Nothing new or revolutionary about this. > which means adding another argument to > interactive-p just means more non-useful complexity (how many people > would benefit from this anyway?). No, it was adding function `called-interactively-p' that added non-useful complexity. This, on the contrary, is an operation in reducing complexity - for users. Every user of the function (with the new signature) will benefit. The code and understanding of it will be clearer.