emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el (gmm-flet,


From: Katsumi Yamaoka
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111086: gmm-utils.el (gmm-flet, gmm-labels): New macros.
Date: Wed, 05 Dec 2012 09:14:21 +0900
User-agent: Gnus/5.130006 (真 Gnus v0.6) Emacs/24.3.50 (i686-pc-cygwin)

Katsumi Yamaoka wrote:
[...]
> No, it wasn't appropriate example.  Again I confirmed we have no
> replacement of flet.

> (defun my-message ()
>   (message "Hello"))

> (cl-flet ((message (&rest args) (concat "X " (apply #'format args))))
>   (my-message))
> "Hello"

> (flet ((message (&rest args) (concat "X " (apply #'format args))))
>   (my-message))
> "X Hello"

> Defadvice?  Uhm, that defadvice code exists in an official source
> code is very ugly, I feel. :<

I've temporarily replaced it in this way:

(let ((orig-FUNCTION (symbol-function 'FUNCTION)))
  (fet 'FUNCTION (lambda (arg) new definition))
  (unwind-protect
      (progn bla bla)
    (fset 'FUNCTION orig-FUNCTION)))



reply via email to

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