Monday, November 08, 2010 at 12:04 AM.

system.verbs.builtins.op.fullCollapse

on fullCollapse () {
	local (displayon = op.getDisplay ()); //remember current display status
	local (returnedvalue = false); //default, we didn't collapse anything
	op.setDisplay (false); //turn display off
	
	op.firstSummit (); //move bar cursor to first summit
	loop { //collapse each summit, one at a time
		if op.collapse () { //something was actually collapsed
			returnedvalue = true};
		if not op.go (down, 1) { //just collapsed the last summit, move cursor, restore display, return
			op.firstSummit ();
			op.setDisplay (displayon);
			<<window.update (target.get ())
			return (returnedvalue)}}}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.