From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function? Date: Wed, 21 Aug 2019 03:01:23 -0400 Message-ID: References: <400906ac-35f1-48e4-8df9-8e65b340209b@default> <87vbrjdajs.fsf@web.de> <82178260-247b-4653-85db-d6586480419e@default> <87d2dqdsyj.fsf@web.de> <8736ihb0ds.fsf@mouse.gnus.org> <87d0hl3xqx.fsf@web.de> <878ss99jhi.fsf@mouse.gnus.org> <87o914xh50.fsf@web.de> <87ftmgdl2d.fsf@mouse.gnus.org> <8736hy1wxt.fsf@web.de> <87ef1i38g4.fsf@gmail.com> <87k1ba3wgc.fsf@mouse.gnus.org> <877e7a2fut.fsf@gmail.com> <87d0gzwnm6.fsf@mail.linkov.net> <87o90jjw3t.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="113213"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , Lars Ingebrigtsen , Juri Linkov , 17871@debbugs.gnu.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 21 09:02:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0KdL-000TFD-8K for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Aug 2019 09:02:15 +0200 Original-Received: from localhost ([::1]:44360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0KdJ-00066S-Lg for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Aug 2019 03:02:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39560) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0KdD-000655-Fg for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 03:02:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0Kd8-0002Rk-HS for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 03:02:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0Kd8-0002Rd-C9 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 03:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0Kd8-0003bj-81 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 03:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Aug 2019 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17871 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 17871-submit@debbugs.gnu.org id=B17871.156637090213837 (code B ref 17871); Wed, 21 Aug 2019 07:02:02 +0000 Original-Received: (at 17871) by debbugs.gnu.org; 21 Aug 2019 07:01:42 +0000 Original-Received: from localhost ([127.0.0.1]:34476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0Kcn-0003b6-8i for submit@debbugs.gnu.org; Wed, 21 Aug 2019 03:01:42 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0Kck-0003ar-A2 for 17871@debbugs.gnu.org; Wed, 21 Aug 2019 03:01:39 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9606181094; Wed, 21 Aug 2019 03:01:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2E4C580D3A; Wed, 21 Aug 2019 03:01:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1566370887; bh=0voCoe3lND2SMEFMOH8t3raKc3t2vc05c7/Zpa3gjUI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=OPKp4hLGmOu9Mjh+J6NOQ7YLAG+uAj1ZNTDkx1K6yWv7lhK86UM/HZcKQIyenkkKL k96/Xmc+CgGJFtWoXHp6Dv3d/+DfjiELKSFS7gpz2cjIahmUnLtfx8o8KIoCx+OgVS 5agPJ0Z6IU1sW5Aif5v1I6u9UaMIxVQVYjd5Vkz9A03XlYYcsBB1t9roJkT5Tbx18+ rxwe5CKDxpPf2cHNXnMrxPmV5B0Sqjk6u1I8V0neYPrUn6RCKCsq9GKO33WRwjeXNX sVmW/2w5byS5QXq0EBcbQPwATWl2vmB8iywwUoFUQIm4gm5GaQ1xkf3mn4EAyneN9r l4TVNUz3RUD/A== Original-Received: from alfajor (port-87-193-132-138.static.qsc.de [87.193.132.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 334D7120310; Wed, 21 Aug 2019 03:01:26 -0400 (EDT) In-Reply-To: <87o90jjw3t.fsf@gmail.com> ("=?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?="'s message of "Wed, 21 Aug 2019 00:44:06 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:165473 Archived-At: > (defvar __testvar nil) > > (defun __test-command () > (interactive (ignore (message "__test-command (interactive): %s" __testvar))) > (message "__test-command (body): %s" __testvar)) > > (defun __test-advice (orig &rest args) > (let ((__testvar t)) > (apply orig args))) > > (advice-add '__test-command :around #'__test-advice) > > Even with the advice, calling __test-command gives: > > __test-command (interactive): nil > __test-command (body): t > > I'd expect the advice to have effect on the whole function, including > the interactive form. The interactive form is executed to build the args with which the function will be called (hence your advice is only executed after the interactive spec), so in order for your code to do what you want, we'd have to always wrap the interactive spec identically to the body. Maybe in this case it'd do what you want, but in many other cases it wouldn't. Stefan