[Top][All Lists]

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

in batch or during test

From: Phillip Lord
Subject: in batch or during test
Date: Tue, 21 Apr 2015 12:13:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Is there a way to discover if Emacs is being run in batch and/or running
a test?

I have a package that uses "after-change-functions" and several other
"self-niling" hooks. If I have a bug in my package, the hook function
automatically gets removed, leaving the package in an inconsistent state
(because one hook may have gone but the others remain). So instead I use
"condition-case" to catch any errors and disable the entire package
(i.e. all of the hook functions) if an error occurs.

This works well, but unfortunately effectively swallows the backtrace.
Particularly annoying when I am running automated tests. So, I want to
write a macro like `condition-case-unless-debug' but which is "unless
running in batch or running ert". But I don't know how to find out if I
am in batch or running ert!


reply via email to

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