GNU bug report logs - #12895
24.3.50; Replacement for flet

Previous Next

Package: emacs;

Reported by: Antoine Levitt <antoine.levitt <at> gmail.com>

Date: Thu, 15 Nov 2012 13:37:02 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Marcin Borkowski <mbork <at> mbork.pl>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 12895 <at> debbugs.gnu.org
Cc: Antoine Levitt <antoine.levitt <at> gmail.com>
Subject: bug#12895: 24.3.50; Replacement for flet
Date: Fri, 16 Nov 2012 02:21:03 +0100
Hi,

> I'm trying to dynamically bind a function, and used flet
> previously. flet is now apparently obsolete. The docstring suggests
> using cl-flet. But cl-flet does lexical binding, not dynamic. How do I
> get the old behavior (dynamic binding) without using the now-obsolete
> flet? I'm confused by the number of subtly different functions to do the
> same thing - letf, flet, labels, cl-labels, cl-letf, cl-flet - and find
> the docstrings to be unclear. If I understand correctly, letf is what I
> need, but the following does not do what I expect it to (ie suppress the
> message)

No general answer to your question, but something like this my be good
enough for what you want:

(defmacro suppressing-messages (&rest body)
  `(let (message-log-max)
     (with-temp-message ""
       ,@body)))


Michael.




This bug report was last modified 9 years and 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.