Skip to content

Commit

Permalink
Document how to change to the old startup directory behavior (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Feb 13, 2022
1 parent 55d968f commit 30d574c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
21 changes: 10 additions & 11 deletions lisp/ess-custom.el
Original file line number Diff line number Diff line change
Expand Up @@ -314,22 +314,21 @@ buffer.")
(defvaralias 'ess-directory-function 'ess-startup-directory-function)
(defcustom ess-startup-directory-function nil
"Function to return the directory that ESS is run from.
If nil or if the function returns nil then you get `ess-startup-directory'."
:group 'ess
:type '(choice (const nil) function))

(defcustom ess-setup-directory-function nil
"Function to setup the directory that ESS is run from.
This function can be called to set environment variables or to create
a workspace."
If nil or if the function returns nil then the process will be
started in the project directory (if any), otherwise in
`ess-startup-directory' or, if latter is nil, in
`default-directory'. Set this variable to 'default-directory if
you want to always start the process in the current directory."
:group 'ess
:type '(choice (const nil) function))

(defvaralias 'ess-directory 'ess-startup-directory)
(defcustom ess-startup-directory nil
"The directory ESS is run from. It must end in a slash.
Provided as a default if `ess-ask-for-ess-directory' is non-nil.
A nil value means use the current buffer's default directory."
"The directory ESS is run from.
Must end in a slash. Provided as a default if
`ess-ask-for-ess-directory' is non-nil. A nil value means use the
current buffer's default directory. See also
`ess-startup-directory-function'."
:group 'ess
:type '(choice (const nil) directory))

Expand Down
6 changes: 3 additions & 3 deletions lisp/ess-inf.el
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ process-less buffer because it was created with
;;*;; Requester functions called at startup
(defun inferior-ess--get-startup-directory ()
"Return a startup directory."
(let ((dir (or (and ess-directory-function
(funcall ess-directory-function))
(let ((dir (or (and ess-startup-directory-function
(funcall ess-startup-directory-function))
(when-let ((proj (project-current)))
(ess--project-root proj))
ess-startup-directory
Expand Down Expand Up @@ -2429,7 +2429,7 @@ START-ARGS gets passed to the dialect-specific
;; Make sure we don't ask for directory again
;; Use current working directory as default
(let ((project-find-functions nil)
(ess-directory-function nil)
(ess-startup-directory-function nil)
(ess-startup-directory (ess-get-process-variable 'default-directory))
(ess-ask-for-ess-directory nil))
(ess-quit 'no-save)
Expand Down
3 changes: 1 addition & 2 deletions lisp/ess-sp6-d.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
(inferior-ess-help-command . "help(\"%s\", pager=\"slynx -dump\", window=FALSE)\n")
(inferior-ess-search-list-command . "searchPaths()\n")

(ess-directory-function . S+-directory-function)
(ess-setup-directory-function . S+-setup-directory-function)
(ess-startup-directory-function . S+-directory-function)
(ess-STERM . "iESS"))
S+common-cust-alist)

Expand Down

0 comments on commit 30d574c

Please sign in to comment.