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:
parent
4597ee238c
commit
3e5cf00140
2 changed files with 5 additions and 21 deletions
|
@ -216,21 +216,8 @@ low-resource systems."
|
||||||
'symbolTable
|
'symbolTable
|
||||||
(lambda (arg)
|
(lambda (arg)
|
||||||
(when (and sclang-use-symbol-table arg)
|
(when (and sclang-use-symbol-table arg)
|
||||||
(let ((file sclang-symbol-table-file))
|
(setq sclang-symbol-table (sort arg 'string<))
|
||||||
(when (and file (file-exists-p file))
|
(sclang-update-font-lock))))
|
||||||
(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))))))))
|
|
||||||
|
|
||||||
(add-hook 'sclang-library-startup-hook
|
(add-hook 'sclang-library-startup-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
@ -45,8 +45,7 @@ EmacsInterface {
|
||||||
var result, dt;
|
var result, dt;
|
||||||
|
|
||||||
dt = {
|
dt = {
|
||||||
result = IdentitySet.new;
|
result = IdentitySet(16384);
|
||||||
|
|
||||||
Class.allClasses.do { | class |
|
Class.allClasses.do { | class |
|
||||||
if (class.isMetaClass.not) {
|
if (class.isMetaClass.not) {
|
||||||
result.add(class.name);
|
result.add(class.name);
|
||||||
|
@ -56,14 +55,12 @@ EmacsInterface {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
File.use(fileName, "w", { | file |
|
result = result.collectAs(_.asString, Array)
|
||||||
result.collectAs(_.asString, Array).storeLispOn(file);
|
|
||||||
});
|
|
||||||
}.bench(false);
|
}.bench(false);
|
||||||
|
|
||||||
"Emacs: Built symbol table in % seconds\n".postf(dt.asStringPrec(3));
|
"Emacs: Built symbol table in % seconds\n".postf(dt.asStringPrec(3));
|
||||||
|
|
||||||
true
|
result
|
||||||
})
|
})
|
||||||
.put(\openDefinition, { | name |
|
.put(\openDefinition, { | name |
|
||||||
var class, method, res;
|
var class, method, res;
|
||||||
|
|
Loading…
Reference in a new issue