bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12895: 24.3.50; Replacement for flet


From: Antoine Levitt
Subject: bug#12895: 24.3.50; Replacement for flet
Date: Thu, 15 Nov 2012 14:35:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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)

(defun something ()
  (message "hi"))

(letf ((message (lambda () (&rest args) nil)))
  (something))

Is this because message is a built-in?

Sorry if this has been covered elsewhere, I couldn't find it.

Antoine





reply via email to

[Prev in Thread] Current Thread [Next in Thread]