From 4597ee238c1f0d3274e435c03a4157719337ed87 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 2 Oct 2011 13:15:52 +0200 Subject: [PATCH] scel: improved guessing of help topics use `find' and avoid asRelativePath and removeExtension as suggested by Jonatan Liljedahl. Signed-off-by: Tim Blechmann --- sc/Emacs.sc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sc/Emacs.sc b/sc/Emacs.sc index fdae1b9..3087933 100644 --- a/sc/Emacs.sc +++ b/sc/Emacs.sc @@ -204,12 +204,9 @@ EmacsInterface { dt = { result = IdentitySet.new(16384); SCDoc.helpSourceDirs.do {|dir| - var list = ("%/*/*.schelp").format(dir).pathMatch; - list = list ++ ("%/*/*/*.schelp").format(dir).pathMatch; - list = list ++ ("%/*/*/*/*.schelp").format(dir).pathMatch; - list = list.collect {|path| path.asRelativePath(dir).removeExtension}; - list.do {|topic| - result.add(topic) + ("find -L"+dir.escapeChar($ )+"-type f -name '*.schelp' -not -name '*.ext.schelp'") + .unixCmdGetStdOutLines.do {|file| + result.add(file[dir.size+1 ..].drop(-7)) } };