From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: flet vs cl-flet vs compilation-start Date: Thu, 02 Feb 2017 10:16:15 +0100 Message-ID: <8737fxkl5s.fsf@drachen> References: <86mve51o6v.fsf@stephe-leake.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486027071 14228 195.159.176.226 (2 Feb 2017 09:17:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2017 09:17:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 02 10:17:47 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZDWU-0003TP-Vg for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 10:17:47 +0100 Original-Received: from localhost ([::1]:55428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZDWa-0006ba-Gv for ged-emacs-devel@m.gmane.org; Thu, 02 Feb 2017 04:17:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZDWU-0006bU-VE for emacs-devel@gnu.org; Thu, 02 Feb 2017 04:17:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZDWO-0002dS-Mm for emacs-devel@gnu.org; Thu, 02 Feb 2017 04:17:46 -0500 Original-Received: from mout.web.de ([212.227.15.3]:64058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cZDWO-0002br-D8 for emacs-devel@gnu.org; Thu, 02 Feb 2017 04:17:40 -0500 Original-Received: from drachen.dragon ([88.67.100.180]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M1G6y-1cJbOS0aHQ-00t8kN; Thu, 02 Feb 2017 10:16:16 +0100 In-Reply-To: <86mve51o6v.fsf@stephe-leake.org> (Stephen Leake's message of "Wed, 01 Feb 2017 17:33:28 -0600") X-Provags-ID: V03:K0:UNL+VKcMYl8PVMhL3nepWoRF52XKGrPJHY//EMjAywXcIeHRdEd WiqacFDUwboLZ+lWdX4dUSZefq+0e9IHyrNnfMVIgw768a4T0B0J9ha7Kzbkemkt+TtXb5p CGSwhB2GBUFauCUjDiMeepRMDHVoypmqKlHBwFA7Wj6mr1aBH6oNEXcdK0Dl0QWAVTgiuRo tBc1ZYtk/mBRLiTEelYPQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:vI/taWP8aKc=:KnghIUGjYEpvZLU1Z2wveX l+w+x9jN41gf1dWbYC33rXPOwAr8KO8nW2W1AexKCBv7EI7vnTZhottypc/XIJI+1bwF+weR7 p6mOG3tnq8uAi7kb02eeonzcL5PbGBI3a1ghAVWmLablVUojjjHh1+RpPIL0Zulr4USk4IeIV YOLMcTkYGyndPVbdTdZ9vgcv9gys4QLtKy7aoPV/5LlanFK62T7E1AZU6Sg8voJuOhmsOwhaI sjjQBQEA4VDL8QPoPAvsrcdX2FOrlmvuYGNAyznFQQryc7sUS5umZFYRzQ8c9SQG2jBgRSZka 80Z/FFxm4P58zjpOTFHdpthJ0G5QDlsYK96J2HG7+Yd0IyYXsH/de6kHgOg8Yn37qAEe8PFTO +92HxzR0mB+OgVQ5FYY0F6H1Ab533NJnkQMgDshxJ8DE4EaEjPZ+7qaBPXwpFzsLnHEPiwu4C eQ6nGgY6TqqwEVl8j9253Et+MSzIg0IAXg2fCQgYe0qdagCoCQ6jEwVdjYZC8KdymkpSGfbTg nCTUiRaKjGL75HOo6v5OCmvNunl/3tMo1/oaW7TGV2fuWfsEfNBrFiemAL/xH3ikAbivIc22p hxqukuEtlT+ZOWJDD7ygZQ2H9C0oS2/E3dres31PMpNKf9bU5dRDa71esiH+0NFiz+g+zhxbN LSrlb3TLTAA/mQVKDmeUnPACWLygS5LRU7OfSsCfOxPX+/+/jQRY1deVg6OSnhBMmlJaiFZEE emSJWOQ7vOppwKmSknIIGmojEGThKkkYYDP6qssIS9KDfYFB2guONi+xaZBS0FdssxGW+NcU X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:211863 Archived-At: Stephen Leake writes: > I'm using compilation-mode to show results from running an external > program; it produces output that looks like compilation errors (it's > actually cross-reference info). > > Some users would like to preserve output from several calls to the > external program. > > compilation-start does not provide an option for this; it calls > (erase-buffer) unconditionally. > > So someone suggested this hack: > > (require 'cl) > (flet ((erase-buffer nil (goto-char (point-max)))) > (compilation-start ... )) > > That works, but produces byte-compiler warnings about cl and flet. > > So I tried: > > (require 'cl-lib) > (cl-flet ((erase-buffer nil (goto-char (point-max)))) > (compilation-start ... )) > > This does _not_ work. Apparently in the "flet" case, the local > definition of 'erase-buffer' overrides the global one, but in the > 'cl-flet' case it does not. The cause is that the function bindings created by cl-flet and cl-labels have lexical scope. And that is documented. As already has been mentioned, as a last resort, use cl-letf in such cases. Michael.