Skip to content

Commit

Permalink
Fix timestamp printing, make filevariables line configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyio committed Jan 19, 2011
1 parent 03054c3 commit 80546e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/sync.app.src
Expand Up @@ -5,7 +5,13 @@
{registered, []},
{mod, { sync, []}},
{env, [
%% How often to compile (in MS).
{compile_inteval, 1000},

%% http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html#File-Variables
{file_variables, "-*- mode: compilation; mode: auto-revert; buffer-read-only: true; auto-revert-interval: 0.1 -*-\n\n"},

%% Temp file to write output messages.
{out_file, "/tmp/sync.out"}
]}
]}.
4 changes: 2 additions & 2 deletions src/sync_worker.erl
Expand Up @@ -331,8 +331,8 @@ write_sync_out_file() ->
Other ->
File = get_env(out_file, "/tmp/sync.out"),
{{Y,M,D}, {HH,MM,SS}} = calendar:local_time(),
Header = "-*- mode: compilation; mode: auto-revert; buffer-read-only: true; auto-revert-interval: 0.1 -*-\n\n",
Footer = io_lib:format("~n - Updated ~5p-~p-~p ~p\:~p\:~p~n", [Y, M, D, HH, MM, SS]),
Header = get_env(file_variables, ""),
Footer = io_lib:format("~n - Updated ~4.10.0b-~2.10.0b-~2.10.0b ~2.10.0b:~2.10.0b:~2.10.0b~n", [Y, M, D, HH, MM, SS]),
ok = file:write_file(File, [Header, Other, Footer])
end.

Expand Down

0 comments on commit 80546e6

Please sign in to comment.