GNU bug report logs - #13023
24.3.50; lexical binding does not work within defadvice

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Christopher Schmidt <christopher@HIDDEN>; Keywords: wontfix; dated Wed, 28 Nov 2012 16:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) wontfix. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 2 Feb 2016 19:42:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 02 14:42:41 2016
Received: from localhost ([127.0.0.1]:57084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aQgqX-0001JC-LM
	for submit <at> debbugs.gnu.org; Tue, 02 Feb 2016 14:42:41 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:39484)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <monnier@HIDDEN>) id 1aQgqU-0001J3-R6
 for 13023 <at> debbugs.gnu.org; Tue, 02 Feb 2016 14:42:39 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id u12Jgb1D020094;
 Tue, 2 Feb 2016 14:42:37 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id 548BF661C6; Tue,  2 Feb 2016 14:42:37 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
Message-ID: <jwv60y6kihe.fsf-monnier+emacsbugs@HIDDEN>
References: <87io27dkp4.fsf@HIDDEN>
Date: Tue, 02 Feb 2016 14:42:37 -0500
In-Reply-To: <87io27dkp4.fsf@HIDDEN> (Marcin Borkowski's message of "Tue, 02
 Feb 2016 19:35:35 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.2
X-NAI-Spam-Rules: 2 Rules triggered
	GEN_SPAM_FEATRE=0.2, RV5569=0
X-NAI-Spam-Version: 2.3.0.9418 : core <5569> : inlines <4260> : streams
 <1581170> : uri <2131707>
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

> does the above mean that this bug should be closed?

To the extent that I don't know of anyone who intends to fix this
problem, I guess we could close it as "won't fix".


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 2 Feb 2016 18:35:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 02 13:35:49 2016
Received: from localhost ([127.0.0.1]:57046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aQfnp-0008AX-5S
	for submit <at> debbugs.gnu.org; Tue, 02 Feb 2016 13:35:49 -0500
Received: from mail.mojserwer.eu ([195.110.48.8]:59144)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <mbork@HIDDEN>) id 1aQfnn-0008AM-0S
 for 13023 <at> debbugs.gnu.org; Tue, 02 Feb 2016 13:35:47 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id 771329D2002;
 Tue,  2 Feb 2016 19:35:45 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id leFEikQcT+vf; Tue,  2 Feb 2016 19:35:43 +0100 (CET)
Received: from localhost (unknown [109.232.24.28])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 2AF0A9D2001;
 Tue,  2 Feb 2016 19:35:41 +0100 (CET)
From: Marcin Borkowski <mbork@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
Date: Tue, 02 Feb 2016 19:35:35 +0100
Message-ID: <87io27dkp4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 2012-11-28, at 23:32, Stefan Monnier <monnier@HIDDEN> wrote:

>>     ;; -*- lexical-binding: t -*-
>>     (funcall (let ((rms "works"))
>>                (lambda ()
>>                  (message "lex-bind %s" rms))))
>
>>     (defun asdf (b) (funcall b))
>
>>     (defadvice asdf (before rms (b) activate)
>>       (setf b (let ((abc 1) (b b)) (lambda () (print abc) (funcall b)))))
>
>>     (asdf 'ding)
>
>> I think this code should work fine.  It doesn't work with trunk and
>> emacs-24, though:
>
> Indeed, it doesn't work.  And because of the way advice.el works
> (building a new function by combining the code chunks from all the
> pieces of advice applied to that function) it's not easy to fix.
>
> This is partly related to the issue mentioned recently that macro calls
> in pieces of advice are expanded late (typically when the advised
> function is defined).
>
> BTW, this does not affect the new `advice-add' feature in Emacs trunk.

Hi Stefan,
hi all,

does the above mean that this bug should be closed?  AFAIU, new code
should (at least usually) use advice-add, and while the "old" advice
system is not going to be deleted, it is kind of deprecated.

Best,

-- 
Marcin Borkowski
http://mbork.pl/en




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 3 Dec 2012 00:04:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 02 19:04:10 2012
Received: from localhost ([127.0.0.1]:50568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TfJW5-0006Gb-Cy
	for submit <at> debbugs.gnu.org; Sun, 02 Dec 2012 19:04:10 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:46347)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rms@HIDDEN>) id 1TfJW3-0006GT-9z
	for 13023 <at> debbugs.gnu.org; Sun, 02 Dec 2012 19:04:08 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rms@HIDDEN>)
	id 1TfJTg-0004X2-Hi; Sun, 02 Dec 2012 19:01:40 -0500
Date: Sun, 02 Dec 2012 19:01:40 -0500
Message-Id: <E1TfJTg-0004X2-Hi@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15
From: Richard Stallman <rms@HIDDEN>
to: monnier@HIDDEN, 13023 <at> debbugs.gnu.org
In-reply-to: <E1Tf0yC-0001kF-EO@HIDDEN> (message from Richard
	Stallman on Sat, 01 Dec 2012 23:15:56 -0500)
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
	<jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
	<E1TeWvb-0006lO-Uz@HIDDEN>
	<jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN>
	<E1Tf0yC-0001kF-EO@HIDDEN>
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 13023
Cc: rms@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rms@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.0 (-----)

Correction:

    Yes: complexity.  Compare nadvice.el and advice.el.

The main difference seems to me that part of the arguments of
advice.el get pushed into the function that you need to pass
to advice-add.  So the complexity of using advice-add is no less.
Also, you lose the ability to modify the argument values before
the advised function's body.

The doc string of advice-add is incomplete, so I cannot tell
what all its args mean or what it can really do.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 2 Dec 2012 04:18:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 01 23:18:12 2012
Received: from localhost ([127.0.0.1]:49115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tf10O-0000kr-Mk
	for submit <at> debbugs.gnu.org; Sat, 01 Dec 2012 23:18:12 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:34024)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rms@HIDDEN>) id 1Tf10N-0000kl-PO
	for 13023 <at> debbugs.gnu.org; Sat, 01 Dec 2012 23:18:12 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rms@HIDDEN>)
	id 1Tf0yC-0001kF-EO; Sat, 01 Dec 2012 23:15:56 -0500
Date: Sat, 01 Dec 2012 23:15:56 -0500
Message-Id: <E1Tf0yC-0001kF-EO@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15
From: Richard Stallman <rms@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN> (message from Stefan
	Monnier on Fri, 30 Nov 2012 23:23:18 -0500)
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
	<jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
	<E1TeWvb-0006lO-Uz@HIDDEN>
	<jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -4.6 (----)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rms@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.4 (-----)

    Yes: complexity.  Compare nadvice.el and advice.el.

The main difference seems to me that part of the arguments of
advice.el get pushed into the function that you need to pass
to advice-add.  So the complexity of using it is no more.
Also, you lose the ability to modify the argument values before
the advised function's body.

The doc string of advice-add is incomplete, so I cannot tell
what all its args mean or what it can really do.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 2 Dec 2012 00:03:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 01 19:03:20 2012
Received: from localhost ([127.0.0.1]:48893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tex1i-0008JV-T7
	for submit <at> debbugs.gnu.org; Sat, 01 Dec 2012 19:03:19 -0500
Received: from mail-ee0-f44.google.com ([74.125.83.44]:32990)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <lekktu@HIDDEN>) id 1Tex1f-0008JN-Q4
	for 13023 <at> debbugs.gnu.org; Sat, 01 Dec 2012 19:03:16 -0500
Received: by mail-ee0-f44.google.com with SMTP id b47so1047517eek.3
	for <13023 <at> debbugs.gnu.org>; Sat, 01 Dec 2012 16:01:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=a6EhcgXsXwr68zRNnFChi4A/ZSUTWCyk8eBt+fLv7xw=;
	b=AhxCh7m2ew6baDQtI5Q9D6RMDWowY/45eaDHGfM+DqdQJS8NGmI1eSG7M1BD6GbAUY
	hFVb63/K4A9O1vAU3B4ud0EJUukKyrHFI8S7FV17eRXfpR9DVQqZeKA4X8+15DydMS+U
	T6NmhBwf88Oqq6jle5k2RG3086IgBIYHuOw4YMp3dmtzzmyxQUQaZoXXDih9cxr0YCLi
	AD+KrU8wiiEvlb7rs0R9nlgjhhbM/2sk/aMH0ZZkCtxO+7YeC3tb1Qnwaxg+ovIrmRMt
	b8lD7BJpbtRhTHubU2MhS+P2THhCTx2TrRR+YAUC4oOdsSd9v2AO9jqNvNXYVTiYlVTI
	d5rw==
Received: by 10.14.193.136 with SMTP id k8mr20192258een.30.1354406461338; Sat,
	01 Dec 2012 16:01:01 -0800 (PST)
MIME-Version: 1.0
Received: by 10.223.4.209 with HTTP; Sat, 1 Dec 2012 16:00:20 -0800 (PST)
In-Reply-To: <jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN>
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
	<jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
	<E1TeWvb-0006lO-Uz@HIDDEN>
	<jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN>
From: Juanma Barranquero <lekktu@HIDDEN>
Date: Sun, 2 Dec 2012 01:00:20 +0100
Message-ID: <CAAeL0STJ3xLdUN_RAikw1dhxsKBbZ=ntpaYCmsBfy8bLPmMt7w@HIDDEN>
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.1 (/)

> Even after you
> remove the long comment at the beginning, the difference in code size
> speaks for itself.

Exactly 1,000 lines longer, after removing comments and blank lines:
1,305 vs 305.

(Bored, moi?)

    Juanma




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 1 Dec 2012 04:25:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 30 23:25:32 2012
Received: from localhost ([127.0.0.1]:47752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Teedw-0003s4-KG
	for submit <at> debbugs.gnu.org; Fri, 30 Nov 2012 23:25:32 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:33975)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1Teedu-0003rx-Rg
	for 13023 <at> debbugs.gnu.org; Fri, 30 Nov 2012 23:25:31 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxKh9/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDYhABboJjSaDHgOIQppxgViDBw
X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="208863180"
Received: from 69-196-168-125.dsl.teksavvy.com (HELO pastel.home)
	([69.196.168.125])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	30 Nov 2012 23:23:19 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id 7B7BA59069; Fri, 30 Nov 2012 23:23:19 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: rms@HIDDEN
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
Message-ID: <jwv8v9iz9k5.fsf-monnier+emacs@HIDDEN>
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
	<jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
	<E1TeWvb-0006lO-Uz@HIDDEN>
Date: Fri, 30 Nov 2012 23:23:18 -0500
In-Reply-To: <E1TeWvb-0006lO-Uz@HIDDEN> (Richard Stallman's message
	of "Fri, 30 Nov 2012 15:11:15 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.0 (/)

> Is there something wrong with defadvice?

Yes: complexity.  Compare nadvice.el and advice.el.  Even after you
remove the long comment at the beginning, the difference in code size
speaks for itself.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 30 Nov 2012 20:13:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 30 15:13:25 2012
Received: from localhost ([127.0.0.1]:47466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TeWxh-0006Gf-O3
	for submit <at> debbugs.gnu.org; Fri, 30 Nov 2012 15:13:25 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:42556)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rms@HIDDEN>) id 1TeWxg-0006GX-20
	for 13023 <at> debbugs.gnu.org; Fri, 30 Nov 2012 15:13:24 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rms@HIDDEN>)
	id 1TeWvb-0006lO-Uz; Fri, 30 Nov 2012 15:11:16 -0500
Date: Fri, 30 Nov 2012 15:11:15 -0500
Message-Id: <E1TeWvb-0006lO-Uz@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15
From: Richard Stallman <rms@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwv624n3hb6.fsf-monnier+emacs@HIDDEN> (message from Stefan
	Monnier on Thu, 29 Nov 2012 22:45:01 -0500)
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
	<jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -4.6 (----)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rms@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

    I don't think there's a need to add any new primitive.  If someone wants
    to dig into advice.el to try and fix it, it can be fixed there (as
    evidenced by advice-add).
    I personally would rather tell people to use advice-add instead.

That would, in effect, be an incompatible change in interface.
Why make the change?  Is there something wrong with defadvice?

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 30 Nov 2012 03:47:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 29 22:47:11 2012
Received: from localhost ([127.0.0.1]:45832 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TeHZH-0005WL-79
	for submit <at> debbugs.gnu.org; Thu, 29 Nov 2012 22:47:11 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:35561)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1TeHZC-0005WC-7N
	for 13023 <at> debbugs.gnu.org; Thu, 29 Nov 2012 22:47:06 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxKh9/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDYhABboJjSaDHgOIQppxgViDBw
X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="208794368"
Received: from 69-196-168-125.dsl.teksavvy.com (HELO pastel.home)
	([69.196.168.125])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	29 Nov 2012 22:45:02 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id C3D1A59069; Thu, 29 Nov 2012 22:45:01 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: rms@HIDDEN
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
Message-ID: <jwv624n3hb6.fsf-monnier+emacs@HIDDEN>
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
	<E1TeCvi-0001rJ-Vf@HIDDEN>
Date: Thu, 29 Nov 2012 22:45:01 -0500
In-Reply-To: <E1TeCvi-0001rJ-Vf@HIDDEN> (Richard Stallman's message
	of "Thu, 29 Nov 2012 17:50:02 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.0 (/)

>     Indeed, it doesn't work.  And because of the way advice.el works
>     (building a new function by combining the code chunks from all the
>     pieces of advice applied to that function) it's not easy to fix.
> Would it be possible to fix this by defining a new primitive construct
> for use in the constructed function that runs the advice?

I don't think there's a need to add any new primitive.  If someone wants
to dig into advice.el to try and fix it, it can be fixed there (as
evidenced by advice-add).
I personally would rather tell people to use advice-add instead.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 29 Nov 2012 22:52:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 29 17:52:10 2012
Received: from localhost ([127.0.0.1]:45689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TeCxm-0005Q8-01
	for submit <at> debbugs.gnu.org; Thu, 29 Nov 2012 17:52:10 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:49611)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rms@HIDDEN>) id 1TeCxi-0005Q0-Ph
	for 13023 <at> debbugs.gnu.org; Thu, 29 Nov 2012 17:52:07 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rms@HIDDEN>)
	id 1TeCvi-0001rJ-Vf; Thu, 29 Nov 2012 17:50:03 -0500
Date: Thu, 29 Nov 2012 17:50:02 -0500
Message-Id: <E1TeCvi-0001rJ-Vf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15
From: Richard Stallman <rms@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwv624p58yg.fsf-monnier+emacs@HIDDEN> (message from Stefan
	Monnier on Wed, 28 Nov 2012 23:32:36 -0500)
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
References: <87zk213do1@HIDDEN>
	<jwv624p58yg.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -4.6 (----)
X-Debbugs-Envelope-To: 13023
Cc: 13023 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: rms@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

    Indeed, it doesn't work.  And because of the way advice.el works
    (building a new function by combining the code chunks from all the
    pieces of advice applied to that function) it's not easy to fix.

Would it be possible to fix this by defining a new primitive construct
for use in the constructed function that runs the advince?

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at 13023 <at> debbugs.gnu.org:


Received: (at 13023) by debbugs.gnu.org; 29 Nov 2012 04:34:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 28 23:34:36 2012
Received: from localhost ([127.0.0.1]:44423 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tdvpc-0003J9-AM
	for submit <at> debbugs.gnu.org; Wed, 28 Nov 2012 23:34:36 -0500
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:23341)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1Tdvpb-0003J3-Fr
	for 13023 <at> debbugs.gnu.org; Wed, 28 Nov 2012 23:34:35 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxKh9/2dsb2JhbABEsEiDSYEIghUBAQQBVigLCzQSFBgNiEAFugmNJoMeA4hCmnGBWIMH
X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="208722636"
Received: from 69-196-168-125.dsl.teksavvy.com (HELO pastel.home)
	([69.196.168.125])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	28 Nov 2012 23:32:37 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id BB7FA58B5B; Wed, 28 Nov 2012 23:32:36 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: 13023 <at> debbugs.gnu.org
Subject: Re: bug#13023: 24.3.50; lexical binding does not work within defadvice
Message-ID: <jwv624p58yg.fsf-monnier+emacs@HIDDEN>
References: <87zk213do1@HIDDEN>
Date: Wed, 28 Nov 2012 23:32:36 -0500
In-Reply-To: <87zk213do1@HIDDEN> (Christopher Schmidt's message of
	"Wed, 28 Nov 2012 16:17:17 +0000 (GMT)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13023
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.0 (/)

>     ;; -*- lexical-binding: t -*-
>     (funcall (let ((rms "works"))
>                (lambda ()
>                  (message "lex-bind %s" rms))))

>     (defun asdf (b) (funcall b))

>     (defadvice asdf (before rms (b) activate)
>       (setf b (let ((abc 1) (b b)) (lambda () (print abc) (funcall b)))))

>     (asdf 'ding)

> I think this code should work fine.  It doesn't work with trunk and
> emacs-24, though:

Indeed, it doesn't work.  And because of the way advice.el works
(building a new function by combining the code chunks from all the
pieces of advice applied to that function) it's not easy to fix.

This is partly related to the issue mentioned recently that macro calls
in pieces of advice are expanded late (typically when the advised
function is defined).

BTW, this does not affect the new `advice-add' feature in Emacs trunk.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Nov 2012 16:19:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 28 11:19:41 2012
Received: from localhost ([127.0.0.1]:43862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TdkMO-0000lB-TO
	for submit <at> debbugs.gnu.org; Wed, 28 Nov 2012 11:19:41 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52777)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <christopher@HIDDEN>) id 1TdkMM-0000l3-8H
	for submit <at> debbugs.gnu.org; Wed, 28 Nov 2012 11:19:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1TdkKP-00008s-EO
	for submit <at> debbugs.gnu.org; Wed, 28 Nov 2012 11:17:42 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:39725)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1TdkKP-00008o-BE
	for submit <at> debbugs.gnu.org; Wed, 28 Nov 2012 11:17:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41937)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1TdkKF-0000iq-P3
	for bug-gnu-emacs@HIDDEN; Wed, 28 Nov 2012 11:17:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1TdkK7-000083-VD
	for bug-gnu-emacs@HIDDEN; Wed, 28 Nov 2012 11:17:27 -0500
