emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
620 stars 162 forks source link

ess-load-file in Stata: "command source is unrecognized" #529

Closed mm3509 closed 6 years ago

mm3509 commented 6 years ago

Hello,

I set up ESS to work with Stata. I open a script and can load it into iESS with C-c C-b (or with M-x ess-eval-buffer, or with the toolbar ESS > ESS eval > Eval buffer). But C-c C-l (or M-x ess-load-file, or the toolbar ESS > Load file) runs this:

. source('.../test.do')
command source is unrecognized

Line 1147 in ess-inf.el calls (format ess-load-command file) and the description of the variable ess-load-command is:

ess-load-command is a variable defined in ‘ess-custom.el’.
Its value is "source('%s')

Should it be dialect-specifc, i.e. be do "%s" in ESS[Stata] mode?

vspinu commented 6 years ago

Yes. It should. PR's are welcome. What is the load command in stata? I think none of core developers use stata anymore, so we wouldn't know.

izahn commented 6 years ago

Stata provides do "file" which is like source("file", echo = TRUE) in R, and run "file" which is like source("file"). Either one could be used. I'll submit a PR shortly.

mm3509 commented 6 years ago

Thanks!