all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Mastro <john.b.mastro@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Cc: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: flet vs cl-flet vs compilation-start
Date: Wed, 1 Feb 2017 15:49:03 -0800	[thread overview]
Message-ID: <CAOj2CQRsDMi0hTnu8tO3WAG=t+LNk3aTgU=d6OjnCkxROCKwNw@mail.gmail.com> (raw)
In-Reply-To: <86mve51o6v.fsf@stephe-leake.org>

Stephen Leake <stephen_leake@stephe-leake.org> 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 ...))



  reply	other threads:[~2017-02-01 23:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 23:33 flet vs cl-flet vs compilation-start Stephen Leake
2017-02-01 23:49 ` John Mastro [this message]
2017-02-02  9:16 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOj2CQRsDMi0hTnu8tO3WAG=t+LNk3aTgU=d6OjnCkxROCKwNw@mail.gmail.com' \
    --to=john.b.mastro@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.