add a hide-prompt function

This commit is contained in:
Sami Samhuri 2009-12-14 00:10:15 -08:00
parent 39a5b52e15
commit f87cfe33d2
2 changed files with 7 additions and 1 deletions

View file

@ -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);

View file

@ -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) {