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

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

Re: Undo defalias


From: Óscar Fuentes
Subject: Re: Undo defalias
Date: Tue, 28 Feb 2023 16:56:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Gregory Heytings <gregory@heytings.org> writes:

>>
>> Somehow `message' ended aliased to `ignore':
>>
>> C-h f message
>>
>> message is an alias for ‘ignore’.
>> ...
>>
>> To repair this damage (without restarting Emacs) usually I would go
>> to the definition of `message' and evaluate it, but this function is
>> defined in C.
>>
>> How could I bind back `message' to its original function definition?
>>
>
> (defmacro undefalias (symbol)
>   `(progn
>      (fset ,symbol (cadr (get ,symbol 'function-history)))
>      (put ,symbol 'function-history (cddr (get ,symbol 'function-history)))))

Thank you. It didn't work on the affected Emacs session ( (message "foo)
throwed "Symbol’s function definition is void: message"), most likely
because of my previous attempts of fixing it, but it works on emacs -Q.




reply via email to

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