Subject: Re: bug#8206: 24.0.50; flet breaks advised functions

From: Alex <[email-masked]>
Date: Wed, 07 Sep 2016 22:14:37 -0600

close 8206 24.4
quit

Andreas Politz <[email-masked]> writes:

> I just discovered that `flet' does not work with (at least some form of)
> advised functions, such that it doesn't restore the original function.
> The underlying problem is demonstrated by the following code and seems
> to date back to at least Version 22.3.1 .
>
> (progn
>   (defun foo () 'defun)
>   (defadvice foo (around foo activate)
>     ad-do-it)
>   (setq letf-save (symbol-function
>                    ;;'ad-Orig-foo
>                    'foo
>                    ))
>   (fset 'foo (lambda nil 'flet))
>   (fset 'foo letf-save)
>   (foo))
>
> => flet

This results in 'defun' since at least 24.4, so I'm closing this as fixed.