Subject: Re: bug#12895: 24.3.50; Replacement for flet

From: Antoine Levitt <[email-masked]>
Date: Thu, 15 Nov 2012 23:42:26 +0100

11/15/2012 19:35, Stefan Monnier
>>> Such override should be done with an advice.
>> Unless I'm missing something easier, using an advice would be cumbersome
>> (define the advice, activate it, run the function, then deactivate the
>> advice, protecting for errors). Would you consider un-obsoleting flet?
>> It isn't deprecated by either cl-flet or cl-letf.
>
> Overriding a function is bad.  It can mess things up and throw you
> majorly off-course when debugging the problem.

So are advices. I have lots of flet in my .emacs, usually to suppress
messages from functions which are defined elsewhere. For instance,

(defun my-org-agenda-to-appt ()
  (interactive)
  (flet ((message (&rest args) ))
    (org-agenda-to-appt)))

The point is I do not want to redefine org-agenda-to-appt, because I
don't want to have to maintain a parallel copy of it. To get away with
it without too much effort, I'm just going to have to redefine flet
without the obsolete part in my .emacs, which is suboptimal.