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

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

flet is obsolete, but...


From: Sebastien Vauban
Subject: flet is obsolete, but...
Date: Wed, 10 Oct 2012 14:39:23 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt)

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


reply via email to

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