From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: flet + advised functions Date: Tue, 08 Mar 2011 07:47:57 +0100 Organization: FH-Trier Message-ID: <87sjuyhzvm.fsf@fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299570035 12540 80.91.229.12 (8 Mar 2011 07:40:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Mar 2011 07:40:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 08 08:40:31 2011 Return-path: Envelope-to: geh-help-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 1PwrWx-0007NA-0l for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Mar 2011 08:40:31 +0100 Original-Received: from localhost ([127.0.0.1]:50380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwrWw-0006xz-GN for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Mar 2011 02:40:30 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1299566877 23729 143.93.54.11 (8 Mar 2011 06:47:57 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Tue, 8 Mar 2011 06:47:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:bMho/7YAnX8WESfhju9aI/g0sWQ= Cache-Post-Path: arno.fh-trier.de!unknown@10.249.121.4 X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: usenet.stanford.edu gnu.emacs.help:185724 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79878 Archived-At: I just discovered that `flet' does not work with (some form of) advised functions, such that it doesn't restore the original function. I have found no references to this behaviour on the net, no bug reports either. The results are the same in emacs22/24. I assume, it has been this way for a long time !? (progn (unintern 'foo) (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 -ap