Mayeul KAUFFMANN
2004-Aug-19 23:33 UTC
[Rd] Unbalanced parentheses printed by warnings() crash text editor
Hello everyone, Hope it is the good place for this (I discuss the question of the right place below). Most of the time, warnings are more than 1000 characters long and thus are truncated. Most of the time, this generates printouts with unbalanced parentheses. Intelligent text editors which do parentheses highlighting get very confused with this. After too many warnings, they give errors, and may even crash. Specifically, I use ESS and XEmacs for Windows Users of R (by John Fox) which is advised to do at http://ess.r-project.org/ with a buffer for text editing and an inferior ESS (R) buffer. (I downloaded the latest Xemacs and ESS a month ago). After too many warnings (with unbalanced parentheses), Xemacs swithes to an ESS-error buffer which says "error Nesting too deep for parser". In some case, when back in R buffer, typing any letter switches back to the ESS-error Buffer. In other case, it simply takes ages (until you kill Xemacs) or it crashes. In most case, the R process is lost. I could have sent this to the ESS or Xemacs devel list, but ESS & Xemacs' attempt to find balanced parentheses accross many lines seems sensible, and is needed with very long functions. A workaround would be to change the function that print warnings. Instead of, for instance, "error message xxxxxxxxxx in: function.yyyyyy(zzzzzzzzz,zzzzzzz, ..." It may print "error message xxxxxxxxxx in: function.yyyyyy(zzzzzzzzz,zzzzzzz, ...)" The function should truncate the error message, find how many parenthesis and brackets are open in the remaining part, substract the number of closing parenthesis and brackets, and add that many parenthesis at the end. (Xemacs parentheses highligher regards "(" and "[" as equivalent) Mayeul KAUFFMANN Univ. Pierre Mendes France Grenoble - France
Duncan Murdoch
2004-Aug-20 11:53 UTC
[Rd] Unbalanced parentheses printed by warnings() crash text editor
On Thu, 19 Aug 2004 23:32:51 +0200, "Mayeul KAUFFMANN" <mayeul.kauffmann@tiscali.fr> wrote:>Hope it is the good place for this (I discuss the question of the right >place below).I don't think so.>Most of the time, warnings are more than 1000 characters long and thus are >truncated. >Most of the time, this generates printouts with unbalanced parentheses. > >Intelligent text editors which do parentheses highlighting get very >confused with this. >After too many warnings, they give errors, and may even crash.As far as I know, this only affects one "intelligent" text editor. It's clearly an ESS/XEmacs bug, not a natural thing for an editor to do.>I could have sent this to the ESS or Xemacs devel list, but ESS & Xemacs' >attempt to find balanced parentheses accross many lines seems sensible, >and is needed with very long functions.Yes, it's sensible to try, but it is a bug that they don't fail gracefully. Duncan Murdoch