From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jo=E3o_T=E1vora?= Newsgroups: gmane.emacs.devel Subject: Re: problems with flet on last emacs Date: Sat, 10 Nov 2012 23:07:05 +0000 Message-ID: References: <87pq8lnd7v.fsf@gmail.com> <87zk7oq5qr.fsf@kuiper.lan.informatimago.com> <871ul0j5ac.fsf@visionobjects.com> <877gurgae5.fsf@gmail.com> <87mx3m7jyd.fsf@googlemail.com> <8762aaljzd.fsf@gmail.com> <87ehohfkxo.fsf@kanis.fr> <871ukhhqua.fsf@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352588855 991 80.91.229.3 (10 Nov 2012 23:07:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 23:07:35 +0000 (UTC) Cc: emacs-devel@gnu.org, Ivan Kanis , Thierry Volpiatto To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 11 00:07:45 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 1TXK9Q-00086U-VF for ged-emacs-devel@m.gmane.org; Sun, 11 Nov 2012 00:07:45 +0100 Original-Received: from localhost ([::1]:57782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXK9H-0004vz-4c for ged-emacs-devel@m.gmane.org; Sat, 10 Nov 2012 18:07:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXK9C-0004vT-7l for emacs-devel@gnu.org; Sat, 10 Nov 2012 18:07:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXK99-00088K-5S for emacs-devel@gnu.org; Sat, 10 Nov 2012 18:07:30 -0500 Original-Received: from mail-da0-f41.google.com ([209.85.210.41]:51607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXK98-00088A-UE for emacs-devel@gnu.org; Sat, 10 Nov 2012 18:07:27 -0500 Original-Received: by mail-da0-f41.google.com with SMTP id i14so2296811dad.0 for ; Sat, 10 Nov 2012 15:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=ad7xwC/2C6HlWdugZt48Ao9F9LlWBxKFtfz23EQjmwI=; b=ZC73WKzotmEZ2/eX+rfrOT2Uatche4RfIzMzCMiuN0BtPy+JLV9OjD63gsKYAluV3U RvoD+0BZlKyLmITBLFDzYBKyDZMmVXFH+E+v2B+85pygiLHEAfFZLqJ3xRQZetBbnaLX Igg5NfYOtVhhGhVTuIm22ffv3P5SaPEnXqOm4zTk/3MqT36ufkFAeQqcQERpWMavkIDV UI8kURO8YGYYM3WrmDFgF9n231Vpq63OaPyXAQHYWyPmifXF+wcXQiojAgcmJ01fC5Rl 7s6a2sCXXljkLdURhnaWjsq/4KbQiwDOeWhmHasRRvsRWgHsYlwWa2vqjS27/WV0+G/5 nEoQ== Original-Received: by 10.68.137.198 with SMTP id qk6mr45602624pbb.60.1352588845808; Sat, 10 Nov 2012 15:07:25 -0800 (PST) Original-Received: by 10.66.231.40 with HTTP; Sat, 10 Nov 2012 15:07:05 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.41 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:154812 Archived-At: On Sat, Nov 10, 2012 at 10:46 PM, Stefan Monnier wrote: > No, cl-flet is like Common-Lisp's `flet', i.e. lexically scoped, like > `labels', but without the mutual-recursion. If you want the "function > redefinition" behavior, you need defadvice. Hmmm, OK, good to know that then, but 'defadvice' feels strange, what's the problem with using a combo of 'fset', 'symbol-function' and 'unwind-protect'? Something like (defun foo () (message "foo")) (defun meta-foo () (foo)) (let ((saved (symbol-function 'foo))) (unwind-protect (progn (fset 'foo #'(lambda () (message "bar!"))) (meta-foo)) (fset 'foo saved))) -- Jo=E3o T=E1vora