Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
761 B

4 years ago
  1. ## -*- mode: R -*-
  2. ## loading code which is first sent to R on remote sessions
  3. local({
  4. ver <- '%s' ## <- passed from elisp
  5. root <- '~/.config/ESSR'
  6. if(!file.exists(root))
  7. dir.create(root, recursive = TRUE)
  8. ## cannot use sprintf here
  9. essr_file <- file.path(root, paste('ESSRv', ver, '.rds', sep = ''))
  10. tryCatch({
  11. if(!file.exists(essr_file)) {
  12. url <- paste('https://github.com/emacs-ess/ESS/raw/ESSRv', ver, '/etc/ESSR.rds', sep = '')
  13. utils::download.file(url, essr_file)
  14. }
  15. ESSR <- readRDS(essr_file)
  16. ESSR[[".ess.Rversion"]] <- ESSR[[".ess.getRversion"]]()
  17. attach(ESSR)
  18. print(TRUE)
  19. },
  20. error = function(e) {
  21. print(e)
  22. print(FALSE)
  23. })
  24. })