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: Tue, 17 Sep 2013 10:22:51 -0700 Message-ID: <52388FEB.6020007@thompsonclan.org> References: <20E00C7675E64356BF2F0B2A7E0ABDB1@us.oracle.com> <5232D333.8030206@thompsonclan.org> <523359CD.2070904@thompsonclan.org> <5233670E.4030703@thompsonclan.org> <5237C9FF.1000809@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 1379438661 14718 80.91.229.3 (17 Sep 2013 17:24:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Sep 2013 17:24:21 +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 Tue Sep 17 19:24:22 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 1VLz0f-0002Sj-GT for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Sep 2013 19:24:21 +0200 Original-Received: from localhost ([::1]:42729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLz0e-00086h-RC for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Sep 2013 13:24:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLz0U-00086N-1S for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2013 13:24:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLz0M-00050S-KJ for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2013 13:24:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLz0M-00050N-Gq for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2013 13:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VLz0L-00043h-S5 for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2013 13:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Sep 2013 17:24: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.137943858415515 (code B ref 3984); Tue, 17 Sep 2013 17:24:01 +0000 Original-Received: (at 3984) by debbugs.gnu.org; 17 Sep 2013 17:23:04 +0000 Original-Received: from localhost ([127.0.0.1]:44431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VLyzQ-00042B-7F for submit@debbugs.gnu.org; Tue, 17 Sep 2013 13:23:04 -0400 Original-Received: from mail-pb0-f42.google.com ([209.85.160.42]:45671) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VLyzO-00041a-3O for 3984@debbugs.gnu.org; Tue, 17 Sep 2013 13:23:02 -0400 Original-Received: by mail-pb0-f42.google.com with SMTP id un15so5859514pbc.29 for <3984@debbugs.gnu.org>; Tue, 17 Sep 2013 10:22:56 -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=6E/BeMLhaYJDkvb3V81ZoDNZyfBQzogDEejSQnZWMOU=; b=PoyQcbveJQ9KqzZaV04XosmJwjMLVX2/6Ce07tfaEtx6IcfiNla3C4LwrAuAVtdmDP nqoyhXnwZBjQzJ6drDwpEOU7j7xdnUk9omyHsmwdKPGjEGCRp+hSgRm8Ae2QinUO4bxS i98KmKbYPPA5PFDUJ6cOxCAhiGK9kc5lnkYI2pDJQz5QC8NLyoGn9nNqD2Qh7NlHwnLa +FiCr7QAMVgAEBdDyqHCSNCro2DnEN2K8FTwPXZqy6Wu3cyPTgb2dCVj3sbb8+hqkG/t K1VL+Tddq5uXNN4iH075Xi2n8tPRTWrPYiDol/UV87+QNXDQMojD9MuO4kjYfzsBERcb ZuAw== X-Gm-Message-State: ALoCoQn3fQmNiemTHTgHDV6DkVD+c0NOFMylQWYdbsZSbi3pwOdvAU65zyiPEHIngHncjBxVBJk0 X-Received: by 10.66.227.194 with SMTP id sc2mr38486347pac.41.1379438576270; Tue, 17 Sep 2013 10:22:56 -0700 (PDT) Original-Received: from [192.168.10.2] (user-0c9ha1q.cable.mindspring.com. [24.152.168.58]) by mx.google.com with ESMTPSA id vz4sm47423607pab.11.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Sep 2013 10:22:53 -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:78492 Archived-At: On 9/17/13 6:10 AM, Stefan Monnier wrote: >> We have "ad-is-advised" which we can use to find which stack frames >> correspond to advised functions. We have "ad-get-orig-definition" which we >> can use to find the original definition of an advised function. > These are functions of advice.el, which is on the way out. We need to > look at nadvice.el. Wait, so defadvice and friends are going away entirely? Is everything in advice.el going away, or are some parts of it going to be converted to the new advice system? Is all this documented somewhere? > > Thinking about it once more, I realize that your "advised > call-interactively" case might indeed be resolved by the current code, > except that it bumps into the problematic case of "deepest advice is > using :around". > > Could you check if it is the case simply be doing a dummy (advice-add > 'call-interactively :before #'ignore) before your defadvice? > > If that works, then we can probably fix that problem in the following way: > - keep track of every function value (e.g. # in > our case) that is wrapped (at the deepest level) in an :around advice > (e.g. in a hash-table). > - when walking up the stack, if we find such a function, look up the > stack searching for the matching function symbol (just like we already > do when encountering an internal advice element on the stack). > > > Stefan I tried the before advice, and it doesn't seem to work. With the following code in emacs -Q: (advice-add 'call-interactively :before #'ignore) (defun myfun2 () (interactive) (or (called-interactively-p) (error "Must be interactive!"))) (call-interactively 'myfun2) I get the following stack trace: Debugger entered--Lisp error: (error "Must be interactive!") signal(error ("Must be interactive!")) error("Must be interactive!") (or (called-interactively-p) (error "Must be interactive!")) myfun2() #(myfun2) apply(# myfun2) call-interactively(myfun2) eval-region(345 373 t (lambda (ignore) (goto-char 373) (quote (call-interactively (quote myfun2))))) ; Reading at buffer position 345 apply(eval-region (345 373 t (lambda (ignore) (goto-char 373) (quote (call-interactively (quote myfun2)))))) eval-defun-2() eval-defun(nil) #(eval-defun nil nil) apply(# (eval-defun nil nil)) call-interactively(eval-defun nil nil) command-execute(eval-defun) Same thing happens when I do M-x myfun2.