You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently have project.el integration for R packages as part of ess-r-package.el and we have experimental support for starting R in project root here
Proposal:
Add project.el support for arbitrary R projects (those containing .Rprofile or XYZ.Rproj)
Make R (and others) start in project root by default
Once the above is done can look into session management functionality as provided by sesman (#914, #1172 cc @tpeacock19).
@lionel- proposed (2.) years ago and if I recall correctly we even tried it once, but there were a few edge cases. I think the edge cases are really edge and the benefits outweigh the drawbacks.
A quick local hack which works for me
;;;*;;; Project detection
(defvar-local ess-r-project--info-cache nil"Current package info cache.See `ess-r-project-info' for its structure.")
(defuness-r-project (&optionaldir)
"Return the current project as an Emacs project instance.R project is a directory containing either .Rprofile or XYZ.Rprojfile. Return a list of the form (:name \"XYZ\" :root\"/path/to/project\"). If DIR is provided, the project issearched from that directory instead of `default-directory'."
(let ((info (ess-r-project-info dir)))
(when (car info)
(cons'ess-r-project (plist-get info :root)))))
(cl-defmethod project-roots ((project (head ess-r-project)))
"Return the project root for ESS R projects."
(list (cdr project)))
(cl-defmethod project-root ((project (head ess-r-project)))
"Return the project root for ESS R projects."
(cdr project))
(defuness-r-project-info (&optionaldir)
"Get the description of the R project in directory DIR.Return an plist with the keys :name and :root. When not in aproject return '(nil). This value is cached buffer-locally forefficiency reasons."
(if (and (null dir)
(car ess-r-project--info-cache))
ess-r-project--info-cache
(let ((dir (locate-dominating-file (or dir
(buffer-file-name)
default-directory)
".Rprofile")))
(when dir
(let ((dir (directory-file-name dir)))
(setq ess-r-project--info-cache
(list:name (file-name-nondirectory dir) :root dir)))))))
The text was updated successfully, but these errors were encountered:
We currently have project.el integration for R packages as part of ess-r-package.el and we have experimental support for starting R in project root here
Proposal:
.Rprofile
orXYZ.Rproj
)Once the above is done can look into session management functionality as provided by sesman (#914, #1172 cc @tpeacock19).
@lionel- proposed (2.) years ago and if I recall correctly we even tried it once, but there were a few edge cases. I think the edge cases are really edge and the benefits outweigh the drawbacks.
A quick local hack which works for me
The text was updated successfully, but these errors were encountered: