Re: [ESS] Trailing slash deleted from find-file prompt
I can fix this by changing ess-synchronize-dirs in ess-inf.el: (defun ess-synchronize-dirs () "Set Emacs' current directory to be the same as the subprocess directory. To be used in `ess-idle-timer-functions'." (when (and ess-can-eval-in-background ess-getwd-command (inferior-ess-available-p)) (ess-when-new-input last-sync-dirs (ess-if-verbose-write "\n(ess-synchronize-dirs)\n") (let ((lpath (car (ess-get-words-from-vector ess-getwd-command (setq default-directory (ess--derive-connection-path default-directory lpath))) default-directory))) Change (let ((lpath (car (ess-get-words-from-vector ess-getwd-command to (let ((lpath (file-name-as-directory (car (ess-get-words-from-vector ess-getwd-command) Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 Room F1-007 x 3147 http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@BrendanTHalpin Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] Trailing slash deleted from find-file prompt
To demonstrate: Starting an R session with M-x R. The comments "# default-directory" are evaluated with C-u C-x C-e. Sourcing a small file doesn't change default-directory, but running it from the buffer with C-c C-r strips the final slash. ess-version: 18.10.3snapshot [elpa: 20210227.2101] (loaded from /home/brendan/.emacs.d/elpa/ess-20210227.2101/) > setwd('/tmp/test/') > # default-directory "/tmp/test/" > ls() character(0) > # default-directory "/tmp/test/" > source("mwe.R") [1] "Start 2021-03-05 10:44:32" [1] "End 2021-03-05 10:44:32" > # default-directory "/tmp/test/" > start <- Sys.time() + print(sprintf("Start %s", start)) + print(sprintf("End %s", Sys.time())) > [1] "Start 2021-03-05 10:44:49" > [1] "End 2021-03-05 10:44:49" > # default-directory "/tmp/test" However, I can't reproduce this all the time: in a fresh emacs session it might not happen to begin with. I have reproduced this in emacs -q, with just: (package-initialize) (require 'ess) as setup, so it's not down to my (extensive) cruft. It may be worth noting that this happens in the *R* buffer, but not the mwe.R buffer (which retains the correct value). Regards, Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 Room F1-007 x 3147 http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@BrendanTHalpin Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] Trailing slash deleted from find-file prompt
Thanks for the hint. They have the values nil (use current) and t (ask) respectively, for the moment. Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 Room F1-007 x 3147 http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@BrendanTHalpin Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
[ESS] Trailing slash deleted from find-file prompt
There is an intermittent problem that I have been observing for a year or two, using ESS: After some time, or some action, in ESS, and I think only in R-mode, the find-file prompt loses its trailing slash, and if you want to complete you need to insert it by hand. I suspect this is due to a re-definition of default-directory by ESS. Am I the only one encountering this? Any ideas how to debug? Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 Room F1-007 x 3147 http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@BrendanTHalpin Papers online at: http://teaching.sociology.ul.ie/bhalpin/publications.html ULSociology on Facebook: Sociology@Limerick twitter:@ULSociology __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help