fixed postColor (class method) and added some text retrieval functions from document. including a informative message that the result has to be retrieved from .currentString

git-svn-id: https://supercollider.svn.sourceforge.net/svnroot/supercollider/trunk@8491 a380766d-ff14-0410-b294-a243070f3f08
This commit is contained in:
Marije Baalman 2009-01-11 17:03:39 +00:00
parent b1416b5330
commit 6e20ea7b5f
2 changed files with 33 additions and 2 deletions

View file

@ -152,12 +152,18 @@ EmacsDocument
}
currentLine { |returnFunc|
Emacs.evalLispExpression(['with-current-buffer', title, ['thing-at-point', '\'line'] ].asLispString, { |result| returnFunc.value( result ) } )
Emacs.evalLispExpression(['sclang-line-at-point'].asLispString, { |result| returnFunc.value( result ) } );
// ['with-current-buffer', title, ['thing-at-point', '\'line'] ].asLispString, { |result| returnFunc.value( result ) } )
^nil;
// '(set-text-properties start end nil)' will remove text properties somehow?
}
currentBlock { |returnFunc|
Emacs.evalLispExpression(['sclang-defun-at-point'].asLispString, { |result| returnFunc.value( result ) } );
^nil;
}
currentWord { |returnFunc|
Emacs.evalLispExpression(['with-current-buffer', title, ['current-word'] ].asLispString, { |result| returnFunc.value( result ) } )
^nil;

View file

@ -250,6 +250,7 @@ ScelDocument : Document{
// cond = Condition.new( { currentString.notNil } );
// cond.wait;
// while ( { currentString.isNil }, {"wait for string".postln;} );
"Asynchronous: retrieve the result with .currentString".postln;
^currentString;
}
@ -260,9 +261,33 @@ ScelDocument : Document{
// cond = Condition.new( { currentString.notNil } );
// cond.wait;
// while ( { currentString.isNil }, {"wait for string".postln;} );
"Asynchronous: retrieve the result with .currentString".postln;
^currentString;
}
currentWord {
// var cond;
currentString = nil;
thisdoc.currentWord( { |v| currentString = v } );
// cond = Condition.new( { currentString.notNil } );
// cond.wait;
// while ( { currentString.isNil }, {"wait for string".postln;} );
"Asynchronous: retrieve the result with .currentString".postln;
^currentString;
}
currentBlock {
// var cond;
currentString = nil;
thisdoc.currentBlock( { |v| currentString = v } );
// cond = Condition.new( { currentString.notNil } );
// cond.wait;
// while ( { currentString.isNil }, {"wait for string".postln;} );
"Asynchronous: retrieve the result with .currentString".postln;
^currentString;
}
text {
^this.string;
}
@ -322,6 +347,6 @@ ScelDocument : Document{
prGetLastIndex {
^this.shouldNotImplement(thisMethod)
}
postColor_{
*postColor_{
}
}