From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8457: 24.0.50; defadvice with BODY referencing args by name: void-var error Date: Sat, 9 Apr 2011 09:45:13 -0700 Message-ID: <21C5BDEF1EBA475C86898667CFA8E409@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1302368856 25841 80.91.229.12 (9 Apr 2011 17:07:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2011 17:07:36 +0000 (UTC) To: 8457@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 09 19:07:32 2011 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.69) (envelope-from ) id 1Q8bdD-0003EM-EC for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Apr 2011 19:07:31 +0200 Original-Received: from localhost ([127.0.0.1]:39024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8bdB-0000o4-2O for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Apr 2011 13:07:29 -0400 Original-Received: from [140.186.70.92] (port=44126 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8bd5-0000nz-JY for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 13:07:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8bd3-0007Oz-Tv for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 13:07:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8bd3-0007Ou-R7 for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 13:07:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q8bIQ-0006RB-1x; Sat, 09 Apr 2011 12:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Apr 2011 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8457 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.130236752524699 (code B ref -1); Sat, 09 Apr 2011 16:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Apr 2011 16:45:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8bHp-0006QK-C6 for submit@debbugs.gnu.org; Sat, 09 Apr 2011 12:45:25 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8bHm-0006Q5-7i for submit@debbugs.gnu.org; Sat, 09 Apr 2011 12:45:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8bHg-00035d-7w for submit@debbugs.gnu.org; Sat, 09 Apr 2011 12:45:16 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:53626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8bHg-00035Y-2d for submit@debbugs.gnu.org; Sat, 09 Apr 2011 12:45:16 -0400 Original-Received: from [140.186.70.92] (port=40496 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8bHf-0001fY-7l for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 12:45:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8bHe-00035G-Ao for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 12:45:15 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:57387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8bHe-00035B-4e for bug-gnu-emacs@gnu.org; Sat, 09 Apr 2011 12:45:14 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p39GjBHH002809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 9 Apr 2011 16:45:12 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p39GjAco024593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Apr 2011 16:45:11 GMT Original-Received: from abhmt010.oracle.com (abhmt010.oracle.com [141.146.116.19]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p39Gj9Bc027137 for ; Sat, 9 Apr 2011 11:45:10 -0500 Original-Received: from dradamslap1 (/10.159.37.106) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 09 Apr 2011 09:45:09 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Thread-Index: Acv21X8TA5MxxoYxQ/W9DznEdN1W3A== X-Source-IP: acsmt358.oracle.com [141.146.40.158] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4DA08D17.0057:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 09 Apr 2011 12:46:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , 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:45711 Archived-At: (elisp) `Argument Access in Advice' says that you should be able to access the args using the original names: "The simplest way to access the arguments of an advised function in the body of a piece of advice is to use the same names that the function definition uses. To do this, you need to know the names of the argument variables of the original function." This should work, and it works prior to the move to lexbind(?), at least. I have this defadvice: (defadvice narrow-to-region (before push-wide-n-restrictions activate) "Push the region limits to `wide-n-restrictions'. You can use `C-x n x' to widen to a previous buffer restriction." (when (or (interactive-p) wide-n-push-anyway-p) (wide-n-push start end))) START and END are the original arg names. Yes, the doc also says that this method of referring to args is not the most robust. Still, it has worked in general but no longer does. This is the error: Debugger entered--Lisp error: (void-variable start) (wide-n-push start end) (progn (wide-n-push start end)) (if (or (interactive-p) wide-n-push-anyway-p) (progn (wide-n-push start end))) (when (or (interactive-p) wide-n-push-anyway-p) (wide-n-push start end)) (let (ad-return-value) (when (or (interactive-p) wide-n-push-anyway-p) (wide-n-push start end)) (setq ad-return-value (apply (quote ad-Orig-narrow-to-region) arg1 arg2 rest)) ad-return-value) narrow-to-region(8268 9972) call-interactively(narrow-to-region nil nil) Just a guess: this has to do with the move to lexbind. In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2011-04-04 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/imagesupport/include'