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


on fullExpand () {
	local (displayon = op.getDisplay ()); <<remember current display status
	local (origcursor= op.getCursor ()); <<save the cursor position, to be restored calling op.setCursor
	local (returnedvalue = false); <<default, we didn't collapse anything
	op.setDisplay (false); <<disable the outline display, hide jumpy cursor motion
	op.firstSummit (); <<move bar cursor to first summit
	loop { <<expand each summit, one at a time
		if op.expand (infinity) { <<something was actually expanded
			returnedvalue = true};
		if not op.go (down, 1) {
			op.setCursor (origcursor); <<restore the cursor
			op.setDisplay (displayon); <<turn the outline display back on
			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.