Skip to content

Commit

Permalink
[Fix #1185] Move ask-for directory code after ess-r-mode startup
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Feb 3, 2022
1 parent 5ff4fa8 commit 55d968f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lisp/ess-inf.el
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,16 @@ This may be useful for debugging."
dialect)
dialect))
(inf-buf (inferior-ess--get-proc-buffer-create temp-dialect))
(proc-name (buffer-local-value 'ess-local-process-name inf-buf))
(cur-dir (inferior-ess--maybe-prompt-startup-directory proc-name temp-dialect))
(default-directory cur-dir))
(proc-name (buffer-local-value 'ess-local-process-name inf-buf)))
(with-current-buffer inf-buf
;; TODO: Get rid of this, we should rely on modes to set the
;; variables they need.
(ess-setq-vars-local customize-alist)
(inferior-ess--set-major-mode ess-dialect)
;; Set local variables after changing mode because they might
;; not be permanent
(setq default-directory cur-dir)
(setq default-directory
(inferior-ess--maybe-prompt-startup-directory proc-name temp-dialect))
(setq inferior-ess--local-data (cons inferior-ess-program start-args))
;; Read the history file
(when ess-history-file
Expand All @@ -204,7 +203,7 @@ This may be useful for debugging."
(unless (and proc (eq (process-status proc) 'run))
(error "Process %s failed to start" proc-name))
(when ess-setwd-command
(ess-set-working-directory cur-dir))
(ess-set-working-directory default-directory))
(setq-local font-lock-fontify-region-function #'inferior-ess-fontify-region)
(setq-local ess-sl-modtime-alist nil)
(run-hooks 'ess-post-run-hook)
Expand Down
3 changes: 0 additions & 3 deletions lisp/ess-r-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,6 @@ will be prompted to enter arguments interactively."
inferior-R-args " " ; add space just in case
start-args))
(debug (string-match-p " -d \\| --debugger=" r-start-args))
(project-find-functions (if (memq 'ess-r-project project-find-functions)
project-find-functions
(cons 'ess-r-project project-find-functions)))
use-dialog-box)
(when (or ess-microsoft-p
(eq system-type 'cygwin))
Expand Down
2 changes: 1 addition & 1 deletion lisp/ess-r-package.el
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ Set this variable to nil to disable the mode line entirely."
(set (make-local-variable var)
(eval (cdr (assq var ess-r-customize-alist)))))
vars))
(add-hook 'project-find-functions #'ess-r-project)
(add-hook 'project-find-functions #'ess-r-project nil 'local)
(run-hooks 'ess-r-package-enter-hook))
(remove-hook 'project-find-functions #'ess-r-project)
(run-hooks 'ess-r-package-exit-hook)))
Expand Down

0 comments on commit 55d968f

Please sign in to comment.