emacs-ess / ESS

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

Apostrophes in comments breaks ess-eval-function #318

Closed plantarum closed 8 years ago

plantarum commented 8 years ago

If I use an apostrophe in a comment:

tmp <- function(){
  ## can't use apostrophes in comments?
  message("hello")
}

And then try to evaluate the function with C-c C-c or C-c C-f, I get the following in my iESS buffer:

+ Error: unexpected symbol in:
".ess.eval('tmp <- function(){
  ## can't"
> hello
> Error: unexpected '}' in "}"

Stepping through the code with C-c C-n works without complaint. Removing the apostrophe works with all three commands:

tmp <- function(){
  ## can comments without apostrophes
  message("hello")
}
lionel- commented 8 years ago

Thanks, this is already fixed on master.

plantarum commented 8 years ago

Should have mentioned:

GNU Emacs 24.5.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.6) of 2016-01-25 ess-version: 15.09-2 patched [elpa: 20160407.414]

This same problem comes up with apostrophes outside of comments:

tmp <- function(){
  plot(1:10, type = 'n')
}
lionel- commented 8 years ago

Please use an even more recent version ;)