From bhh@xs4all.nl Sun Feb 5 14:20:48 2012 From: Berend Hasselman To: textmate@lists.macromates.com Subject: [TxMt] Re: error messages - R-Bundle Date: Sun, 05 Feb 2012 15:20:47 +0100 Message-ID: <14993015-7178-46FD-B6E5-5FEC6F41D853@xs4all.nl> In-Reply-To: <450E381B-1F18-489D-A3B8-7C41E422F429@eva.mpg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2516051598918090595==" --===============2516051598918090595== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 :) I have been running quite a lot of scripts to see what happens now. No error messages have been issued by Ruby. Thanks a lot for finding a fix. But to enlighten me/us: what was the cause? Berend --===============2516051598918090595==--