scel: improved guessing of help topics

use `find' and avoid asRelativePath and removeExtension as suggested by
Jonatan Liljedahl.

Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2011-10-02 13:15:52 +02:00
parent 1f339518ab
commit 4597ee238c

View file

@ -204,12 +204,9 @@ EmacsInterface {
dt = { dt = {
result = IdentitySet.new(16384); result = IdentitySet.new(16384);
SCDoc.helpSourceDirs.do {|dir| SCDoc.helpSourceDirs.do {|dir|
var list = ("%/*/*.schelp").format(dir).pathMatch; ("find -L"+dir.escapeChar($ )+"-type f -name '*.schelp' -not -name '*.ext.schelp'")
list = list ++ ("%/*/*/*.schelp").format(dir).pathMatch; .unixCmdGetStdOutLines.do {|file|
list = list ++ ("%/*/*/*/*.schelp").format(dir).pathMatch; result.add(file[dir.size+1 ..].drop(-7))
list = list.collect {|path| path.asRelativePath(dir).removeExtension};
list.do {|topic|
result.add(topic)
} }
}; };