[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flet vs cl-flet vs compilation-start
From: |
John Mastro |
Subject: |
Re: flet vs cl-flet vs compilation-start |
Date: |
Wed, 1 Feb 2017 15:49:03 -0800 |
Stephen Leake <address@hidden> wrote:
> This is consistent with the doc strings:
>
> cl-flet says:
>
> Make local function definitions.
>
> flet says:
>
> Make temporary overriding function definitions.
>
> and goes on to say "use cl-flet".
>
> Perhaps the doc string of flet should be improved to point out that
> cl-flet does not produce _overriding_ function definitions, and suggest
> workarounds.
It's not as well known, but you can use `cl-letf' for this:
(cl-letf (((symbol-function 'erase-buffer)
(lambda () (goto-char (point-max)))))
(compilation-start ...))