Re: [PATCH] emacs: Avoid deprecated function flet

Subject: Re: [PATCH] emacs: Avoid deprecated function flet

Date: Mon, 20 May 2013 12:45:41 -0300

To: Austin Clements, notmuch@notmuchmail.org

Cc:

From: David Bremner


Austin Clements <amdragon@MIT.EDU> writes:

> flet was deprecated in Emacs 24.3 and replaced with cl-flet.  However,
> cl-flet lexically binds the function symbol, while we depend on flet
> dynamically binding the function symbol.  Hence, this patch replaces
> the deprecated flet use with letf, which lets us dynamically bind the
> function symbol, while remaining compatible with both Emacs 23 and 24.

The bad news: letf is also marked as obsolete, although there is no
yelling from the byte-compiler yet.

In my simple tests, it _seemed_ to work to replace letf with cl-letf,
although

- that would require some kind of compatability alias
- the docstring for letf mutters something about "deprecated usage of
  `symbol-function' in place forms.

On the third hand, 

   http://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Generalized-Variables.html#Setting-Generalized-Variables 

suggests using symbol-function with setf is legitimate.

Thread: