From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ndemmel@gmail.com Newsgroups: gmane.emacs.help Subject: Re: flet, cl-flet, cl-letf in 24.3 Date: Sun, 21 Apr 2013 02:49:02 -0700 (PDT) Message-ID: References: <5c1e7b99-1d04-46fe-a0d0-3709a468add7@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1366545861 3480 80.91.229.3 (21 Apr 2013 12:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Apr 2013 12:04:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 21 14:04:25 2013 Return-path: Envelope-to: geh-help-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 1UTt0K-0007Gy-Qn for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Apr 2013 14:04:24 +0200 Original-Received: from localhost ([::1]:41113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTt0J-0006S2-Qv for geh-help-gnu-emacs@m.gmane.org; Sun, 21 Apr 2013 08:04:23 -0400 X-Received: by 10.224.18.133 with SMTP id w5mr2895501qaa.1.1366537743058; Sun, 21 Apr 2013 02:49:03 -0700 (PDT) X-Received: by 10.49.59.48 with SMTP id w16mr648425qeq.3.1366537743037; Sun, 21 Apr 2013 02:49:03 -0700 (PDT) Original-Path: usenet.stanford.edu!gp5no797640qab.0!news-out.google.com!ef9ni2qab.0!nntp.google.com!gp5no4141500qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.75.75.160; posting-account=MrzOPQoAAAADHmNl_-Qkvaq87JqsOJwW Original-NNTP-Posting-Host: 92.75.75.160 User-Agent: G2/1.0 Injection-Date: Sun, 21 Apr 2013 09:49:03 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:198018 X-Mailman-Approved-At: Sun, 21 Apr 2013 08:04:13 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90285 Archived-At: On Sunday, April 21, 2013 9:41:11 AM UTC+2, Drew Adams wrote: > > it seems that from 24.3 on flet is marked as obsolete, to be > > > replaced by cl-flet or cl-letf. If you are fine with lexical > > > scope, cl-flet is your friend. However, I did not find > > > explicit documentation on what to do when you want to keep > > > relying on the dynamic scope as with the old flet. Is > > > (cl-letf (((symbol-function 'foo) #'(lambda (...) ...))) ...) > > > the suggested method? Does that give always have dynamic > > > scope? I'm a bit confused. > > > > If you have read the doc and you feel it does not make things clear, consider > > filing a doc bug: `M-x report-emacs-bug'. I don't even have emacs 24.3 installed. I'm referring to the documentation [1,2,3,4]. Together with the notification `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. as reported here [5], this documentation does not really tell me what to do if I want to keep relying on the dynamic scoping of flet. A brief google search [6] leads me to believe that (cl-letf (((symbol-function 'foo) #'(lambda (...) ...))) ...) is the suggested solution, however I wanted to make sure that is the case. In any case if that were the sugggested way, it should maybe be added to one of the documentation sites [1,2,3,4]. I'd be happy to file a report on that. Cheers, Niko [1] http://www.gnu.org/software/emacs/manual/html_node/cl/Function-Bindings.html#index-cl_002dflet-24 [2] http://www.gnu.org/software/emacs/manual/html_node/cl/Obsolete-Macros.html#index-flet-173 [3] http://www.gnu.org/software/emacs/manual/html_node/cl/Obsolete-Macros.html#index-letf-175 [4] http://www.gnu.org/software/emacs/manual/html_node/cl/Modify-Macros.html#index-cl_002dletf-19 [5] https://github.com/moesenle/rosemacs-debs/issues/2 [6] https://groups.google.com/forum/#!msg/gnu.emacs.help/eaopyFH5hmY/emHfn-DYZZIJ