1

I am using Emacs 25.1.1 with spacemacs. Everytime I run iESS, I get the warning about locale as,

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 

I have tried the solution from followings,

https://stackoverflow.com/questions/30264526/why-does-my-ess-r-session-fall-back-to-c-locale

https://stackoverflow.com/questions/9689104/installing-r-on-mac-warning-messages-setting-lc-ctype-failed-using-c

But the problem is still there. The strange this about this problem is that, when I run emacs with -nw switch (on terminal) I get no error, but when I open it with frame, I get the error.

Please help me with this!

My R session info when I run emacs with frame is,

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.2

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.3.2 tools_3.3.2   

and in terminal without frame is,

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.2

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.3.2 tools_3.3.2   
  • You posted the same question on StackOverflow. Please do not do that - choose one or the other site. Please delete one of the duplicate questions. – Drew Dec 30 '16 at 17:27
  • When you run "emacs -nw", do you use the old Emacs 22 (which comes bundled with macOS), or do you explicitly start Emacs 25? What is the content of process-environment, does it differ in any way from the default environment in a terminal? – Lindydancer Jan 10 '17 at 11:45
  • No, they both are same version. I have solved this problem by setting up Environment variable for emacs shell from init file. ` (exec-path-from-shell-copy-env "LC_ALL") (exec-path-from-shell-copy-env "LANG")`. Any way thank you for your concern. – TheRimalaya Jan 10 '17 at 16:34
1

For other persons who are having the same problem, I just want to answer my own question. I solved this issue by setting copying the shell environment to emacs as,

(exec-path-from-shell-copy-env "LC_ALL")
(exec-path-from-shell-copy-env "LANG")

Thank you, everyone, for your help. I got my answer from https://stat.ethz.ch/pipermail/r-sig-mac/2015-October/011701.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.