From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.bugs Subject: bug#12895: 24.3.50; Replacement for flet Date: Thu, 15 Nov 2012 16:01:58 +0100 Message-ID: <87lie27vvd.fsf@gmail.com> References: <87a9uj9efm.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352991749 25870 80.91.229.3 (15 Nov 2012 15:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2012 15:02:29 +0000 (UTC) Cc: 12895@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 15 16:02:40 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1TZ0xj-0004ws-46 for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Nov 2012 16:02:39 +0100 Original-Received: from localhost ([::1]:48429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ0xZ-00071G-Ci for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Nov 2012 10:02:29 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ0xU-00070p-5v for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2012 10:02:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZ0xR-0001zk-3X for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2012 10:02:24 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ0xQ-0001zg-W4 for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2012 10:02:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TZ0y5-0000Tq-NW for bug-gnu-emacs@gnu.org; Thu, 15 Nov 2012 10:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Antoine Levitt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Nov 2012 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12895 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12895-submit@debbugs.gnu.org id=B12895.13529917661825 (code B ref 12895); Thu, 15 Nov 2012 15:03:01 +0000 Original-Received: (at 12895) by debbugs.gnu.org; 15 Nov 2012 15:02:46 +0000 Original-Received: from localhost ([127.0.0.1]:45328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZ0xo-0000TN-P4 for submit@debbugs.gnu.org; Thu, 15 Nov 2012 10:02:45 -0500 Original-Received: from mail-we0-f172.google.com ([74.125.82.172]:56928) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZ0xm-0000TF-SN for 12895@debbugs.gnu.org; Thu, 15 Nov 2012 10:02:44 -0500 Original-Received: by mail-we0-f172.google.com with SMTP id u46so586846wey.3 for <12895@debbugs.gnu.org>; Thu, 15 Nov 2012 07:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=OP3/astNxRzNvczB3bu9Awixa4T9o2MdlS4uUceAT6U=; b=LCJMFGue+xsnpcRFCVM7y6STCnsr/SVkcDonTXrK0Tk3YNs+zsawVmx+sSLZ55hkPA xsl8c/cWklp3Yp5ccK8btF3NiVee9MuSaMbivL/AfdteGpacqkZQD1Aye4+MdV8D0X+X 1xSPck4f4qLJJ07G5+kYhRh2ahSZWkST4HkGYSeTdGFou3sJ1M55KbpynaGOLiNMUNiw a3wzsCQp3Amdjir02Vw8d2pXKWyzMS+XQ+z2Hls3bKXUtD0LmSPlajHzZ7zLdIiVhI8q QZv9wV7hFljWW12NpOg3fWqxvcVUn+6ckRXFcRGJwCla+E+4ngLyK2MtwuRzpvPEuN4l tIgQ== Original-Received: by 10.180.24.193 with SMTP id w1mr169409wif.22.1352991720363; Thu, 15 Nov 2012 07:02:00 -0800 (PST) Original-Received: from sigma ([194.214.160.170]) by mx.google.com with ESMTPS id hv4sm28004988wib.0.2012.11.15.07.01.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 07:01:59 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 15 Nov 2012 09:46:19 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: -0.7 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66960 Archived-At: 11/15/2012 15:46, Stefan Monnier >> (defun something () >> (message "hi")) >> (letf ((message (lambda () (&rest args) nil))) >> (something)) >> Is this because message is a built-in? > > No, it's because what you want is not a local function, but an override > of an existing function. Ah, sorry. Letf redirects to cl-letf, which says Temporarily bind to PLACEs. This is the analogue of `let', but with generalized variables If it excludes overrides, I think it should say so explicitely. Right now I'm led to think it's like let for functions, and I've been using let for overriding just fine. > Such override should be done with an advice. Unless I'm missing something easier, using an advice would be cumbersome (define the advice, activate it, run the function, then deactivate the advice, protecting for errors). Would you consider un-obsoleting flet? It isn't deprecated by either cl-flet or cl-letf.