On 11/18/2014 11:19 AM, Lars Magne Ingebrigtsen wrote: > Eli Zaretskii writes: > >>> From: Lars Magne Ingebrigtsen >>> Date: Tue, 18 Nov 2014 19:29:02 +0100 >>> Cc: emacs-devel@gnu.org >>> >>> There's a C variable called running_asynch_code, but it's not exposed to >>> Lisp. Unless there's something else in there that can be used, should >>> we just export that to Lisp, like the `noninteractive' variable? >> >> Why do you need that exposed? If you want to know when some Lisp is >> run by a process filter, then make the filter function pass an >> argument to that Lisp saying it's run by a filter. Will that do? > > Passing an argument to this function, which is way way way down in the > call stack, isn't practical. And it would be irrelevant to most of the > url.el code, anyway. > > Being able to discern whether you're running code asynchronously seems > like a generally useful thing. Our goal is to make Emacs more > asynchronous, so we need a way for functions to know what context they > are being run in, so they know what they're allowed to do You can also look at that as making it harder to debug code that magically behaves differently when invoked through the repl or the debugger. Why does this code need to know whether it's being run asynchronously?