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: interactive-p and called-interactively-p Date: Sat, 15 Aug 2009 16:00:52 -0700 Message-ID: <8AD328622F5645B282D1E72CB4582EF3@us.oracle.com> 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 1250377252 21249 80.91.229.12 (15 Aug 2009 23:00:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Aug 2009 23:00:52 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 16 01:00:45 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 1McSEv-0008VZ-7Q for ged-emacs-devel@m.gmane.org; Sun, 16 Aug 2009 01:00:45 +0200 Original-Received: from localhost ([127.0.0.1]:47469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSEu-0008L5-Ps for ged-emacs-devel@m.gmane.org; Sat, 15 Aug 2009 19:00:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1McSEp-0008Kq-BF for emacs-devel@gnu.org; Sat, 15 Aug 2009 19:00:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1McSEk-0008Ke-T4 for emacs-devel@gnu.org; Sat, 15 Aug 2009 19:00:39 -0400 Original-Received: from [199.232.76.173] (port=60921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1McSEk-0008Kb-Mb for emacs-devel@gnu.org; Sat, 15 Aug 2009 19:00:34 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:47682 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 1McSEk-0006on-8C for emacs-devel@gnu.org; Sat, 15 Aug 2009 19:00:34 -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 n7FN0QCE001942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 15 Aug 2009 23:00:27 GMT Original-Received: from abhmt013.oracle.com (abhmt013.oracle.com [141.146.116.22]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n7FN0Vr8014676 for ; Sat, 15 Aug 2009 23:00:32 GMT Original-Received: from dradamslap1 (/141.144.88.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Aug 2009 16:00:28 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: Acod/Dy+ajgcoBXbTKWyHuu9RnJhEQ== X-Source-IP: abhmt013.oracle.com [141.146.116.22] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4A873E0D.01E5: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:114283 Archived-At: 1. The doc for these two functions is a mess - see bug #3941. 2. Beyond the doc problem, but related to it, there is a non-doc problem: Whoever came up with the new function (in Emacs 22) `called-interactively-p' did the wrong thing, IMO. That function name tells nothing more nor less than the name `interactive-p' tells. There is nothing in the _names_ that distinguishes these two functions. Might as well have named the new function `interactive-p-2' (no, it's not a suggestion). This fact is a sign that the design is wrong, for if we did come up with names that suggest the distinction, we would soon see that using two different functions is the wrong approach. This is really one function with two minor behavioral variants. It would have been far better to just add an optional argument to `interactive-p' than to create a new, similarly named function. For example: (defun interactive-p (&optional k-macro-p) "Return t if the function in which this appears was called interactively. If optional arg K-MACRO-P is non-nil, return t when called during execution of a keyboard macro. If it is nil, return nil in that case. ...[rest of description]" Leaving the status quo in place will bring nothing but confusion, no matter how the doc is improved. It is better to just DTRT now. I vote for deprecating one or the other of these two functions, combining them by using an optional argument to express the alternative behaviors. That will go a long way toward clarifying the intended uses.