[ESS-bugs] OOps! ESS partly fails in non-English locales!

Martin Maechler maechler at stat.math.ethz.ch
Fri Jul 29 12:57:42 CEST 2005


Uaah! That's really pretty problematic.

I've been using and advocation the use of  C-c C-l
(ess-load-file, also "Load File" (2nd from top) in the ESS menu).

And have started wondering why it didn't work for me, in case
the source()ing of the file gave errors:


Then found the following  *ESS-errors* buffer
----------------------------------------------------------------------------
Fehler in parse(file, n = -1, NULL, "?") : Syntaxfehler in Zeile 274
----------------------------------------------------------------------------

and only later realized that we are searching for a match with

    ess-dump-error-re  which is set to "[Ee]rror"

hence no match in the above German language error buffer, hence
the (to me) most important useful feature of C-c C-l fails.

As a work around, we could start adding the translations of the
word "Error" to the  ess-dump-error-re variable  -- and that's
what I have now done, here locally -- assuming either English or
German or language where "error" is translated with something
like "errore" where no change is needed.

A nicer solution would however a bit more complicated,
namely have ESS call R in a way to produce an error and find the
corresponding word in the error message - e.g. assuming it would
come first, at least for something like the above  "Error in ...".

BTW: Running everything inside a try(...) is not a solution IMO,
     since that will not run correctly all R code which uses
     try(.) itself.

At the moment I think it would be great if there was an R way of
saying ``set LC_MESSAGES to C for the time being'' . This would
require that R has both the standard English and the 'locale'
messages loaded - or loadable during runtime. 
Currently, LC_MESSAGES cannot be changed from
inside R but must be set before R is started.
I have now idea how hard / inefficient / ... the above proposal
would be, but can imagine that this would be desirable in other
situations as well.  If this seems like a good idea, Kurt and I
should take it to R-core.

Actually , the issue is even larger: We have other places where
we assume English for 'LC_MESSAGES', e.g., in

(defvar ess-R-message-prefixes
  '("Error:" "Error in"
    "Warning:" "Warning in"
    "Warning messages?"))

but this only affects font-locking AFAICS.

Martin




More information about the ESS-bugs mailing list