From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Newsgroups: gmane.emacs.bugs Subject: bug#3984: Date: Fri, 20 Sep 2013 09:54:24 -0700 Message-ID: <523C7DC0.3000403@thompsonclan.org> References: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> <5232D333.8030206@thompsonclan.org> <523359CD.2070904@thompsonclan.org> <5233670E.4030703@thompsonclan.org> <5237C9FF.1000809@thompsonclan.org> <52388FEB.6020007@thompsonclan.org> <523A37A4.5060505@thompsonclan.org> <523A49BE.3060109@thompsonclan.org> <523AB06B.9090606@thompsonclan.org> <523B4F4E.3060204@thompsonclan.org> <523B73CF.4080105@thompsonclan.org> <523BCDBB.3000202@thompsonclan.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1379696118 1590 80.91.229.3 (20 Sep 2013 16:55:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Sep 2013 16:55:18 +0000 (UTC) Cc: 3984@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 20 18:55:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VN3zD-0008SZ-77 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 18:55:19 +0200 Original-Received: from localhost ([::1]:56933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3zC-0003zJ-QN for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Sep 2013 12:55:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3yz-0003uv-3I for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:55:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VN3yw-0007Uu-Tq for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:55:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VN3yw-0007Uf-QL for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VN3yv-0002fk-TX for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2013 12:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2013 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3984 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3984-submit@debbugs.gnu.org id=B3984.137969607810235 (code B ref 3984); Fri, 20 Sep 2013 16:55:01 +0000 Original-Received: (at 3984) by debbugs.gnu.org; 20 Sep 2013 16:54:38 +0000 Original-Received: from localhost ([127.0.0.1]:51553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VN3yX-0002f1-JE for submit@debbugs.gnu.org; Fri, 20 Sep 2013 12:54:37 -0400 Original-Received: from mail-pd0-f181.google.com ([209.85.192.181]:41768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VN3yU-0002ei-Iy for 3984@debbugs.gnu.org; Fri, 20 Sep 2013 12:54:35 -0400 Original-Received: by mail-pd0-f181.google.com with SMTP id g10so600505pdj.40 for <3984@debbugs.gnu.org>; Fri, 20 Sep 2013 09:54:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=qENA+9EYu2l1CDAky0o9jnl+VB39FZi06sxs0/9ARSA=; b=Z+om06vzcUquOqHXBDKM4dSvKbGh91h5RreIuQb+1bSUbMk94AKMXR7fU2bs0xVtSp qxe3X8ho4Dz6MEkjaTX7WWToD1i3ChzyhtY1SHwbTlAFk7b8+/CdK8rdNNbaO72wupa2 EXwvIa/SQ5BlJMGgeWxa2t/9Jgk/RHpCfAfbLaasgw2IjOpPA//Q3k5wfFzsNGImVbl0 MZhNmH4Lu8eIaSIwvAtQuNOgfCUmEU61soYfSYtUNIDWuj7e0IE0tF+T4ORQdM1peM2E RAv2QmGoETz2rkWEx9vEmebHrBBeLH5NAXZZC1nPnHySZszT5pSKUZ1RxBOLGrCrVJQV sy+Q== X-Gm-Message-State: ALoCoQmhBEHjsYNp9xvJPa+PYQzldIIOn+13CFHpcWGU/wgVxrfeZ2m5VIUDAYKjPGyH3HFdMfV0 X-Received: by 10.66.136.167 with SMTP id qb7mr10109997pab.43.1379696068624; Fri, 20 Sep 2013 09:54:28 -0700 (PDT) Original-Received: from wireless-121-195.scripps.edu (wireless-121-195.scripps.edu. [137.131.121.195]) by mx.google.com with ESMTPSA id xv2sm16840193pbb.39.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 09:54:27 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78616 Archived-At: On 9/20/13 7:35 AM, Stefan Monnier wrote: >> After a little more consideration, I think I know what the bug is. The goal >> of "advice--called-interactively-skip" is to skip all the advice-related >> stack frames of the called function, not advice-related stack frames for >> advice on call-interactively. > Oh, right. How 'bout the patch below? > > > Stefan > > > === modified file 'lisp/subr.el' > --- lisp/subr.el 2013-09-18 03:50:18 +0000 > +++ lisp/subr.el 2013-09-20 14:34:03 +0000 > @@ -4246,6 +4246,8 @@ > if those frames don't seem special and otherwise, it should return > the number of frames to skip (minus 1).") > > +(defconst internal--call-interactively (symbol-function 'call-interactively)) > + > (defun called-interactively-p (&optional kind) > "Return t if the containing function was called by `call-interactively'. > If KIND is `interactive', then only return t if the call was made > @@ -4321,7 +4323,9 @@ > ;; Somehow, I sometimes got `command-execute' rather than > ;; `call-interactively' on my stacktrace !? > ;;(`(,_ . (t command-execute . ,_)) t) > - (`(,_ . (t call-interactively . ,_)) t))))) > + (`(,_ . (t ,(or `call-interactively > + (pred (eq internal--call-interactively))) . ,_)) > + t))))) > > (defun interactive-p () > "Return t if the containing function was run directly by user input. > That would certainly work, assuming that subr.el is always loaded before nadvice.el (so call-interactively could not possibly be advised yet), which seems likely to be true since subr.el contains so many core functions. Since this bug report is just about advising call-interactively, which we now have a fix for, should I open a separate bug about the around advice?