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: Stefan Monnier
Subject: Re: Redefining functions and variables
Date: Wed, 08 Dec 2010 15:21:22 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I've noticed that some user contributed packages redefine standard
> functions or variables.

That's usually a bad idea.  The better way to do it is via defadvice,
which lets you do it in a way that keeps track of the presence of such
a change and knows how to combine multiple such changes.

> I wonder whether there is a way to catch such redefinitions whenever
> they happen (which also would help when accidentally redefining
> something)

Not sure what you mean by that.  I guess that means "no".

> Moreover, I wonder whether redefining a function by means of "defun"
> gets same results as assigning a new function to a symbol using
> "fset".

Mostly, yes.  But defun keeps track of the file where the defun happened
(for things like C-h f), whereas fset doesn't do any such thing.


        Stefan


reply via email to

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