unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* flet is obsolete, but...
@ 2012-10-10 12:39 Sebastien Vauban
  2012-10-10 13:17 ` Jambunathan K
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sebastien Vauban @ 2012-10-10 12:39 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello,

`flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.

But doing so in the following code:

--8<---------------cut here---------------start------------->8---
  (defun my/revert-buffer ()
    "Unconditionally revert current buffer."
    (interactive)
    (flet ((yes-or-no-p (msg) t))
      (revert-buffer)))
--8<---------------cut here---------------end--------------->8---

does not lead to the right things:

- use cl-flet, and the code doesn't behave as it should (i.e., it does ask for
  a confirmation, before reverting)

- use cl-letf, and you've got an error:
  cl-letf: `let' bindings can have only one value-form: yes-or-no-p, (msg), t

What should I do?

Best regards,
  Seb

-- 
Sebastien Vauban


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

end of thread, other threads:[~2012-10-11 15:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 12:39 flet is obsolete, but Sebastien Vauban
2012-10-10 13:17 ` Jambunathan K
2012-10-10 13:18 ` Jambunathan K
2012-10-10 14:31 ` Barry Margolin
2012-10-11 14:55   ` Sebastien Vauban
     [not found] ` <mailman.10697.1349875031.855.help-gnu-emacs@gnu.org>
2012-10-11  8:04   ` Sebastien Vauban
2012-10-11  8:10     ` Tassilo Horn
2012-10-11  8:17     ` Jambunathan K
2012-10-11 13:48     ` Drew Adams
2012-10-11 14:33       ` Ludwig, Mark
2012-10-11 15:18         ` `f5' for refreshing/reverting without confirmation [was: flet is obsolete, but...] Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).