William Dunlap
2020-May-15 01:50 UTC
[Rd] edit() doubles backslashes when keep.source=TRUE
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 changesThe 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]]
Sebastian Meyer
2020-May-15 08:47 UTC
[Rd] edit() doubles backslashes when keep.source=TRUE
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 https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17800 Best regards, Sebastian 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 at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Martin Maechler
2020-May-15 13:41 UTC
[Rd] edit() doubles backslashes when keep.source=TRUE
>>>>> Sebastian Meyer >>>>> on Fri, 15 May 2020 10:47:55 +0200 writes:> 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 > https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17800 Yes, indeed, I'm sure this is the same; an inadvertent bug indeed. > Best regards, > Sebastian ... and "just the usual" <whining> Why does nobody anymore help R development by working with "R-devel", or at least then the alpha, beta and the "RC" (Release Candidate) versions that we release daily for about one month before the final release? Notably a highly staffed enterprise such as Rstudio (viz the bug report 17800 above), but also others could really help by starting to use the "next version" of R on a routine basis ... <whining/> Still: Thank you, of course, Bill Dunlap, and Sebastian and Jonathan (PR 17800) Martin > 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
Tomas Kalibera
2020-May-20 11:03 UTC
[Rd] edit() doubles backslashes when keep.source=TRUE
Thanks for reporting this, it is a bug, now fixed in R-devel and R-patched (PR#17800). Best Tomas On 5/15/20 3:50 AM, William Dunlap via R-devel wrote:> 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 at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Reasonably Related Threads
- Testing before release (was: edit() doubles backslashes when keep.source=TRUE)
- edit() doubles backslashes when keep.source=TRUE
- edit() doubles backslashes when keep.source=TRUE
- Testing before release (was: edit() doubles backslashes when keep.source=TRUE)
- edit() doubles backslashes when keep.source=TRUE