emacs-devel
[Top][All Lists]
Advanced

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

Re: Async package.el


From: Artur Malabarba
Subject: Re: Async package.el
Date: Thu, 9 Apr 2015 15:50:43 +0100

>> I need to find a
>> way of telling #'message   not to talk when called from an async
>> task  -- or more generally, if called from anything except the main UI
>> thread. Any ideas?
>
> Is something like this too hackish?
>
> (cl-letf (((symbol-function 'message) 'ignore))
>          whatever)
>

This is generally what I do too. IIRC, the only drawback is that this
uses unwind-protect, which is not triggered by the max-lisp-eval-depth
error. So if you hit that error, message's function definition won't
be restored.
You can either just live with that, or you can wrap the code inside
the `cl-letf' in a `condition-case' statement and to catch that error.



reply via email to

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