emacs-devel
[Top][All Lists]
Advanced

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

Re: problems with flet on last emacs


From: Andreas Röhler
Subject: Re: problems with flet on last emacs
Date: Mon, 12 Nov 2012 09:02:53 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121025 Thunderbird/16.0.2

Am 11.11.2012 00:38, schrieb Stefan Monnier:
(let ((saved (symbol-function 'foo)))
   (unwind-protect
       (progn
         (fset 'foo #'(lambda ()
                        (message "bar!")))
         (meta-foo))
     (fset 'foo saved)))

Same problem as with flet: the redefinition is hard to find, dynamically
scoped, etc...

Better use

    (defvar foo-bar nil)
    (defadvice foo (around blabla activate)
      (if foo-bar (message "bar!") ad-do-it))

and then

    ...
    (let ((foo-bar t))
      ...)

So C-h f foo RET will tell you about the redefinition and you can
recover the non-redefined behavior with a simple (setq foo-bar nil).


         Stefan



Hi Stefan,

while looking with interest and delight at new features, what about make for 
that process a similar change as was made with bug-tracking.
IMO the decision-making process might be done in a more structured way than now 
- by keeping the final instances.

Best,

Andreas











reply via email to

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