[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] findHelpFile on non-osX



On Tuesday 04 December 2007 17:08:51 Till Bovermann wrote:
> Is there a version of String:findHelpFile for non-osx (i.e. windows,
> linux)?
>
> If not we (Eckard and me) implemented one [1]. Anyone think that thos
> could be of usage? I'm a bit unsure where to put it, though... I
> don't know the conventions for platform-dependecy classes good enough...
> BtW, it also works on osx... (not that we should use it there, we
> already have a primitive for it :-)

There is one for Scel, which uses the el-search routine.
But not for non-scel on Linux.

btw, some external classes may still have old style helpfiles lying around, 
which are of the type .rtf, .help.sc or .help.scd.

sincerely,
Marije

>
> regards
> Till
>
> [1]
>
> // 2007, lfsaw.de, eriedenklau   ( We like recursive programming :-)
> + String {
> 	findHelpFile {
> 		var result = nil;
> 		[Platform.helpDir, Platform.userExtensionDir,
> Platform.systemExtensionDir].do{|path|
> 			result = this.prFindHelpFile(path);
> 			result.notNil.if{^result}
> 		}
> 		^result
> 	}
>
> 	prFindHelpFile {|startPath|
> 		var sym, parts, result = nil, paths, res;
>
> 		paths = "%%*".format(startPath, Platform.pathSeparator).pathMatch;
> 		result = paths.detect{|path|
> 			var basename, extension;
> 			basename = path.basename.split($.).first;
> 			extension = path.split($.).last;
> 	  		PathName(path).isFile && {basename == this && {extension ==
> "html"} }
> 	 	};
> 	  	result.isNil.if({
> 			paths.do {|path|
> 	     		res = this.prFindHelpFile(path);
> 	     		res.notNil.if{^res}
> 			};
> 	  	});
> 	  	^result;
> 	}
> }
> _______________________________________________
> Sc-devel mailing list
> Sc-devel@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-devel