all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: in batch or during test
Date: Tue, 21 Apr 2015 05:08:20 -0700 (PDT)	[thread overview]
Message-ID: <8c9c772b-9c7a-45f8-8cb8-b4626cc7effc@googlegroups.com> (raw)
In-Reply-To: <mailman.1261.1429614787.904.help-gnu-emacs@gnu.org>

On Tuesday, April 21, 2015 at 4:43:09 PM UTC+5:30, Phil Lord wrote:
> 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!
> 
> Phil

Maybe you want the variable 'noninteractive'?
(info "(elisp)batch mode")


       reply	other threads:[~2015-04-21 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1261.1429614787.904.help-gnu-emacs@gnu.org>
2015-04-21 12:08 ` Rusi [this message]
2015-04-21 14:39   ` in batch or during test Phillip Lord
2015-04-21 19:21 ` Ted Zlatanov
2015-04-21 11:13 Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c9c772b-9c7a-45f8-8cb8-b4626cc7effc@googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.