From batholdy@googlemail.com Tue Feb 7 10:31:37 2012 From: Martin Batholdy To: textmate@lists.macromates.com Subject: [TxMt] Re: error messages - R-Bundle Date: Tue, 07 Feb 2012 11:31:32 +0100 Message-ID: In-Reply-To: <450E381B-1F18-489D-A3B8-7C41E422F429@eva.mpg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0801608505951382122==" --===============0801608505951382122== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Dear Hans, Now it happened to me, that a script was actually finished, but the loading-c= ircle of the textmate-window still indicated, that the script is running. (I saw that it actually was finished by the files it generates). I also didn't get any print-messages that were in the code. best, martin On 04.02.2012, at 18:16, Hans-J=C3=B6rg Bibiko wrote: > Hi, >=20 > maybe I found a fix for that issue (at least my test script now runs :) ): >=20 > The new R.tmbundle stuff I host at https://github.com/avian/r.tmbundle/ > thus here the code which should be tested. >=20 > Please replace everything in between >=20 > STDOUT.sync =3D true {... and ...} STDOUT.flush >=20 > in file tmR.rb by: >=20 > STDOUT.sync =3D false > STDERR.sync =3D false >=20 > descriptors =3D [stdout, stderr] > descriptors.each { |fd| fd.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK) } > until descriptors.empty? > select(descriptors).shift.each do |io| > begin > str =3D io.readline > rescue > descriptors.delete io > io.close > break > end > if str.nil? or str.empty? > descriptors.delete io > io.close > elsif io =3D=3D stderr > # just in case > print hideStartMessageJS > print %{#{esc str}} > elsif io =3D=3D stdout > print hideStartMessageJS > str.each_line do |line| > # line counter for top level source > if line.include?("#{linecountermarker}") > linecounter +=3D 1 > line.sub!("#{linecountermarker}", '') > end > # check for a comment sign at the beginning of a line > if line.match(/>\s*#/) > print "#{esc line.chomp}\n" > # check for a comment within a line - regexp should be improved yet! > elsif m=3Dline.match(/(.*?)(#[^"']*)$/) > print esc(m[1]).gsub(/^(>|\+)/,'\1') > print "#{esc(m[2]).chomp}\n" > # check for error messages > elsif m=3Dline.match(/(?i)^\s*(error|erreur|fehler|errore|erro)( |:)= /) > where =3D (isSelection) ? " of selection" : "" > print "#{esc str.gsub(%r{(?m).*?#{m[1]}= },m[1]).chomp}
RMate stopped at line #{linecounter-selectionlinestart}#{where}

"= .gsub(%r{source\("(.*?)"\)},'source("\1")') > print "
" > break > # check for warnings > elsif line.match(/^\s*(Warning|Warning messages?|Message d.avis|Warn= meldung|Messaggio di avvertimento|Mensagem de aviso):/) > print "#{esc line}" > # print line simply with hyperlinked prompt if given > elsif line.match(/_\x8./) > print "#{line.gsub(/_\x8(.)/,'\1')}" > else > print esc(line).gsub(/^[\x0-\x9]?(>|\+)/,'\1') > end > end > end > end > end >=20 > STDOUT.flush >=20 > Feedback is welcome :) >=20 > Cheers, > --Hans >=20 >=20 > _______________________________________________ > textmate mailing list > textmate(a)lists.macromates.com > http://lists.macromates.com/listinfo/textmate --===============0801608505951382122==--