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

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

Re: Undo defalias


From: Stefan Monnier
Subject: Re: Undo defalias
Date: Fri, 03 Mar 2023 10:49:57 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> Depends on how it got set to `ignore` (you can try exiting from
>> a recursive edit or a minibuffer), but in many cases it's impossible: the
>> #<subr message> object may simply not be reachable from anywhere any
>> more :-(
> It is: see the short POC code I posted.

The POC you posted works only if `message` was redefined in some
particular way, such as when a loading a file that has

    (defalias 'message #'ignore)

but then it wouldn't be the result of a bug but of deliberate harm :-)
AFAIK most cases where `message` can end up aliased to `ignore` is when
you have code doing

    (cl-letf (((symbol-function 'message) #'ignore))
      ...)

In that case, the previous value won't be found in `function-history`.
As for why is the `ignore` rebinding is still active...


        Stefan




reply via email to

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