[Top][All Lists]

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

How do I wait, or sit-for, until a hook is run?

From: Eduardo Ochs
Subject: How do I wait, or sit-for, until a hook is run?
Date: Thu, 29 Dec 2022 18:41:05 -0300

Hi list,

I am trying to write a function (my-sly-wait) that can be put here,

  (save-window-excursion (sly) (my-sly-wait))

and that only returns when the hook `sly-mrepl-hook' is run...

How do I write that? Or, if I can ask for something nicer... how do I
write a function like that that waits for at most 30 seconds
displaying all output like a `sit-for' (?), and returns without errors
if the hook `sly-mrepl-hook' is run, but yields an error if that hook
is not run in 30 seconds?

I spent some time trying to figure out how to do that using
`add-hook', `remove-hook', `catch', `throw', `unwind-protect' and
`sit-for', and then I realized that if I asked this question here then
probably someone would answer with "look at code for foo in the
package bar"...

  Thanks in advance!
    Eduardo Ochs

P.S.: my reasons for wanting/needing that are here:

reply via email to

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