Received: from ristopher.com ([146.185.21.93]:33891
	helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1TdkK7-00007m-Ml
	for bug-gnu-emacs@HIDDEN; Wed, 28 Nov 2012 11:17:19 -0500
Received: by saturn.ch.ristopher.com (Postfix, from userid 0)
	id 502CF214B1; Wed, 28 Nov 2012 16:17:17 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com;
	s=mail; t=1354119437;
	bh=Fz3CW6E4r0iwEYu/RRIRUxzL2MpJ4eVAko+/LX3DWcU=;
	h=From:To:Subject:Message-ID:MIME-Version:Content-Type:Date;
	b=C7aIORZETXC15X5HMpEUOR2Y9ofH4iDj5b32qfwts8gZ79dkX0XFa9oZbFMItUk+3
	IfSR1IY04VJKFlrEKhA4jf+3INM7kCqPs8g2ocBdalb6m8Xbwg6sExNHkVHnYLQIsN
	0yNtW8rHUrue3+H4o+F2CuTm8+VkchFd4K2qhaRI=
From: Christopher Schmidt <christopher@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50; lexical binding does not work within defadvice
Message-ID: <87zk213do1@HIDDEN>
Mail-Followup-To: bug-gnu-emacs@HIDDEN
MIME-Version: 1.0
Content-Type: text/plain
Date: Wed, 28 Nov 2012 16:17:17 +0000 (GMT)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.2 (----)

    ;; -*- lexical-binding: t -*-

    (funcall (let ((rms "works"))
               (lambda ()
                 (message "lex-bind %s" rms))))

    (defun asdf (b) (funcall b))

    (defadvice asdf (before rms (b) activate)
      (setf b (let ((abc 1) (b b)) (lambda () (print abc) (funcall b)))))

    (asdf 'ding)

I think this code should work fine.  It doesn't work with trunk and
emacs-24, though:

    Load test.elc? (y or n)  y
    Loading test.elc...
    lex-bind works
    Load error for test.elc:
    (void-variable abc)

        Christopher




Acknowledgement sent to Christopher Schmidt <christopher@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#13023; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 2 Feb 2016 20:30:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.