emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return value from advice is incorrect?


From: Stefan Monnier
Subject: Re: Return value from advice is incorrect?
Date: Mon, 17 Apr 2006 18:18:12 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> If I replace a function with an around advice the return value
> seems incorrect.

>   (defun test-ad() t)
>   (defadvice test-ad(around test-ad-ad () activate) t)

> After this (test-ad) returns nil. Should it not return t?

The return value is normally the return value from the original function,
unless you change it explicitly, or (as you discovered) unless you don't run
the original function in which case it defaults to nil.

It's kind of inconvenient and/or unexpected, but it's a bit late to change
it,


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]