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: Thu, 30 Jul 2009 15:37:50 -0700 Message-ID: <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 1248994699 24133 80.91.229.12 (30 Jul 2009 22:58:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jul 2009 22:58:19 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 31 00:58:13 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 1MWeZg-0004e2-9q for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jul 2009 00:58:12 +0200 Original-Received: from localhost ([127.0.0.1]:50631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWeZf-0000qp-PI for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Jul 2009 18:58:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWeZA-0000hl-S6 for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2009 18:57:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWeZ6-0000fj-0K for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2009 18:57:40 -0400 Original-Received: from [199.232.76.173] (port=51186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWeZ5-0000fa-S3 for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2009 18:57:35 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:56301) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWeZ4-0003sm-Ih for bug-gnu-emacs@gnu.org; Thu, 30 Jul 2009 18:57:35 -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 n6UMvVap013717; Thu, 30 Jul 2009 15:57:32 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6UMj4VE012378; Thu, 30 Jul 2009 15:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 30 Jul 2009 22:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3984 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124899348311760 (code B ref -1); Thu, 30 Jul 2009 22:45:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 30 Jul 2009 22:38:03 +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 n6UMbwqi011738 for ; Thu, 30 Jul 2009 15:37:59 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:44014) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MWeG6-0007BK-2J for emacs-pretest-bug@gnu.org; Thu, 30 Jul 2009 18:37:58 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MWeG3-0000LA-Hi for emacs-pretest-bug@gnu.org; Thu, 30 Jul 2009 18:37:57 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:62178 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 1MWeG2-0000Kh-Tb for emacs-pretest-bug@gnu.org; Thu, 30 Jul 2009 18:37:55 -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 n6UMbph8012277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 Jul 2009 22:37:52 GMT Original-Received: from abhmt008.oracle.com (abhmt008.oracle.com [141.146.116.17]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6UMbpRP002474 for ; Thu, 30 Jul 2009 22:37:51 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Jul 2009 15:37:49 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcoRZl7HPubUJvrqQI2E3BlLoTygVw== 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.0A010208.4A7220BE.0059:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 30 Jul 2009 18:57:40 -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:29746 gmane.emacs.pretest.bugs:24895 Archived-At: emacs -Q Load (eval) this: (defun foo () (interactive) (if (interactive-p) (message "INT") (message "NOT"))) (global-set-key "\C-l" 'foo) (defadvice call-interactively (after foo-advice disable activate) (message "AFTER")) (ad-enable-advice 'call-interactively 'after 'foo-advice) (ad-activate 'call-interactively) Then hit `C-l'. In *Messages*, you will see this: NOT AFTER Even though `foo' is called interactively, `interactive-p' returns nil. Using `called-interactively-p' in place of `interactive-p' gives the same thing. Same thing no matter how `foo' is called interactively (e.g. M-x foo, M-: (call-interactively 'foo)). Seems like a bug, but I realize that advising primitives is iffy, and perhaps advising `call-interactively' is even more iffy. However, advising `call-interactively' seems to work fine otherwise - this is the only anomaly I've come across. Can someone please explain why this happens, or how to work around it? 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)'