From drew.adams@oracle.com Mon Jul 27 00:43:29 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jul 2009 07:43:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6R7hNar024291 for ; Mon, 27 Jul 2009 00:43:25 -0700 Received: from mx10.gnu.org ([199.232.76.166]:59370) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MVKri-0000Ji-TT for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 03:43:23 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MVKrg-0003ww-7L for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 03:43:22 -0400 Received: from mx20.gnu.org ([199.232.41.8]:13197) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVKrf-0003wm-N2 for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 03:43:19 -0400 Received: from rcsinet11.oracle.com ([148.87.113.123] helo=rgminet11.oracle.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVKrf-00078R-0A for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 03:43:19 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6R7j3iU004329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 27 Jul 2009 07:45:05 GMT Received: from abhmt010.oracle.com (abhmt010.oracle.com [141.146.116.19]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6R7hPsQ022626 for ; Mon, 27 Jul 2009 07:43:26 GMT Received: from dradamslap1 (/141.144.232.119) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Jul 2009 00:43:13 -0700 From: "Drew Adams" To: Subject: 23.0.96; doc for distinguishing interactive calls Date: Mon, 27 Jul 2009 00:43:32 -0700 Message-ID: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcoOjfB/73kcYjWFS0iZKYT1/XXykQ== X-Source-IP: abhmt010.oracle.com [141.146.116.19] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010203.4A6D5A92.00B5:SCFSTAT5015188,ss=1,fgs=0 X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) This bug report is about node (elisp)Distinguish Interactive. Starting with Emacs 22, you introduced `called-interactively-p'. As a result, the doc explaining testing for interactive use became worse, not better. The "recommended" way is presented first. Why it is recommended is not stated, and it's not clear to me (recommended for what use cases? why?). The "recommended" way does not really test whether a function was in fact called interactively. As the doc says, it has the particular benefit (which can also be a drawback) of letting Lisp code fake an interactive call by providing the optional arg. Yes, that can often be handy; no, that does not justify calling it "the recommended" test. Note that the Emacs 20-21 doc for this does not "recommend" anything. Rather, it speaks of "the most common use of `interactive-p'" being to print a message when interactive, and presents the optional arg technique as "the other way" to do that. IOW, the sense of that previous text has been twisted into something quite different. Next is presented `called-interactively-p'. But the examples given do not show anything particular about `called-interactively-p' - that is, they don't in any way distinguish it from `interactive-p'. In fact, those same examples were used in the Emacs 20-21 doc for `interactive-p'! IIUC, the main difference between these two is that `called-interactively-p' returns non-nil for a keyboard macro run interactively. The examples do not illustrate that difference at all, but one could get the impression that they are meant to point out the particularity of `called-interactively-p'. The only thing the examples illustrate is that it is the function that calls `called-interactively-p' that is being tested for interactive use - and that is true also for `interactive-p'. Furthermore, the important rationale behind `interactive-p' returning nil for a keyboard macro, present in the Emacs 20-21 doc, was simply dropped: "As a special exception, `interactive-p' returns `nil' whenever a keyboard macro is being run. This is to suppress the informative messages and speed execution of the macro." That speaks directly to why and when to use `interactive-p'. Far from dropping such a rationale, rationales describing use cases for the other two methods are also needed. Please rewrite this page. Describe the actual behavior differences between the 3 approaches and the different use cases they are each most appropriate for. My impression is that, most of the time, code wants to distinguish the case where the _user_ actually called the command interactively. To me, that certainly does not mean the use of an optional arg that could be faked by Lisp code. The Emacs 20-21 doc made clear that the optional arg technique is merely an alternative way to handle the most common case of printing a message for an interactive call. It should hardly be called "the recommended way to test whether the function was called using `call-interactively'". And it is wrong to introduce this general topic by mentioning that common case at the outset, as if it were the motivation for interactive-use testing in general. Even if that is the most common use case, this page is about much more than that use case. There are other reasons for code to test for an interactive call, besides printing a message. And to me an interactive-call test probably means `interactive-p' more often than `called-interactively-p', since it is a call using a key binding or via `M-x' that is typically distinguished. But I recognize that this is debatable: including interactive use of the command in a keyboard macro could alternatively be considered the more common case of the two. If it were I, I'd probably start with `interactive-p', as the most restrictive (test of most truly "interactive" use). Then I'd introduce `called-interactively-p', for cases where you want to also consider calls in a keyboard macro to be interactive. Finally, I'd introduce the optional arg cliche as a way to test interactiveness that also lets you fake it from Lisp (least restrictive in interactiveness). But I would understand if some other systematic presentation were used. In any case, some thought needs to be given to the overall presentation, the various use cases, and the order of presentation. What exists now is a confusing mess. Compare the Emacs 20-21 page this evolved from, and you will notice a quantum leap in muddle. In GNU Emacs 23.0.96.1 (i386-mingw-nt5.1.2600) of 2009-07-09 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' From drew.adams@oracle.com Mon Jul 27 01:17:27 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jul 2009 08:17:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.2 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6R8HMiX030214 for ; Mon, 27 Jul 2009 01:17:23 -0700 Received: from mail.gnu.org ([199.232.76.166]:60093 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MVLOb-0005Vo-LL for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 04:17:21 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MVLOZ-00084o-Ul for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 04:17:21 -0400 Received: from mx20.gnu.org ([199.232.41.8]:16089) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVLOZ-00084i-Jb for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 04:17:19 -0400 Received: from acsinet11.oracle.com ([141.146.126.233]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVLOY-0000eQ-SB for emacs-pretest-bug@gnu.org; Mon, 27 Jul 2009 04:17:19 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6R8HOWi010348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Jul 2009 08:17:25 GMT Received: from abhmt009.oracle.com (abhmt009.oracle.com [141.146.116.18]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6R8HG0k026905; Mon, 27 Jul 2009 08:17:17 GMT Received: from dradamslap1 (/141.144.232.119) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Jul 2009 01:17:04 -0700 From: "Drew Adams" To: <3941@debbugs.gnu.org>, References: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> Subject: RE: bug#3941: 23.0.96; doc for distinguishing interactive calls Date: Mon, 27 Jul 2009 01:17:23 -0700 Message-ID: <1B8E3AD4E5A54942B171CBB0F94FB7F3@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcoOjfB/73kcYjWFS0iZKYT1/XXykQAAm6Ug X-Source-IP: abhmt009.oracle.com [141.146.116.18] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4A6D6281.013D:SCFSTAT5015188,ss=1,fgs=0 X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Sorry that I didn't include anything about the doc string of `interactive-p' when I reported this bug. As should be clear from what I wrote, that doc string is also horrible. Please remove the last two paragraphs entirely - the first paragraph is OK. "The only known proper use of `interactive-p'..." - that's garbage. You make it sound like something unclean and bizarre, if not perverted. This is a total twisting of what was said in Emacs 20-21 about the simple, common use case of displaying a message only for interactive use. From "the most common use case" we have moved to "the only known proper use". Soon we will be burning witches. ;-) Simply state that `interactive-p' returns nil when called during interactive execution of a keyboard macro, and that if you want a non-nil value in that use case then use `called-interactively-p' instead. That's all. No big deal. And fix the doc string of `called-interactively-p' similarly, to mention that difference from `interactive-p'. And remove its similar moralizing about "the cleanest way". And why say "This is used for implementing advice and other function-modifying features of Emacs"? That is misleading, and it doesn't help a bit. Except for that difference of behavior wrt keyboard macros, IIUC, these two functions behave the same. There is absolutely no reason for the misleading and alarmist tone of the doc strings. Each function has a behavior and a purpose. Please stop with the "the way to do that is" and "the only known proper use is" and "the recommended way is". (Someone spent too much time at catechism.) Just give users technical _information_ about (a) the behaviors and hence (b) appropriate use cases. Forget about what's "proper" and "the way". That's not helpful. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 16:16:14 2011 Received: (at control) by debbugs.gnu.org; 12 Jul 2011 20:16:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjNO-0000IE-CG for submit@debbugs.gnu.org; Tue, 12 Jul 2011 16:16:14 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjNM-0000Hz-2h for control@debbugs.gnu.org; Tue, 12 Jul 2011 16:16:12 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=quimbies.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QgjNA-00055V-5I for control@debbugs.gnu.org; Tue, 12 Jul 2011 22:16:00 +0200 Date: Tue, 12 Jul 2011 22:15:59 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Magne Ingebrigtsen Subject: control message for bug #3941 X-MailScanner-ID: 1QgjNA-00055V-5I X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1311106560.44053@iAU5r4zO53MNptAqxtQgnA X-Spam-Status: No X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) tags 3941 notabug close 3941 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 16:20:10 2011 Received: (at 3941) by debbugs.gnu.org; 12 Jul 2011 20:20:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjR8-0000PO-Kh for submit@debbugs.gnu.org; Tue, 12 Jul 2011 16:20:10 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjQu-0000Ny-LJ for 3941@debbugs.gnu.org; Tue, 12 Jul 2011 16:19:58 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=quimbies.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QgjQj-0005Ac-CS; Tue, 12 Jul 2011 22:19:41 +0200 From: Lars Magne Ingebrigtsen To: "Drew Adams" Subject: Re: bug#3941: 23.0.96; doc for distinguishing interactive calls In-Reply-To: <1B8E3AD4E5A54942B171CBB0F94FB7F3@us.oracle.com> (Drew Adams's message of "Mon, 27 Jul 2009 01:17:23 -0700") Date: Tue, 12 Jul 2011 22:15:57 +0200 Message-ID: References: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> <1B8E3AD4E5A54942B171CBB0F94FB7F3@us.oracle.com> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: Peter Gabriel's _Peter Gabriel 4_: "San Jacinto" X-Hashcash: 1:23:110712:drew.adams@oracle.com::SNnBqN9GR44ZDVUY:000000000000000000000000000000000000000063RE X-Hashcash: 1:23:110712:3941@debbugs.gnu.org::UjXvlDqSJ0WGh2Kz:00000000000000000000000000000000000000000x3u5 MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1QgjQj-0005Ac-CS X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1311106781.48312@O37vGhh9SoqNO/V77CRBKQ X-Spam-Status: No X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 3941 Cc: 3941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) "Drew Adams" writes: > Sorry that I didn't include anything about the doc string of > `interactive-p' when I reported this bug. As should be clear from what > I wrote, that doc string is also horrible. Please remove the last two > paragraphs entirely - the first paragraph is OK. `interactive-p' is deprecated and will be going away. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 16:20:19 2011 Received: (at 3941) by debbugs.gnu.org; 12 Jul 2011 20:20:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjRG-0000Q4-W5 for submit@debbugs.gnu.org; Tue, 12 Jul 2011 16:20:18 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QgjQu-0000Nw-1c for 3941@debbugs.gnu.org; Tue, 12 Jul 2011 16:20:01 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=quimbies.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QgjQi-0005Aa-C5; Tue, 12 Jul 2011 22:19:40 +0200 From: Lars Magne Ingebrigtsen To: "Drew Adams" Subject: Re: 23.0.96; doc for distinguishing interactive calls In-Reply-To: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> (Drew Adams's message of "Mon, 27 Jul 2009 00:43:32 -0700") Date: Tue, 12 Jul 2011 22:15:35 +0200 Message-ID: References: <399BB9E1A8B54AB3A1C2AC4BCF27C9F2@us.oracle.com> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: Peter Gabriel's _Peter Gabriel 4_: "San Jacinto" X-Hashcash: 1:23:110712:drew.adams@oracle.com::dJYC45O01DOT0ceo:0000000000000000000000000000000000000000L1hf X-Hashcash: 1:23:110712:3941@debbugs.gnu.org::V9Enkhds8v5GnLOz:00000000000000000000000000000000000000000Z8wm MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1QgjQi-0005Aa-C5 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1311106780.79243@BdGgQ4bB4gYwqTVxMWUXGg X-Spam-Status: No X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 3941 Cc: 3941@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) "Drew Adams" writes: > This bug report is about node (elisp)Distinguish Interactive. > Starting with Emacs 22, you introduced `called-interactively-p'. As a > result, the doc explaining testing for interactive use became worse, > not better. > > The "recommended" way is presented first. Why it is recommended is > not stated, and it's not clear to me (recommended for what use cases? > why?). The "recommended" way does not really test whether a function > was in fact called interactively. Separating out the interactive parts into the `interactive' spec is just good style, instead of sprinkling the code further down for interactiveness. I've read the node in question now, and I think it's quite clear, and doesn't say anything I disagree with much, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From unknown Mon Jun 23 20:17:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 10 Aug 2011 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator