emacs-devel
[Top][All Lists]
Advanced

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

Re: Temporarily disable `timer-event-handler'


From: Stefan Monnier
Subject: Re: Temporarily disable `timer-event-handler'
Date: Tue, 04 Feb 2020 19:53:31 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> But there can also be cases where A does want/need B to be processed
>> before A ends.
>
> Nonetheless, given the availability of dynamic binding, I find this
> error-prone.  Is there currently a way in Emacs Lisp to run a function 
> within a separate stack,

Yes and no.  Until "recently" the answer was clearly no, and now it's
kinda possible but not in a really nice way:
- using threads (which are not always available, so it can only be used 
conditionally).
- using `backtrace-eval` which will temporarily undo part of the
  currently installed dynamic bindings (as well as
  `with-current-buffer`s and `save-excursion`s, IIRC) before evaluating
  an expression.

> Additionally, I believe the solution to fulfill
>> The expectation is that `B' strictly runs after `A' finishes execution.
> is also missing.

Yup!

> Some sort of macro (aka `ignore-timers') which essentially
> forbids yielding during the execution of the enclosed body,

No, remember: Emacs is a Lisp machine, aka a kind of OS, so this would
mean that application A hogs the whole machine just because it wants to
prevent B from running.

Instead we need something more specific which lets A delay B without
delaying other, unrelated, events.


        Stefan




reply via email to

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