Skip to content

Commit 44141c5

Browse files
authored
Obsolete inferior-ess-start-args (#889)
And use language-specific variables instead
1 parent 3fa923b commit 44141c5

File tree

9 files changed

+44
-47
lines changed

9 files changed

+44
-47
lines changed

lisp/ess-custom.el

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,9 @@ for editing and then to be returned to the process.")
17811781
The other variables ...-program should be changed, for the
17821782
corresponding program.")
17831783

1784+
(make-obsolete-variable 'inferior-ess-start-args
1785+
"Use the language specific variables like `inferior-R-args'"
1786+
"ESS 19.04")
17841787
(defvar inferior-ess-start-args ""
17851788
"String of arguments passed to the ESS process.
17861789
If you wish to pass arguments to a process, see e.g. `inferior-R-args'.")

lisp/ess-gretl.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ end keywords as associated values.")
486486
(ess-smart-operators . ess-r-smart-operators)
487487
(inferior-ess-exit-command . "exit\n")
488488
;;harmful for shell-mode's C-a: -- but "necessary" for ESS-help?
489-
(inferior-ess-start-args . "")
490489
(inferior-ess-language-start . nil)
491490
(ess-STERM . "iESS")
492491
)

lisp/ess-inf.el

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,20 @@ If `ess-plain-first-buffername', then initial process is number-free."
125125
(= n 1))) ; if not both first and plain-first add number
126126
(concat ":" (number-to-string n)))))
127127

128-
(defun inferior-ess (&optional ess-start-args customize-alist no-wait)
128+
(defun inferior-ess (&optional start-args customize-alist no-wait)
129129
"Start inferior ESS process.
130-
131130
Without a prefix argument, starts a new ESS process, or switches
132-
to the ESS process associated with the current buffer. With
133-
ESS-START-ARGS (perhaps specified via \\[universal-argument]),
134-
starts the process with those args. The current buffer is used
135-
if it is an `inferior-ess-mode' or `ess-transcript-mode' buffer.
131+
to the ESS process associated with the current buffer. With
132+
START-ARGS (perhaps specified via \\[universal-argument]), starts
133+
the process with those args. The current buffer is used if it is
134+
an `inferior-ess-mode' or `ess-transcript-mode' buffer.
136135
137136
If `ess-ask-about-transfile' is non-nil, you will be asked for a
138137
transcript file to use. If there is no transcript file, the
139138
buffer name will be like *R* or *R2*, determined by
140139
`ess-gen-proc-buffer-name-function'.
141140
142141
Takes the program name from the variable `inferior-ess-program'.
143-
Arguments to `inferior-ess-program' can be given with
144-
`inferior-ess-start-args'.
145142
146143
See Info node `(ess)Customizing startup' and
147144
`display-buffer-alist' to control where and how the buffer is
@@ -180,33 +177,31 @@ This may be useful for debugging."
180177
;; TODO: Get rid of this, we should rely on modes to set the
181178
;; variables they need.
182179
(ess-setq-vars-local ess-customize-alist)
183-
(let ((inf-args (or ess-start-args
184-
inferior-ess-start-args)))
185-
(inferior-ess--set-major-mode ess-dialect)
186-
;; Show the buffer
187-
;; TODO: Remove inferior-ess-own-frame after ESS 19.04, then just have:
188-
;; (pop-to-buffer inf-buf)
189-
(pop-to-buffer inf-buf (with-no-warnings
190-
(when inferior-ess-own-frame
191-
'(display-buffer-pop-up-frame))))
192-
(let ((proc (inferior-ess--start-process inf-buf proc-name inf-args)))
193-
(ess-make-buffer-current)
194-
(goto-char (point-max))
195-
(unless no-wait
196-
(ess-write-to-dribble-buffer "(inferior-ess: waiting for process to start (before hook)\n")
197-
(ess-wait-for-process proc nil 0.01 t))
198-
(unless (and proc (eq (process-status proc) 'run))
199-
(error "Process %s failed to start" proc-name))
200-
(when ess-setwd-command
201-
(ess-set-working-directory cur-dir))
202-
(setq-local font-lock-fontify-region-function #'inferior-ess-fontify-region)
203-
(setq-local ess-sl-modtime-alist nil)
204-
(run-hooks 'ess-post-run-hook)
205-
;; User initialization can take some time ...
206-
(unless no-wait
207-
(ess-write-to-dribble-buffer "(inferior-ess 3): waiting for process after hook")
208-
(ess-wait-for-process proc)))
209-
inf-buf)))))
180+
(inferior-ess--set-major-mode ess-dialect)
181+
;; Show the buffer
182+
;; TODO: Remove inferior-ess-own-frame after ESS 19.04, then just have:
183+
;; (pop-to-buffer inf-buf)
184+
(pop-to-buffer inf-buf (with-no-warnings
185+
(when inferior-ess-own-frame
186+
'(display-buffer-pop-up-frame))))
187+
(let ((proc (inferior-ess--start-process inf-buf proc-name start-args)))
188+
(ess-make-buffer-current)
189+
(goto-char (point-max))
190+
(unless no-wait
191+
(ess-write-to-dribble-buffer "(inferior-ess: waiting for process to start (before hook)\n")
192+
(ess-wait-for-process proc nil 0.01 t))
193+
(unless (and proc (eq (process-status proc) 'run))
194+
(error "Process %s failed to start" proc-name))
195+
(when ess-setwd-command
196+
(ess-set-working-directory cur-dir))
197+
(setq-local font-lock-fontify-region-function #'inferior-ess-fontify-region)
198+
(setq-local ess-sl-modtime-alist nil)
199+
(run-hooks 'ess-post-run-hook)
200+
;; User initialization can take some time ...
201+
(unless no-wait
202+
(ess-write-to-dribble-buffer "(inferior-ess 3): waiting for process after hook")
203+
(ess-wait-for-process proc)))
204+
inf-buf))))
210205

211206
(defun inferior-ess--get-proc-buffer-create (name)
212207
"Get a process buffer, creating a new one if needed.

lisp/ess-julia.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ to look up any doc strings."
325325
(ess-smart-operators . ess-r-smart-operators)
326326
(inferior-ess-exit-command . "exit()\n")
327327
;;harmful for shell-mode's C-a: -- but "necessary" for ESS-help?
328-
(inferior-ess-start-args . "")
329328
(inferior-ess-language-start . nil)
330329
(ess-STERM . "iESS")
331330
(ess-editor . ess-r-editor)

lisp/ess-r-mode.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ To be used as part of `font-lock-defaults' keywords."
381381
(inferior-ess-search-list-command . "search()\n")
382382
(inferior-ess-help-command . inferior-ess-r-help-command)
383383
(inferior-ess-exit-command . "q()")
384-
(inferior-ess-start-args . "")
385384
(ess-error-regexp-alist . ess-r-error-regexp-alist)
386385
(ess-describe-object-at-point-commands . 'ess-r-describe-object-at-point-commands)
387386
(ess-STERM . "iESS")

lisp/ess-sas-d.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ Better logic needed! (see 2 uses, in this file).")
307307
temp-dialect))
308308
(ess-SAS-pre-run-hook temp-dialect)
309309
(setq ess-eval-visibly-p nil)
310-
(let ((inf-buf (inferior-ess)))
310+
;; FIXME: `inferior-SAS-args' is defined from
311+
;; `inferior-SAS-args-temp' in `ess-SAS-pre-run-hook'
312+
(let ((inf-buf (inferior-ess inferior-SAS-args)))
311313
(with-current-buffer inf-buf
312314
(use-local-map sas-mode-local-map))
313315
inf-buf)))

