[Rd] edit() doubles backslashes when keep.source=TRUE

Sebastian Meyer @eb@meyer @end|ng |rom |@u@de
Fri May 15 10:47:55 CEST 2020

I can confirm this changed behaviour. I just compared R-3.6.3 with
yesterday's R-devel. Using R-devel, the tempfile opened by the editor
(Emacs for me, but shouldn't matter) contains doubled backslashes.

This could be related to


Best regards,


Am 15.05.20 um 03:50 schrieb William Dunlap via R-devel:
> Is it just my installation or does edit() (or fix(), etc.) in R-4.0.0
> double all the backslashes when options(keep.source=TRUE)?  E.g.,
>> options(keep.source=TRUE)
>> f <- function(x) { cat("\t", x, "\n", sep="") }
>> edit(f) # exit the editor without making any changes
> The editor (vi or notepad) shows doubled backslashes
>     function(x) { cat("\\t", x, "\\n", sep="") }
> as does the return value of edit().
> If I set options(keep.source=FALSE) before defining 'f' or remove t's
> 'srcref' attribute then the backslashes are left alone.
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list