all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: lekktu@gmail.com
Cc: asjo@koldfront.dk, ivan.kanis@googlemail.com,
	monnier@iro.umontreal.ca, emacs-devel@gnu.org
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	[thread overview]
Message-ID: <b4my5i3pqhf.fsf@jpl.org> (raw)
In-Reply-To: CAAeL0SQPjZJVACamjiNnNeg3UH5AHoJDWTqcEAqoAi0rA7d6ew@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

Juanma Barranquero wrote:
> On Wed, Nov 14, 2012 at 12:18 AM, Katsumi Yamaoka <yamaoka@jpl.org> 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)  <C-x C-e>

> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 692 bytes --]

--- 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)))

  reply	other threads:[~2012-11-15  2:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 23:47 Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10:16 2012 -0500) Adam Sjøgren
2012-11-10  1:55 ` Stefan Monnier
2012-11-11 21:24   ` Tim Cross
2012-11-12 10:36 ` Ivan Kanis
2012-11-13 11:09   ` Katsumi Yamaoka
2012-11-13 14:34     ` Stefan Monnier
2012-11-13 23:18       ` Katsumi Yamaoka
2012-11-14 16:19         ` Juanma Barranquero
2012-11-15  2:08           ` Katsumi Yamaoka [this message]
2012-11-15  3:30             ` Stefan Monnier
2012-11-15  9:00               ` Ivan Kanis
2012-11-15 10:55                 ` Katsumi Yamaoka
2012-11-15 14:39                   ` Stefan Monnier
2012-11-15 23:01                     ` Katsumi Yamaoka
2012-11-16 14:16                       ` Stefan Monnier
2012-11-16 16:33                         ` Juanma Barranquero
2012-11-16 17:25                           ` Stefan Monnier
2012-11-16 17:36                             ` Juanma Barranquero
2012-11-16 18:11                             ` Stefan Monnier
2012-11-16 18:17                               ` Juanma Barranquero
2012-11-16 20:11                                 ` Stefan Monnier
2012-11-16 23:52                                   ` Juanma Barranquero
2012-11-19  1:29                                     ` Stefan Monnier
2012-11-19  2:36                                       ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4my5i3pqhf.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=asjo@koldfront.dk \
    --cc=emacs-devel@gnu.org \
    --cc=ivan.kanis@googlemail.com \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.