scel: avoid temporary file for symbol table

the symbol table can simply be passed via the command fifo, there is no
need for using a temporary file.

Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2011-10-02 11:20:06 +02:00
parent 4597ee238c
commit 3e5cf00140
2 changed files with 5 additions and 21 deletions

View file

@ -216,21 +216,8 @@ low-resource systems."
'symbolTable
(lambda (arg)
(when (and sclang-use-symbol-table arg)
(let ((file sclang-symbol-table-file))
(when (and file (file-exists-p file))
(with-current-buffer (get-buffer-create (sclang-make-buffer-name "SymbolTable" t))
(erase-buffer)
(unwind-protect
(insert-file-contents file)
(delete-file file))
(setq sclang-symbol-table-file nil)
(goto-char (point-min))
(let ((table (condition-case nil
(read (current-buffer))
(error nil))))
(unless table (sclang-message "Couldn't retrieve symbol table."))
(setq sclang-symbol-table (sort table 'string<))
(sclang-update-font-lock))))))))
(setq sclang-symbol-table (sort arg 'string<))
(sclang-update-font-lock))))
(add-hook 'sclang-library-startup-hook
(lambda ()

View file

@ -45,8 +45,7 @@ EmacsInterface {
var result, dt;
dt = {
result = IdentitySet.new;
result = IdentitySet(16384);
Class.allClasses.do { | class |
if (class.isMetaClass.not) {
result.add(class.name);
@ -56,14 +55,12 @@ EmacsInterface {
};
};
File.use(fileName, "w", { | file |
result.collectAs(_.asString, Array).storeLispOn(file);
});
result = result.collectAs(_.asString, Array)
}.bench(false);
"Emacs: Built symbol table in % seconds\n".postf(dt.asStringPrec(3));
true
result
})
.put(\openDefinition, { | name |
var class, method, res;