help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Redefining functions and variables


From: Elena
Subject: Re: Redefining functions and variables
Date: Wed, 08 Dec 2010 15:21:45 -0000
User-agent: G2/1.0

On Jul 29, 9:57 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> Just as is the case for `defun', redefining macros with `defmacro'
> is problematic.  I really recommend not to do that and use defadvice
> instead, which was designed specifically for this purpose.

Do you mean macros can be adviced too? Something like this (it does
not compile):

(defadvice defun (before redefinition-warning activate)
        (let ((name (ad-get-arg 0)))
         (when (and load-file-name
                                (fboundp (symbol name)))
                 (message "Warning: %s is being redefined in %s."
                                  (symbol-name name)
                                  load-file-name))))

?





reply via email to

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