From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3984: 23.0.96; defadvice of call-interactively defeats interactive-p Date: Fri, 31 Jul 2009 07:19:13 -0700 Message-ID: <2707E3CF212E4D7B801D2F2EEAF54373@us.oracle.com> References: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> Reply-To: Drew Adams , 3984@emacsbugs.donarmstrong.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 1249050610 28522 80.91.229.12 (31 Jul 2009 14:30:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 14:30:10 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 3984@emacsbugs.donarmstrong.com To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 31 16:30:03 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWt7I-0004oY-KX for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jul 2009 16:29:52 +0200 Original-Received: from localhost ([127.0.0.1]:51470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWt7I-0002MA-1j for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jul 2009 10:29:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWt4P-0005wl-Nj for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 10:26:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWt4M-0005pS-1Y for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 10:26:53 -0400 Original-Received: from [199.232.76.173] (port=33450 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWt4L-0005p2-Fn for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 10:26:49 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42462) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWt4K-0002UV-W8 for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 10:26:49 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6VEQib8018423; Fri, 31 Jul 2009 07:26:47 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6VEPBJs018126; Fri, 31 Jul 2009 07:25:11 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 31 Jul 2009 14:25:10 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3984 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124904999117480 (code B ref -1); Fri, 31 Jul 2009 14:25:10 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 31 Jul 2009 14:19:51 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 n6VEJkP2017475 for ; Fri, 31 Jul 2009 07:19:48 -0700 Original-Received: from mail.gnu.org ([199.232.76.166]:40751 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MWsxW-0002i1-9f for emacs-pretest-bug@gnu.org; Fri, 31 Jul 2009 10:19:46 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MWsxU-00018l-Cq for emacs-pretest-bug@gnu.org; Fri, 31 Jul 2009 10:19:45 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:26959 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 1MWsxU-00017o-03 for emacs-pretest-bug@gnu.org; Fri, 31 Jul 2009 10:19:44 -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 n6VEJLk0021737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 31 Jul 2009 14:19:23 GMT Original-Received: from abhmt005.oracle.com (abhmt005.oracle.com [141.146.116.14]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6VEJIRP018527; Fri, 31 Jul 2009 14:19:22 GMT Original-Received: from dradamslap1 (/141.144.168.5) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 31 Jul 2009 07:19:16 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcoRgp4jolXlfi9DRUGLPxFsZyYwqQAZs3iw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt005.oracle.com [141.146.116.14] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010208.4A72FD69.0035:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 31 Jul 2009 10:26:53 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29766 gmane.emacs.pretest.bugs:24898 Archived-At: > > Can someone please explain why this happens, or how to work > around it? > > Because the implementation of interactive-p (and > called-interactively-p) > is brittle: it looks at the latest stack frames to see the name of the > caller, so if you add things between the call to `call-interactively' > and the corresponding function call, it gets confused. > > To work around it, don't use `interactive-p' and instead add > an optional > argument (call it `interactive') to your function and pass it an > explicit non-nil value from the interactive spec. Unfortunately, the code with `interactive-p' is not mine. The defadvice is mine, but it needs to work for user functions, including those that call `interactive-p' or `called-interactively-p'. Is there no way the Emacs implementation could be fixed to handle this better? Couldn't it take into consideration the `ad-*' stuff that results from advising `call-interactively'? IOW, couldn't it look for `call-interactively' in its advised form also?