Skip to content

Commit 55d968f

Browse files
committed
[Fix #1185] Move ask-for directory code after ess-r-mode startup
1 parent 5ff4fa8 commit 55d968f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

lisp/ess-inf.el

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,16 @@ This may be useful for debugging."
169169
dialect)
170170
dialect))
171171
(inf-buf (inferior-ess--get-proc-buffer-create temp-dialect))
172-
(proc-name (buffer-local-value 'ess-local-process-name inf-buf))
173-
(cur-dir (inferior-ess--maybe-prompt-startup-directory proc-name temp-dialect))
174-
(default-directory cur-dir))
172+
(proc-name (buffer-local-value 'ess-local-process-name inf-buf)))
175173
(with-current-buffer inf-buf
176174
;; TODO: Get rid of this, we should rely on modes to set the
177175
;; variables they need.
178176
(ess-setq-vars-local customize-alist)
179177
(inferior-ess--set-major-mode ess-dialect)
180178
;; Set local variables after changing mode because they might
181179
;; not be permanent
182-
(setq default-directory cur-dir)
180+
(setq default-directory
181+
(inferior-ess--maybe-prompt-startup-directory proc-name temp-dialect))
183182
(setq inferior-ess--local-data (cons inferior-ess-program start-args))
184183
;; Read the history file
185184
(when ess-history-file
@@ -204,7 +203,7 @@ This may be useful for debugging."
204203
(unless (and proc (eq (process-status proc) 'run))
205204
(error "Process %s failed to start" proc-name))
206205
(when ess-setwd-command
207-
(ess-set-working-directory cur-dir))
206+
(ess-set-working-directory default-directory))
208207
(setq-local font-lock-fontify-region-function #'inferior-ess-fontify-region)
209208
(setq-local ess-sl-modtime-alist nil)
210209
(run-hooks 'ess-post-run-hook)

lisp/ess-r-mode.el

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,6 @@ will be prompted to enter arguments interactively."
588588
inferior-R-args " " ; add space just in case
589589
start-args))
590590
(debug (string-match-p " -d \\| --debugger=" r-start-args))
591-
(project-find-functions (if (memq 'ess-r-project project-find-functions)
592-
project-find-functions
593-
(cons 'ess-r-project project-find-functions)))
594591
use-dialog-box)
595592
(when (or ess-microsoft-p
596593
(eq system-type 'cygwin))

lisp/ess-r-package.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ Set this variable to nil to disable the mode line entirely."
527527
(set (make-local-variable var)
528528
(eval (cdr (assq var ess-r-customize-alist)))))
529529
vars))
530-
(add-hook 'project-find-functions #'ess-r-project)
530+
(add-hook 'project-find-functions #'ess-r-project nil 'local)
531531
(run-hooks 'ess-r-package-enter-hook))
532532
(remove-hook 'project-find-functions #'ess-r-project)
533533
(run-hooks 'ess-r-package-exit-hook)))

0 commit comments

Comments
 (0)