all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#12895: 24.3.50; Replacement for flet
@ 2012-11-15 13:35 Antoine Levitt
  2012-11-15 14:46 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Antoine Levitt @ 2012-11-15 13:35 UTC (permalink / raw)
  To: 12895

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





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-02-09 20:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 13:35 bug#12895: 24.3.50; Replacement for flet Antoine Levitt
2012-11-15 14:46 ` Stefan Monnier
2012-11-15 15:01   ` Antoine Levitt
2012-11-15 18:35     ` Stefan Monnier
2012-11-15 22:42       ` Antoine Levitt
2012-11-15 23:05         ` Glenn Morris
2012-11-15 23:24           ` Antoine Levitt
2012-11-15 23:44             ` Glenn Morris
2012-11-15 23:47               ` Antoine Levitt
2012-11-15 23:51                 ` Glenn Morris
2012-11-16 14:34         ` Stefan Monnier
2012-11-16 14:49           ` Antoine Levitt
2012-11-16 15:24             ` Stefan Monnier
2016-01-31 17:42             ` Michael Heerdegen
2016-02-09 20:36               ` Antoine Levitt
2012-11-16  7:04   ` Katsumi Yamaoka
2012-11-16 14:33     ` Stefan Monnier
2012-11-16  1:21 ` Michael Heerdegen
2016-01-31 14:19 ` bug#12895: Status: " Marcin Borkowski
2016-01-31 16:51   ` Eli Zaretskii
2016-01-31 17:10     ` Marcin Borkowski

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.