From 1a20478bbcec1c98c065553b4b0d4ccaec96b24a Mon Sep 17 00:00:00 2001 From: Chris Bernard Date: Sat, 29 May 2010 21:16:51 -0400 Subject: Add Emacs EUnit feature: auto-save If the variable 'erlang-eunit-autosave' is non-nil, buffers will be automatically saved just before running tests -- the "Do you want to save?" prompt will be inhibited. This can be useful, reducing the save-compile-load-test cycle to just one keychord. --- lib/tools/emacs/erlang-eunit.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/tools/emacs') diff --git a/lib/tools/emacs/erlang-eunit.el b/lib/tools/emacs/erlang-eunit.el index 803c26c5b1..4952ab7d2e 100644 --- a/lib/tools/emacs/erlang-eunit.el +++ b/lib/tools/emacs/erlang-eunit.el @@ -33,6 +33,10 @@ if there is no match.") a source file. The first directory in the list will be used, if there is no match.") +(defvar erlang-eunit-autosave nil + "*Set to non-nil to automtically save unsaved buffers before running tests. +This is useful, reducing the save-compile-load-test cycle to one keychord.") + ;;; ;;; Switch between src/EUnit test buffers ;;; @@ -271,7 +275,7 @@ With prefix arg, compiles for debug and runs tests with the verbose flag set." ;; below, is to ask the question about saving buffers only once, ;; instead of possibly several: one for each file to compile, ;; for instance for both x.erl and x_tests.erl. - (save-some-buffers) + (save-some-buffers erlang-eunit-autosave) (flet ((save-some-buffers (&optional any) nil)) ;; Compilation of the source file is mandatory (the file must -- cgit v1.2.3