lisp/ess-sp6-d.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@
7979

8080
(ess-directory-function . S+-directory-function)
8181
(ess-setup-directory-function . S+-setup-directory-function)
82-
(inferior-ess-start-args . inferior-S+-start-args)
83-
(ess-STERM . "iESS")
84-
)
82+
(ess-STERM . "iESS"))
8583
S+common-cust-alist)
8684

8785
"Variables to customize for S+.")
@@ -116,7 +114,7 @@ New way to do it."
116114
(setq ess-customize-alist S+-customize-alist)
117115
(ess-write-to-dribble-buffer
118116
(format "\n(S+): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer)))
119-
(let ((inf-buf (inferior-ess)))
117+
(let ((inf-buf (inferior-ess inferior-S+-start-args)))
120118
(ess-command ess-S+--injected-code)
121119
(when inferior-ess-language-start
122120
(ess-eval-linewise inferior-ess-language-start))

lisp/ess-stata-mode.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
(inferior-ess-primary-prompt . "[.:] \\|--more--")
8484
(inferior-ess-secondary-prompt . "--more--")
8585
(comint-use-prompt-regexp . t)
86-
(inferior-ess-start-args . inferior-STA-start-args)
8786
(inferior-ess-search-list-command . "set more off\n search()\n")
8887
(comment-start . "/\* ")
8988
(comment-end . " \*/")

lisp/essd-els.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@
3939
(require 'ess-stata-mode)
4040
(require 'ess-trns)
4141
(require 'ess-utils)
42+
43+
;; Easily changeable in a user's .emacs
4244
(defvar S+elsewhere-dialect-name "S+6"
4345
"Name of 'dialect' for S-PLUS at another location.")
44-
;easily changeable in a user's .emacs
46+
47+
(defvar S+elsewhere-start-args "-i"
48+
"Arguments for `S+elsewhere-dialect-name'.")
4549

4650
(defcustom inferior-ess-remote-pager nil
4751
"Remote pager to use for reporting help files and similar things.
@@ -57,7 +61,6 @@ The default value is nil."
5761
(ess-object-name-db-file . "ess-spelsewhere-namedb.el" )
5862
(inferior-ess-program . inferior-S-elsewhere-program)
5963
(inferior-ess-help-command . "help(\"%s\", pager=\"cat\", window=F)\n")
60-
(inferior-ess-start-args . "-i")
6164
(ess-STERM . "iESS")
6265
)
6366
S+common-cust-alist)
@@ -71,7 +74,7 @@ The default value is nil."
7174
(ess-write-to-dribble-buffer
7275
(format "\n(S+elsewhere): ess-dialect=%s, buf=%s\n" ess-dialect
7376
(current-buffer)))
74-
(let ((inf-buf (inferior-ess)))
77+
(let ((inf-buf (inferior-ess S+elsewhere-start-args)))
7578
(when inferior-ess-language-start
7679
(ess-eval-linewise inferior-ess-language-start))
7780
inf-buf))

0 commit comments

Comments
 (0)