From f87cfe33d2b9f52566fde25a7c5611966da7a9bc Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Mon, 14 Dec 2009 00:10:15 -0800 Subject: [PATCH] add a hide-prompt function --- el/primitives.js | 4 ++++ el/repl.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/el/primitives.js b/el/primitives.js index 282ed6f..2a5f1a4 100644 --- a/el/primitives.js +++ b/el/primitives.js @@ -123,5 +123,9 @@ EL.definePrimitive('print', ['x'], return EL.nil; }, "print an expression"); + +EL.definePrimitive('hide-prompt', ['yes-or-no'], + function(bool){ EL.hidePrompt = !EL.isNil(bool); }, + "Call with T to hide the prompt or nil to show it."); }; EL.initHook(EL._definePrimitives); \ No newline at end of file diff --git a/el/repl.js b/el/repl.js index 0a04f0c..25b41d9 100644 --- a/el/repl.js +++ b/el/repl.js @@ -31,7 +31,9 @@ EL.repl = function() { var p = new EL.Parser(), e = new EL.Evaluator(); while (true) { - print("elisp> "); // i don't want a newline, grrrr + if (!EL.hidePrompt) { + print("elisp> "); // i don't want a newline, grrrr + } try { var line = readline(); while (!line) {