From batholdy@googlemail.com Mon Feb 6 00:06:09 2012 From: Martin Batholdy To: textmate@lists.macromates.com Subject: [TxMt] Re: error messages - R-Bundle Date: Mon, 06 Feb 2012 01:06:04 +0100 Message-ID: <3DF925F0-8217-4DB6-8A62-BA6C80D25919@googlemail.com> In-Reply-To: <14993015-7178-46FD-B6E5-5FEC6F41D853@xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4127520973782483383==" --===============4127520973782483383== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Works for me, so far! Thank you very much! Unfortunately, "live updating" of print-messages is not working anymore, righ= t? So if you execute this: library(audio) for(i in 1:10) { =09 wait(1.0) print(i) } =E2=80=A6 the print messages appear after the whole execution is finished and= not after every iteration of the loop. On 05.02.2012, at 15:20, Berend Hasselman wrote: >=20 > On 04-02-2012, at 18:16, Hans-J=C3=B6rg Bibiko wrote: >=20 >> 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 >=20 > I have been running quite a lot of scripts to see what happens now. > No error messages have been issued by Ruby. >=20 > Thanks a lot for finding a fix. >=20 > But to enlighten me/us: what was the cause? >=20 > Berend >=20 >=20 > _______________________________________________ > textmate mailing list > textmate(a)lists.macromates.com > http://lists.macromates.com/listinfo/textmate --===============4127520973782483383==--