From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10:16 2012 -0500) Date: Thu, 15 Nov 2012 11:08:44 +0900 Organization: Emacsen advocacy group Message-ID: References: <87haoyl4on.fsf@topper.koldfront.dk> <87625bw1jx.fsf@visionobjects.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1352945362 20599 80.91.229.3 (15 Nov 2012 02:09:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 02:09:22 +0000 (UTC) Cc: asjo@koldfront.dk, ivan.kanis@googlemail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: lekktu@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 15 03:09:32 2012 Return-path: Envelope-to: ged-emacs-devel@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 1TYotU-0004Wz-JZ for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2012 03:09:28 +0100 Original-Received: from localhost ([::1]:51451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYotK-0005rw-LT for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2012 21:09:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYotF-0005rW-Ik for emacs-devel@gnu.org; Wed, 14 Nov 2012 21:09:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYotC-0006LO-Fy for emacs-devel@gnu.org; Wed, 14 Nov 2012 21:09:13 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:48415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYotC-00065X-Ap for emacs-devel@gnu.org; Wed, 14 Nov 2012 21:09:10 -0500 Original-Received: from localhost ([127.0.0.1]:34887) by orlando.hostforweb.net with smtp (Exim 4.77) (envelope-from ) id 1TYoso-0005kb-Jr; Wed, 14 Nov 2012 20:08:47 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.130006 (=?iso-2022-jp?B?GyRCPz8bKEI=?= Gnus v0.6) Emacs/24.3.50 (i686-pc-cygwin) Cancel-Lock: sha1:qe7tucIE5B2Qzv7h8ur/kutxlDs= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] X-Received-From: 216.246.45.90 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154867 Archived-At: --=-=-= Juanma Barranquero wrote: > On Wed, Nov 14, 2012 at 12:18 AM, Katsumi Yamaoka wrote: >> In the latter case I got the following error: >> >> Debugger entered--Lisp error: (wrong-type-argument listp t) >> ad-parse-arglist(t) >> ad-map-arglists(t t) >> ad-make-advised-definition(gnus-article-prepare-display) >> ad-activate-advised-definition(gnus-article-prepare-display nil) >> ad-activate(gnus-article-prepare-display nil) >> (progn (ad-add-advice (quote gnus-article-prepare-display)... > I'm getting this one in advices for functions that aren't yet loaded, > when the advice uses "activate". Easy to see here: > emacs -Q > (defadvice ada-mode (before my-ada activate) t) > Which is perhaps a mistake, but it was previously silently ignored. I'm not quite sure it is in a good manner but the patch for advice.el in the attached diff makes it work in such cases. The other, that is for nadvice.el, is for an advice of which the interactive spec is a string, like this example described in advice.el: (defadvice find-file (before existing-files-only activate) "Find existing files only" (interactive "fFind file: ")) With these changes, so far I can play with Emacs as before. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- advice.el~ 2012-11-13 22:00:19.237409000 +0000 +++ advice.el 2012-11-15 01:42:13.391473100 +0000 @@ -2599,3 +2599,3 @@ ;; Construct the individual pieces that we need for assembly: - (orig-arglist (ad-arglist origdef)) + (orig-arglist (and origdef (ad-arglist origdef))) (advised-arglist (or (ad-advised-arglist function) --- nadvice.el~ 2012-11-14 21:52:40.096113000 +0000 +++ nadvice.el 2012-11-15 01:42:13.391473100 +0000 @@ -131,3 +131,3 @@ (let ((fspec (cadr (interactive-form function)))) - (when (eq 'function (car fspec)) ;; Macroexpanded lambda? + (when (eq 'function (car-safe fspec)) ;; Macroexpanded lambda? (setq fspec (nth 1 fspec))) --=-=-=--