Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
2701 views
1
;;; ess-custom.el --- Customize variables for ESS
2
3
;; Copyright (C) 1997--2010 A.J. Rossini, Richard M. Heiberger, Martin
4
;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
5
;; Copyright (C) 2011--2012 A.J. Rossini, Richard M. Heiberger, Martin Maechler,
6
;; Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu.
7
8
;; Author: A.J. Rossini <[email protected]>
9
;; Created: 05 June 2000
10
;; Maintainer: ESS-core <[email protected]>
11
12
;; Keywords: languages
13
14
;; This file is part of ESS
15
16
;; This file is free software; you can redistribute it and/or modify
17
;; it under the terms of the GNU General Public License as published by
18
;; the Free Software Foundation; either version 2, or (at your option)
19
;; any later version.
20
;;
21
;; This file is distributed in the hope that it will be useful,
22
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
;; GNU General Public License for more details.
25
;;
26
;; A copy of the GNU General Public License is available at
27
;; http://www.r-project.org/Licenses/
28
29
;;; Code:
30
31
(require 'custom)
32
(require 'executable)
33
(require 'font-lock)
34
35
;; Customization Groups
36
37
(defgroup ess nil
38
"ESS: Emacs Speaks Statistics."
39
:group 'local)
40
41
(defgroup ess-edit nil
42
"ESS: editing behavior, including coments/indentation."
43
:group 'ess
44
:prefix "ess-")
45
46
(defgroup ess-proc nil
47
"ESS: process control."
48
:group 'ess
49
:prefix "ess-")
50
51
(defgroup ess-command nil
52
"ESS: Commands for various things."
53
:group 'ess
54
:prefix "ess-")
55
56
(defgroup ess-help nil
57
"ESS: help functions."
58
:group 'ess
59
:prefix "ess-")
60
61
(defgroup ess-hooks nil
62
"ESS: hooks for customization."
63
:group 'ess
64
:prefix "ess-")
65
66
(defgroup ess-S nil
67
"ESS: S Languages."
68
:group 'ess
69
:prefix "ess-")
70
71
(defgroup ess-origS nil
72
"ESS: Original S Dialect from Bell Labs/AT&T."
73
:group 'ess-S
74
:prefix "ess-")
75
76
(defgroup ess-SPLUS nil
77
"ESS: S-PLUS Dialect of S."
78
:group 'ess-S
79
:prefix "ess-")
80
81
(defgroup ess-R nil
82
"ESS: R Dialect of S."
83
:group 'ess-S
84
:prefix "ess-")
85
86
(defgroup ess-Julia nil
87
"ESS: Julia."
88
:group 'ess
89
:prefix "julia-")
90
91
(defgroup ess-sas nil
92
"ESS: SAS."
93
:group 'ess
94
:prefix "ess-")
95
96
(defgroup ess-Stata nil
97
"ESS: Stata."
98
:group 'ess
99
:prefix "ess-")
100
101
(defgroup ess-XLS nil
102
"ESS: XLispStat."
103
:group 'ess
104
:prefix "ess-")
105
106
(defgroup ess-OMG nil
107
"ESS: Omegahat."
108
:group 'ess
109
:prefix "ess-")
110
111
(defgroup ess-mouse nil ;; FIXME: this is not used yet <--> ./ess-mous.el
112
"ESS: Mouse."
113
:group 'ess
114
:prefix "ess-")
115
116
(defgroup ess-roxy nil
117
"Mode for editing in-code Roxygen documentation."
118
:group 'ess
119
:group 'convenience
120
:group 'ess-extras
121
:prefix "ess-" ;; << -- added for ESS integration FIXME??
122
:group 'tools)
123
124
(defgroup ess-sweave nil
125
"Mode for editing Sweave (*.[SR]nw) files."
126
:group 'ess-S
127
:prefix "ess-")
128
129
(defgroup ess-extras nil
130
"Extra utilities for ESS"
131
:group 'ess
132
:prefix "ess-")
133
;; Variables (not user-changeable)
134
135
(defvar ess-version "14.09" ;; updated by 'make'
136
"Version of ESS currently loaded.")
137
138
(defvar ess-revision nil ;; set
139
"The subversion revision and date of ESS.
140
Is set by \\[ess-version-string].")
141
142
143
(defvar no-doc
144
"This function is part of ESS, but has not yet been loaded.
145
Full documentation will be available after autoloading the function."
146
"Documentation for autoload functions.")
147
148
149
; User changeable variables
150
151
;;; Common user changeable variable are described and documented in
152
;;; ess-site.el. Please check there first!
153
;;;=====================================================
154
;;; In general: Variables with document strings starting with a * are
155
;;; the ones you can generally change safely, and may have to upon
156
;;; occasion.
157
158
;;*;; Options and Initialization
159
160
;; Menus and pulldowns.
161
162
(defcustom ess-funcmenu-use-p (fboundp 'func-menu)
163
"Non-nil means use func-menu."
164
:group 'ess
165
:type 'boolean)
166
167
(defcustom ess-speedbar-use-p (fboundp 'speedbar)
168
"Non-nil means use speedbar."
169
:group 'ess
170
:type 'boolean)
171
172
(defcustom ess-imenu-use-p (fboundp 'imenu)
173
"Non-nil means use imenu facility.
174
This value can be overridden by mode-specific variables, such
175
as `ess-imenu-use-S'."
176
:group 'ess
177
:type 'boolean)
178
179
(defcustom ess-imenu-use-S ess-imenu-use-p
180
"*Non-nil means include an Imenu menu item in S buffers."
181
:group 'ess
182
:type 'boolean)
183
184
(defvar ess-imenu-generic-expression nil
185
"Placeholder for imenu-generic-expression. Dialect specific.")
186
187
188
189
;;
190
191
(defcustom ess-handy-commands '(("change-directory" . ess-change-directory)
192
("install.packages" . ess-install.packages)
193
("library" . ess-library)
194
("objects[ls]" . ess-execute-objects)
195
("help-apropos" . ess-display-help-apropos)
196
("help-index" . ess-display-package-index)
197
("help-object" . ess-display-help-on-object)
198
("search" . ess-execute-search)
199
("set-width" . ess-execute-screen-options)
200
("setRepos" . ess-setRepositories)
201
("sos" . ess-sos)
202
("vignettes" . ess-display-vignettes)
203
)
204
"An alist of custom ESS commands available for call by
205
`ess-handy-commands' and `ess-smart-comma' function."
206
:group 'ess
207
:type (if (featurep 'emacs) 'alist 'list))
208
209
(defvar ess--local-handy-commands nil
210
"Store handy commands locally")
211
(make-variable-buffer-local 'ess--local-handy-commands)
212
213
214
215
(defcustom ess-describe-at-point-method nil
216
"Whehter `ess-describe-object-at-point' should use a tooltip.
217
If nil display in an electric buffer. If 'tooltip display in
218
a tooltip.
219
220
See also `tooltip-hide-delay' and `tooltip-delay'.
221
"
222
:group 'ess-utils
223
:type '(choice (const :tag "buffer" :value nil ) (const tooltip))
224
)
225
226
(defcustom ess-R-describe-object-at-point-commands
227
'(("str(%s)")
228
("htsummary(%s, hlength = 20, tlength = 20)")
229
("summary(%s, maxsum = 20)"))
230
"A list of commands cycled by `ess-describe-object-at-point'.
231
%s is substituted with the name at point.
232
233
The value of each element is nil and is not used in current
234
implementation."
235
:group 'R
236
:type 'alist)
237
238
239
(defcustom ess-S-describe-object-at-point-commands
240
ess-R-describe-object-at-point-commands
241
"An alist of commands cycled by `ess-describe-object-at-point'.
242
%s is substitute with the name at point. The value is not used as
243
yet."
244
:group 'S+
245
:type 'alist)
246
247
248
(defcustom ess-can-eval-in-background nil
249
"If non-nil ESS can perform caching and other background
250
activities by calling the subprocess on idle time.")
251
252
(defcustom ess-user-full-name (user-full-name)
253
"The full name of the user."
254
:group 'ess
255
:type 'string)
256
257
(defcustom ess-blink-region t
258
"If t evaluated region is highlighted for a shortwhile.
259
See also `ess-blink-delay'"
260
:group 'ess
261
:type 'boolean)
262
263
(defcustom ess-blink-delay .3
264
"Number of seconds to highlight the evaluated region."
265
:group 'ess
266
:type 'number)
267
268
(defcustom ess-ask-for-ess-directory t
269
"Non-nil means request the process directory each time S is run."
270
:group 'ess
271
:type 'boolean)
272
273
(defcustom ess-ask-about-transfile nil
274
"Non-nil means ask about a transcript file before running ESS."
275
:group 'ess
276
:type 'boolean)
277
278
(defcustom ess-display-buffer-reuse-frames t
279
"Non-nil means \\[display-buffer] reuses existing frames; see
280
`display-buffer-reuse-frames'."
281
:group 'ess
282
:type 'boolean)
283
284
(defvar ess-language nil
285
"Prefix of all ESS processes, and defines the dialect in use.
286
Currently acceptable values are `S', `XLS', `SAS'.
287
Can be changed, e.g., to `R'. Use `setq-default' if setting it in
288
.emacs (also see ess-site.el).")
289
;; :group 'ess
290
;; :type '(choice (const :tag "Initial" :value nil)
291
;; (const :tag "S" :value "S")
292
;; (const :tag "XLS" :value "XLS")
293
;; (const :tag "SAS" :value "SAS")
294
;; (const :tag "R" :value "R")))
295
296
(make-variable-buffer-local 'ess-language)
297
298
(defvar ess-dialect nil
299
"String version of the dialect being run for the inferior process.
300
This, plus `ess-language', should be able to determine the exact
301
version of the statistical package being executed in the particular
302
buffer.
303
304
Current values could include:
305
for `ess-dialect' = S3, S4, Sp3, Sp4, Sp5, S+, R, XLS, SAS, Stata, Julia
306
307
Used to adjust for changes in versions of the program.")
308
309
(make-variable-buffer-local 'ess-dialect)
310
;;(setq-default ess-dialect "Initial-dialect")
311
(setq-default ess-dialect nil)
312
;;; SJE -- why use "Initial-dialect"? If we use nil, it matches "None"
313
;;; in the custom choice.
314
315
;; (defcustom ess-etc-directory
316
;; (expand-file-name (concat ess-lisp-directory "/../etc/"))
317
;; "*Location of the ESS etc/ directory.
318
;; The ESS etc directory stores various auxillary files that are useful
319
;; for ESS, such as icons."
320
;; :group 'ess
321
;; :type 'directory)
322
323
(defcustom ess-directory-function nil
324
"Function to return the directory that ESS is run from.
325
If nil or if the function returns nil then you get `ess-directory'."
326
:group 'ess
327
:type '(choice (const nil) function))
328
329
(defcustom ess-setup-directory-function nil
330
"Function to setup the directory that ESS is run from.
331
This function can be called to set environment variables or to create
332
a workspace."
333
:group 'ess
334
:type '(choice (const nil) function))
335
336
(defcustom ess-directory nil
337
"The directory ESS is run from. It must end in a slash.
338
Provided as a default if `ess-ask-for-ess-directory' is non-nil.
339
A nil value means use the current buffer's default directory."
340
:group 'ess
341
:type '(choice (const nil) directory))
342
343
(defcustom ess-history-directory nil
344
"Directory to pick up `ess-history-file' from.
345
If this is nil, the history file is relative to `ess-directory'."
346
:group 'ess
347
:type '(choice (const nil) directory))
348
349
(defcustom ess-history-file t
350
"File to pick up history from. nil means *no* history is read or written.
351
t means something like \".Rhistory\".
352
If this is a relative file name, it is relative to `ess-history-directory'.
353
Consequently, if that is set explicitly, you will have one history file
354
for all projects."
355
:group 'ess
356
:type '(choice (const :tag "Off" nil)
357
(const :tag "On" t)
358
file))
359
360
(defcustom ess-plain-first-buffername t
361
"No fancy process buffname for the first process of each type (novice mode)."
362
:group 'ess
363
:type 'boolean)
364
365
366
(defcustom ess-use-inferior-program-name-in-buffer-name nil
367
"For R, use e.g., 'R-2.1.0' or 'R-devel' (the program name) for buffer name.
368
Avoids the plain dialect name."
369
:group 'ess
370
:type 'boolean)
371
372
(defcustom ess-use-ido t
373
"If t ess will try to use ido completion whenever possible.
374
375
By default ESS uses enables IDO flex matching. See
376
`ido-enable-flex-matching' for details on flex matching and
377
`ess-ido-flex-matching' on how to disable it for ESS, if you
378
don't want it.
379
380
Some useful keys for IDO completion:
381
382
- C-s (next) or C-r (previous) to move through the list.
383
- C-SPC to restrict the list to currently matched items.
384
- TAB to display possible completion in a buffer
385
- C-t `ido-toggle-regexp'
386
"
387
:group 'ess
388
:type 'boolean)
389
390
391
(defcustom ess-tab-complete-in-script nil
392
"If non-nil, TAB in script buffers tries to complete if there is nothing to indent.
393
See also `ess-first-tab-never-complete'.")
394
395
(defcustom ess-first-tab-never-complete 'symbol
396
"If t, first TAB never tries to complete in ess-mode.
397
If 'symbol first TAB doesn't try to complete if next char is a
398
valid symbol constituent.
399
400
If 'symbol-or-paren don't complete if next char is closed paren
401
)}] or symbol character.
402
403
If 'symbol-or-paren-or-punct don't complete if next char is
404
punctuation +-=% etc, or closed paren or symbol.
405
406
If 'unless-eol - first TAB completes only at end of line.
407
408
If nil first TAB always tries to complete (this might be too
409
aggressive and dangerous).
410
"
411
:group 'ess
412
:type '(choice (const nil)
413
(const symbol)
414
(const symbol-or-paren)
415
(const symbol-or-paren-or-punct)
416
(const unless-eol)
417
(const t)))
418
419
(defvaralias 'ess-first-tab-never-completes-p 'ess-first-tab-never-complete)
420
421
(defcustom ess-use-eldoc t
422
"If t, activate eldoc in ess-mode and inferior-ess-mode buffers.
423
If 'script-only activate in ess-mode buffers only.
424
425
See also `ess-eldoc-show-on-symbol'."
426
:group 'ess-extras
427
:type '(choice (const t) (const script-only) (const nil)))
428
429
430
(defcustom ess-eldoc-show-on-symbol nil
431
"If non-nil, show help string whenever the point is on a symbol.
432
If nil show only when the point is in a function call, i.e. after (."
433
:group 'ess-extras
434
:type 'boolean)
435
436
437
(defcustom ess-eldoc-abbreviation-style 'normal
438
"How ess-eldoc string should be abbreviated when it doesn't fit into one line
439
A symbol which can be
440
nil: do nothing
441
mild: Replace TRUE, FALSE with T,F
442
normal: Try mild + shorten the default values longer than 10 characters.
443
strong: Try normal + completely remove default values except =F,=T,=d where d is a digit.
444
aggressive (or t): Try strong + truncate the doc string to fit into minibuffer.
445
446
The default style is 'normal.
447
448
Ess-eldoc also honors the value of
449
`eldoc-echo-area-use-multiline-p'. If this variable is not t (the
450
default), doc strings are truncated to fit into minibufer. This
451
allows the use of different abbreviation styles with the
452
truncation."
453
:group 'ess
454
:type '(choice (const nil) (const mild) (const normal) (const strong) (const aggressive) (const t))
455
)
456
457
458
(defcustom ess-use-auto-complete t
459
"If t, activate auto-complete support in ess-mode and inferior-ess-mode buffers.
460
If 'script-only activate in ess-mode buffers only.
461
462
If non-nil add `ac-source-R' and `ac-source-filename' to the
463
`ac-sources' buffer local variable.
464
465
ESS defines three AC sources `ac-source-R',`ac-source-R-objects'
466
and `ac-source-R-args'. See auto-complete package
467
documentation (http://cx4a.org/software/auto-complete/) for how
468
to install your custom sources.
469
"
470
:group 'ess-extras
471
:type '(choice (const t) (const script-only) (const nil)))
472
473
(defcustom ess-ac-R-argument-suffix " = "
474
"Suffix appended by `ac-source-R' and `ac-source-R-args' to candidates."
475
:group 'R
476
:type 'string)
477
478
(defcustom ess-use-tracebug t
479
"If t, load ess-tracebug when R process starts."
480
:group 'ess-extras
481
:type 'boolean)
482
483
(defcustom ess-ido-flex-matching t
484
"If t, ido for ESS completion uses flex matching.
485
See `ido-enable-flex-matching' for details.
486
If you have an old computer, or you load lot of packages, you
487
might want to set this to nil.
488
"
489
:group 'ess
490
:type 'boolean)
491
492
493
(defvar ess-ac-sources nil
494
"Dialect specific, ESS specific list of ac-sources")
495
496
(defvar ess--completing-hist nil
497
"Variable to store completion history.
498
Used by `ess-completion-read' command.")
499
500
(defvar ess-smart-operators ()
501
"List of smart operators to be used in ESS and IESS modes.
502
Not to be set by users. It is redefined by mode specific
503
settings, such as `ess-R-smart-operators'.
504
")
505
(make-variable-buffer-local 'ess-smart-operators)
506
507
(defvar ess-R-smart-operators nil
508
"If nil, don't use any of smart operators.
509
If t, use all. If an axplicit list of operators, use only those
510
operators.
511
512
In current verion of ESS, it controls the behavior of
513
ess-smart-comma only, but will be enriched in the near future.
514
")
515
516
(defvar ess-no-skip-regexp "[ \t\n]*\\'"
517
"If `ess-next-code-line' sees this line, it doesn't jump over.
518
519
Used to avoid annoying jumping by ess-eval.*-and-step to end of
520
buffer or end chunks etc.
521
")
522
523
(defcustom ess-S-assign " <- "
524
"String used for left assignment in all S dialects.
525
Used by \\[ess-smart-S-assign]."
526
:group 'ess-S
527
:type 'string)
528
529
(defcustom ess-smart-S-assign-key "_"
530
"Key used by `ess-smart-S-assign'. By default bound to
531
underscore, but can be set to any key. If this key is customized,
532
you must add
533
534
(ess-toggle-S-assign nil)
535
(ess-toggle-S-assign nil)
536
537
after the line that sets the customization and evaluate these
538
lines or reboot emacs. The first call clears the default
539
`ess-smart-S-assign' assignment and the second line re-assigns
540
it to the customized setting. "
541
:group 'ess-S
542
:type 'character)
543
544
;;*;; Variables concerning editing behaviour
545
546
(defcustom ess-filenames-map t
547
"Declares if the filenames in an attached directory are the same
548
as objects in that directory (when t). This is not true for DOS and
549
other OS's with limited filename lengths. Even if this is set
550
incorrectly, the right things will probably still happen, however."
551
:group 'ess-edit
552
:type 'boolean)
553
554
;;; SJE -- this is set in ess-site.el to be "always", so I changed
555
;;; value t to be "always", so that ess-site.el does not need editing.
556
;;; However, this is a bit messy, and would be nicer if ess-site.el
557
;;; value was t rather than "always".
558
(defcustom ess-keep-dump-files 'ask
559
"Variable controlling whether to delete dump files after a successful load.
560
If nil: always delete. If `ask', confirm to delete. If `check', confirm
561
to delete, except for files created with ess-dump-object-into-edit-buffer.
562
Anything else, never delete. This variable only affects the behaviour
563
of `ess-load-file'. Dump files are never deleted if an error occurs
564
during the load. "
565
:group 'ess-edit
566
:type '(choice (const :tag "Check" :value 'check)
567
(const :tag "Ask" :value 'ask)
568
(const :tag "Always keep" :value "always")
569
(const :tag "Always delete" :value nil)
570
))
571
572
573
(defcustom ess-delete-dump-files nil
574
"Non-nil means delete dump files after they are created.
575
This applies to dump files created with
576
`ess-dump-object-into-edit-buffer', only.
577
578
Boolean flag which determines what to do with the dump files
579
generated by \\[ess-dump-object-into-edit-buffer], as follows:
580
581
If nil: dump files are deleted after each use, and so appear
582
only transiently. The one exception to this is when a loading error
583
occurs, in which case the file is retained until the error is
584
corrected and the file re-loaded.
585
586
If non-nil: dump files are not deleted, and backups are kept
587
as usual. This provides a simple method for keeping an archive of S
588
functions in text-file form.
589
590
Auto-save is always enabled in dump-file buffers to enable recovery
591
from crashes.
592
593
This is useful to prevent sources file being created for objects
594
you don't actually modify. Once the buffer is modified and saved
595
however, the file is not subsequently unless `ess-keep-dump-files' is
596
nil, and the file is successfully loaded back into S."
597
:group 'ess-edit
598
:type 'boolean)
599
600
;;; From ess-mode:
601
602
(defcustom ess-mode-silently-save t
603
"Non-nil means automatically save ESS source buffers before loading."
604
:group 'ess-edit
605
:type 'boolean)
606
607
;;*;; Variables controlling editing
608
609
;;;*;;; Edit buffer processing
610
(defcustom ess-function-template " <- function( )\n{\n\n}\n"
611
"If non-nil, function template used when editing nonexistent objects.
612
613
The edit buffer will contain the object name in quotes, followed by
614
this string. Point will be placed after the first parenthesis or
615
bracket."
616
:group 'ess-edit
617
:type 'string)
618
619
;;; By K.Shibayama 5.14.1992
620
;;; Setting any of the following variables in your .emacs is equivalent
621
;;; to modifying the DEFAULT style.
622
623
;;;*;;; Indentation parameters
624
625
(defcustom ess-auto-newline nil
626
"Non-nil means automatically newline before and after braces
627
inserted in S code."
628
:type 'boolean
629
:group 'ess-edit)
630
631
(defcustom ess-tab-always-indent t
632
"Non-nil means TAB in S mode should always reindent the current line,
633
regardless of where in the line point is when the TAB command is used."
634
:type 'boolean
635
:group 'ess-edit)
636
637
(defvar ess-indent-line-function nil
638
"Function to be used for the current dialect
639
nil means to use R/S indentation.")
640
(make-variable-buffer-local 'ess-indent-line-function)
641
642
(defvar ess-indent-level 2
643
"Indentation of S statements with respect to containing block.")
644
645
(defvar ess-brace-imaginary-offset 0
646
"Imagined indentation of an open brace following a statement.")
647
648
(defvar ess-brace-offset 0
649
"Extra indentation for open braces.
650
Compares with other text in same context.")
651
652
(defvar ess-first-continued-statement-offset 0
653
"Extra indentation for the first new line continuing an expression.
654
If you set this to non-zero value you might want to set
655
`ess-continued-statement-offset' to zero.")
656
657
(defvar ess-continued-statement-offset 2
658
"Extra indent for lines not starting new statements.")
659
660
(defvar ess-continued-brace-offset 0
661
"Extra indent for substatements that start with open-braces.
662
This is in addition to ess-continued-statement-offset.")
663
664
(defvar ess-arg-function-offset 2
665
"Extra indent for internal substatements of function `foo' that called
666
in `arg=foo(...)' form.
667
If not number, the statements are indented at open-parenthesis following foo.")
668
669
(defvar ess-arg-function-offset-new-line '(2)
670
"Extra indent for function arguments when ( is folowed by new line.
671
672
If nil, the statements are indented at open-parenthesis following foo:
673
674
a <- some.function(other.function(
675
arg1,
676
arg2)
677
678
If a list of the form '(N) where N is a number, the statements
679
are indented at the previous line indentation + N characters:
680
681
a <- some.function(other.function(
682
arg1,
683
arg2)
684
685
686
If a number N, the statement are alligned at the beggining of
687
function call + N characters:
688
689
a <- some.function(other.function(
690
arg1,
691
arg2)
692
693
694
For inner function arguments the behavior is unchanged:
695
696
some.function(arg1,
697
arg2=other.function(a,
698
b,
699
700
Set `ess-arg-function-offset' to nil if you want:
701
702
some.function(arg1,
703
arg2=other.function(a,
704
b,
705
706
and
707
708
some.function(arg1,
709
arg2=other.function(
710
a,
711
b,
712
713
")
714
715
;;added rmh 2Nov97 at request of Terry Therneau
716
(defvar ess-close-brace-offset 0
717
"Extra indentation for closing braces.")
718
719
;;added rmh 2Nov97 at request of Terry Therneau
720
(defcustom ess-fancy-comments t
721
"Non-nil means distiguish between #, ##, and ### for indentation."
722
:type 'boolean
723
:group 'ess-edit)
724
725
726
;; PeterDalgaard, 1Apr97 :
727
;;The default ess-else-offset should be 0, not 2 IMHO (try looking at
728
;;the ls() function, for instance). Was 2.
729
(defvar ess-else-offset 0
730
"Extra indent for `else' lines.")
731
732
(defvar ess-expression-offset 4
733
"Extra indent for internal substatements of `expression' that specified
734
in `obj <- expression(...)' form.
735
If not number, the statements are indented at open-parenthesis following
736
`expression'.")
737
738
;;;*;;; Editing styles
739
740
(defvar ess-default-style-list
741
(list 'DEFAULT
742
(cons 'ess-indent-level '(default-value 'ess-indent-level))
743
(cons 'ess-first-continued-statement-offset '(default-value 'ess-first-continued-statement-offset))
744
(cons 'ess-continued-statement-offset '(default-value 'ess-continued-statement-offset))
745
(cons 'ess-brace-offset '(default-value 'ess-brace-offset))
746
(cons 'ess-expression-offset '(default-value 'ess-expression-offset))
747
(cons 'ess-else-offset '(default-value 'ess-else-offset))
748
(cons 'ess-brace-imaginary-offset '(default-value 'ess-brace-imaginary-offset))
749
(cons 'ess-continued-brace-offset '(default-value 'ess-continued-brace-offset))
750
(cons 'ess-arg-function-offset '(default-value 'ess-arg-function-offset))
751
(cons 'ess-arg-function-offset-new-line '(default-value 'ess-arg-function-offset-new-line))
752
(cons 'ess-close-brace-offset '(default-value 'ess-close-brace-offset))
753
)
754
"Style constructed from initial (default) values of ESS indentation variables.")
755
756
(defvar ess-style-alist
757
(cons ess-default-style-list
758
'((GNU (ess-indent-level . 2)
759
(ess-first-continued-statement-offset . 0)
760
(ess-continued-statement-offset . 2)
761
(ess-brace-offset . 0)
762
(ess-arg-function-offset . 4)
763
(ess-arg-function-offset-new-line . '(4))
764
(ess-expression-offset . 2)
765
(ess-else-offset . 0)
766
(ess-close-brace-offset . 0)
767
)
768
(BSD (ess-indent-level . 8)
769
(ess-first-continued-statement-offset . 0)
770
(ess-continued-statement-offset . 8)
771
(ess-brace-offset . -8)
772
(ess-arg-function-offset . 0)
773
(ess-arg-function-offset-new-line . '(8))
774
(ess-expression-offset . 8)
775
(ess-else-offset . 0)
776
(ess-close-brace-offset . 0)
777
)
778
(K&R (ess-indent-level . 5)
779
(ess-first-continued-statement-offset . 0)
780
(ess-continued-statement-offset . 5)
781
(ess-brace-offset . -5)
782
(ess-arg-function-offset . 0)
783
(ess-arg-function-offset-new-line . '(5))
784
(ess-expression-offset . 5)
785
(ess-else-offset . 0)
786
(ess-close-brace-offset . 0)
787
)
788
(C++ (ess-indent-level . 4)
789
(ess-first-continued-statement-offset . 0)
790
(ess-continued-statement-offset . 4)
791
(ess-brace-offset . -4)
792
(ess-arg-function-offset . 0)
793
(ess-arg-function-offset-new-line . '(4))
794
(ess-expression-offset . 4)
795
(ess-else-offset . 0)
796
(ess-close-brace-offset . 0)
797
)
798
;; R added ajr 17Feb04 to match "common R" use
799
(RRR (ess-indent-level . 4)
800
(ess-first-continued-statement-offset . 0)
801
(ess-continued-statement-offset . 4)
802
(ess-brace-offset . 0)
803
(ess-arg-function-offset . 4)
804
(ess-arg-function-offset-new-line . '(4))
805
(ess-expression-offset . 4)
806
(ess-else-offset . 0)
807
(ess-close-brace-offset . 0)
808
)
809
;; CLB added rmh 2Nov97 at request of Terry Therneau
810
(CLB (ess-indent-level . 2)
811
(ess-first-continued-statement-offset . 0)
812
(ess-continued-statement-offset . 4)
813
(ess-brace-offset . 0)
814
(ess-arg-function-offset . 0)
815
(ess-arg-function-offset-new-line . '(2))
816
(ess-expression-offset . 4)
817
(ess-else-offset . 0)
818
(ess-close-brace-offset . 2)
819
)
820
)
821
)
822
"Predefined formatting styles for ESS code.
823
Values for all groups, except OWN, are fixed. To change the
824
value of variables in the OWN group, customize the variable
825
`ess-own-style-list'. The default style in use is controlled by
826
`ess-default-style'.")
827
828
(defun ess-add-style (key entries)
829
"Add a new style to `ess-style-list', with the key KEY.
830
Remove any existing entry with the same KEY before adding the new one.
831
(ess-first-continued-statement-offset . 0)
832
This can be used"
833
(setq ess-style-alist (assq-delete-all key ess-style-alist))
834
(add-to-list 'ess-style-alist (cons key entries)))
835
836
(defcustom ess-own-style-list (cdr ess-default-style-list)
837
"Indentation variables for your own style that can be changed.
838
Set `ess-default-style' to 'OWN to use these values. To change
839
these values, use the customize interface."
840
:group 'ess-edit
841
:type '(repeat (cons symbol integer))
842
:initialize 'custom-initialize-set
843
:set (lambda (symbol value)
844
(set symbol value)
845
(ess-add-style 'OWN value)))
846
847
(defcustom ess-default-style 'RRR
848
"The default value of `ess-style'.
849
See the variable `ess-style-alist' for how these groups (RRR, DEFAULT,
850
OWN, GNU, BSD, ...) map onto different settings for variables.
851
Since ESS 13.05, the default is RRR rather than DEFAULT."
852
:type '(choice (const DEFAULT)
853
(const OWN)
854
(const GNU)
855
(const BSD)
856
(const K&R)
857
(const C++)
858
(const :tag "Common R" :value RRR)
859
(const CLB))
860
:group 'ess-edit)
861
862
;; the real setting of this happens via <foo>-editing-alist:
863
(defvar ess-style ess-default-style
864
"*The buffer specific ESS indentation style, see `ess-style-alist' for more.")
865
866
;;*;; Variables controlling behaviour of dump files
867
868
(defcustom ess-source-directory
869
(or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")
870
"Directory in which to place dump files.
871
This can be a string (an absolute directory name ending in a slash) or
872
a lambda expression of no arguments which will return a suitable string
873
value. The lambda expression is evaluated with the process buffer as the
874
current buffer.
875
876
This always dumps to a sub-directory (\".Src\") of the current ess
877
working directory (i.e. first elt of search list)."
878
:group 'ess-edit
879
:type 'directory)
880
881
(defvar ess-dump-filename-template nil
882
"Internal. Initialized by dialects")
883
884
(defcustom ess-dump-filename-template-proto (concat (user-login-name) ".%s.S")
885
"Prototype template for filenames of dumped objects.
886
The ending `S' is replaced by the current \\[ess-suffix], to give
887
`ess-dump-filename-template' when an inferior ESS process starts.
888
889
By default, gives filenames like `user.foofun.S', so as not to clash with
890
other users if you are using a shared directory. Other alternatives:
891
\"%s.S\" ; Don't bother uniquifying if using your own directory(ies)
892
\"dumpdir\"; Always dump to a specific filename. This makes it impossible
893
to edit more than one object at a time, though.
894
(make-temp-name \"scr.\") ; Another way to uniquify"
895
;; MM: The last 3-4 lines above suck (I don't understand them) -- FIXME --
896
897
:group 'ess-edit
898
:type 'string)
899
900
901
;;*;; Hooks
902
903
(defcustom ess-mode-hook nil
904
"Hook for customizing ESS each time it is entered."
905
:group 'ess-hooks
906
:type 'hook)
907
908
(defcustom ess-mode-load-hook nil
909
"Hook to call when ess.el is loaded."
910
:group 'ess-hooks
911
:type 'hook)
912
913
(defcustom ess-pre-run-hook nil
914
"Hook to call before starting up ESS.
915
Good for setting up your directory."
916
:group 'ess-hooks
917
:type 'hook)
918
919
(defcustom ess-post-run-hook nil
920
"Hook to call just after the ESS process starts up.
921
Good for evaluating ESS code."
922
:group 'ess-hooks
923
:type 'hook)
924
925
(defcustom inferior-ess-mode-hook nil
926
"Hook for customizing inferior ESS mode. Called after
927
`inferior-ess-mode' is entered and variables have been initialised."
928
:group 'ess-hooks
929
:type 'hook)
930
931
;;; make it possible to save an inferior-ess-mode buffer without losing
932
;;; the connection to the running ESS process.
933
(put 'inferior-ess-mode 'mode-class 'special)
934
;; FIXME AJR: Should the above be there? I don't think so!
935
;; MM : the functionality should be, right? Move statement to ./ess.el ?
936
;; AJR: No, we should move the statement to ./ess-inf.el
937
938
(defcustom ess-help-mode-hook nil
939
"Functions to call when entering `ess-help-mode'."
940
:group 'ess-hooks
941
:type 'hook)
942
943
(defcustom ess-send-input-hook nil
944
"Hook called just before line input is sent to the process."
945
:group 'ess-hooks
946
:type 'hook)
947
948
(defcustom ess-transcript-mode-hook nil
949
"Hook for customizing ESS transcript mode."
950
:group 'ess-hooks
951
:type 'hook)
952
953
(defcustom R-mode-hook nil
954
"Hook run when entering R mode."
955
:type 'hook
956
:group 'ess-R)
957
958
(defcustom Rnw-mode-hook nil
959
"Hook run when entering Rnw mode."
960
:type 'hook
961
:group 'ess-R)
962
963
(defcustom SAS-mode-hook nil
964
"Hook to run when entering SAS mode."
965
:type 'hook
966
:group 'ess-sas)
967
968
(defcustom ess-pdf-viewer-pref nil
969
"External pdf viewer you like to use from ESS.
970
Can be a string giving a name of the program or a list with car
971
giving heprogram and the tail giving the arguments. For example
972
'(\"okular\" \"--unique\")."
973
:type '(choice (const nil) (repeat :tag "Command with arguments" string) (string :tag "Command"))
974
:group 'ess)
975
976
(defcustom ess-ps-viewer-pref nil
977
"External PostScript viewer you like to use from ESS.
978
If nil, ESS will try finding one from a list."
979
:type '(choice (const nil) string)
980
:group 'ess)
981
982
;; ---- ./ess-roxy.el : ------------
983
984
(defcustom ess-roxy-package "roxygen2"
985
"The name of the R package to use for Roxygen."
986
:group 'ess-roxy
987
:type 'string)
988
989
(defcustom ess-roxy-tags-noparam '("export" "noRd")
990
"The tags used in roxygen fields that can be used alone. Used
991
to decide highlighting and tag completion."
992
:group 'ess-roxy
993
:type '(repeat string))
994
995
(defcustom ess-roxy-tags-param '("author" "aliases" "concept" "details"
996
"examples" "format" "keywords"
997
"method" "exportMethod"
998
"name" "note" "param"
999
"include" "references" "return"
1000
"seealso" "source" "docType"
1001
"title" "TODO" "usage" "import"
1002
"exportClass" "exportPattern" "S3method"
1003
"inheritParams"
1004
"importFrom" "importClassesFrom"
1005
"importMethodsFrom" "useDynLib"
1006
"rdname" "section" "slot")
1007
"The tags used in roxygen fields that require a parameter.
1008
Used to decide highlighting and tag completion."
1009
:group 'ess-roxy
1010
:type '(repeat string))
1011
1012
(defcustom ess-roxy-template-alist
1013
(list (cons "description" ".. content for \\description{} (no empty lines) ..")
1014
(cons "details" ".. content for \\details{} ..")
1015
(cons "title" "")
1016
(cons "param" "")
1017
(cons "return" "")
1018
(cons "author" ess-user-full-name))
1019
"The tags and defaults to insert when creating empty templates.
1020
Param is a place holder for where to enter
1021
parameters. Description and details do not use @ tags, but are
1022
instead placed at the beginning of the entry (and should
1023
therefore also be at the beginning of this template to give
1024
syntactically correct roxygen entries)"
1025
:group 'ess-roxy
1026
:type '(alist :value-type (group string)))
1027
1028
(defcustom ess-roxy-fill-param-p nil
1029
"Non-nil causes parameter descriptions to be filled (word-wrapped) upon `ess-roxy-update-entry'."
1030
:group 'ess-roxy
1031
:type '(choice (const :tag "Off" nil)
1032
(const :tag "On" t)))
1033
1034
(defcustom ess-roxy-hide-show-p nil
1035
"Non-nil means ess-roxy uses hs-minor-mode for block hiding with TAB."
1036
:group 'ess-roxy
1037
:type '(choice (const :tag "Off" nil)
1038
(const :tag "On" t)))
1039
1040
(defcustom ess-roxy-start-hidden-p nil
1041
"Non-nil means all blocks should be hidden from start."
1042
:group 'ess-roxy
1043
:type '(choice (const :tag "Off" nil)
1044
(const :tag "On" t)))
1045
1046
(defcustom ess-roxy-str "##'"
1047
"Prefix string to insert before each line in new roxygen
1048
blocks. In existing roxygen blocks, the prefix is taken from
1049
the line at point"
1050
:group 'ess-roxy
1051
:type 'string)
1052
1053
(defcustom ess-roxy-re "^#+'"
1054
"Regular expression to recognize roxygen blocks."
1055
:group 'ess-roxy
1056
:type 'string)
1057
1058
(defcustom ess-swv-pdflatex-commands '("texi2pdf" "pdflatex" "make")
1059
"Commands to run a version of pdflatex in \\[ess-swv-PDF];
1060
the first entry is the default command."
1061
:group 'ess-sweave
1062
:type 'list)
1063
1064
(defcustom ess-swv-plug-into-AUCTeX-p nil
1065
"Non-nil means add commands to AUCTeX's \\[TeX-command-list]
1066
to sweave the current noweb file and latex the result."
1067
:group 'ess-sweave
1068
:type '(choice (const :tag "Off" nil)
1069
(const :tag "On" t)))
1070
1071
1072
; System variables
1073
1074
;; SJE -- this should not be defcustom - user does not set it.
1075
(defvar ess-local-process-name nil
1076
"The name of the ESS process associated with the current buffer.")
1077
(put 'ess-local-process-name 'risky-local-variable t)
1078
(put 'ess-local-process-name 'permanent-local t)
1079
(make-variable-buffer-local 'ess-local-process-name)
1080
1081
(defcustom ess-switch-to-end-of-proc-buffer t
1082
"If t, `ess-switch-to-inferior-or-script-buffer goes to end of
1083
process buffer."
1084
:group 'ess
1085
:type 'boolean)
1086
1087
(defcustom ess-gen-proc-buffer-name-function 'ess-gen-proc-buffer-name:simple
1088
"Function used for generation of the buffer name of the newly created ESS process.
1089
It should accept one argument PROC-NAME, a string specifying
1090
internal process name (R, R:2, etc).
1091
1092
Provided default options are:
1093
1094
`ess-gen-proc-buffer-name:simple' -- *proc*
1095
`ess-gen-proc-buffer-name:directory' -- *proc:dir*
1096
`ess-gen-proc-buffer-name:abbr-long-directory' -- *proc:abbr-long-dir*
1097
"
1098
:group 'ess
1099
:type '(choice (const :tag "*proc*" ess-gen-proc-buffer-name:simple)
1100
(const :tag "*proc:dir*" ess-gen-proc-buffer-name:directory)
1101
(const :tag "*proc:abbr-long-dir*" ess-gen-proc-buffer-name:abbr-long-directory)
1102
function))
1103
1104
1105
(defcustom ess-kermit-command "gkermit -T"
1106
"Kermit command invoked by `ess-kermit-get' and `ess-kermit-send'."
1107
:group 'ess
1108
:type 'string)
1109
1110
(defcustom ess-kermit-prefix "#"
1111
"String files must begin with to use kermit file transfer."
1112
:group 'ess
1113
:type 'string)
1114
1115
(defcustom ess-kermit-remote-directory "."
1116
"Buffer local variable that designates remote directory of file."
1117
:group 'ess
1118
:type 'string)
1119
(make-variable-buffer-local 'ess-kermit-remote-directory)
1120
1121
;;*;; Regular expressions
1122
1123
;; -- Note: Some variables not-to-customize moved to ./ess-mode.el :
1124
;; ess-set-function-start
1125
1126
;; Fixme: the following is just for S dialects :
1127
(defcustom ess-dumped-missing-re
1128
"\\(<-\nDumped\n\\'\\)\\|\\(<-\\(\\s \\|\n\\)*\\'\\)"
1129
"If a dumped object's buffer matches this re, then it is replaced
1130
by `ess-function-template'."
1131
:group 'ess
1132
:type 'regexp)
1133
1134
(defcustom ess-dump-error-re
1135
(if (string= ess-language "S") "\nDumped\n\\'"
1136
"[Ee]rror")
1137
"Regexp used to detect an error when loading a file."
1138
:group 'ess
1139
:type 'regexp)
1140
1141
1142
; ess-inf: variables for inferior-ess.
1143
1144
;;*;; System dependent variables
1145
1146
;; If you need to change the *-program-name variables, do so in
1147
;; ess-site.el. Do NOT make the changes here!!
1148
;; Keep a copy of your revised ess-site.el to use as a starting point
1149
;; for upgrades of ESS.
1150
1151
(defcustom inferior-ess-own-frame nil
1152
"Non-nil means that inferior ESS buffers should start in their own frame.
1153
The parameters of this frame are stored in `inferior-ess-frame-alist'."
1154
:group 'ess-proc
1155
:type 'boolean)
1156
1157
(defcustom inferior-ess-frame-alist default-frame-alist
1158
"Alist of frame parameters used to create new frames for iESS buffers.
1159
This defaults to `default-frame-alist' and is used only when
1160
the variable `inferior-ess-own-frame' is non-nil."
1161
:group 'ess-proc
1162
:type 'alist)
1163
1164
(defcustom inferior-ess-same-window t
1165
"Non-nil indicates new inferior ESS process appears in current window.
1166
Otherwise, the new inferior ESS buffer is shown in another window in the
1167
current frame. This variable is ignored if `inferior-ess-own-frame' is
1168
non-nil."
1169
:group 'ess-proc
1170
:type 'boolean)
1171
1172
1173
(defcustom inferior-R-program-name
1174
(if ess-microsoft-p "Rterm" "R")
1175
"Program name for invoking an inferior ESS with \\[R]."
1176
:group 'ess-R
1177
:type 'string)
1178
1179
(defcustom inferior-R-args ""
1180
"String of arguments (see 'R --help') used when starting R.
1181
These arguments are currently not passed to other versions of R that have
1182
been created using the variable `ess-r-versions'."
1183
:group 'ess-R
1184
:type 'string)
1185
1186
(defcustom ess-R-readline nil
1187
"nil indicates that \"--no-readline \" should be used as argument when starting R.
1188
This has been the default since 1998 and may very slightly speedup interaction.
1189
On the other hand, readline is necessary for expansion of \"~username/\" in paths.
1190
Note that readline interprets tabs (tabular characters) in R source files as asking
1191
for file name completion. This can mess up ess evaluation completely."
1192
:group 'ess-R
1193
:type 'boolean)
1194
1195
(defcustom inferior-STA-start-file nil
1196
"Initialization file for Stata."
1197
:group 'ess-Stata)
1198
1199
(defcustom inferior-STA-start-args ""
1200
"String of switches used when starting stata.
1201
Don't use this to send initialization command to stata, use
1202
`inferior-STA-start-file' instead. Also see
1203
`inferior-STA-program-name'."
1204
:group 'ess-Stata
1205
:type 'string)
1206
1207
(defcustom inferior-R-objects-command "print(objects(pos=%d, all.names=TRUE), max=1e6)\n"
1208
"Format string for R command to get a list of objects at position %d.
1209
Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
1210
:group 'ess-command
1211
:type 'string)
1212
1213
(defcustom ess-getwd-command nil
1214
"Command string retriving the working directory from the process.")
1215
1216
(defcustom ess-setwd-command nil
1217
"Command string to set working directory.
1218
Should contain a formating %s to be replaced by a
1219
path (as in 'setwd(%s)\\n'.")
1220
1221
(defcustom ess-program-files ;; 32 bit version
1222
(if ess-microsoft-p
1223
(if (getenv "ProgramW6432")
1224
(w32-short-file-name (getenv "ProgramFiles(x86)"));; always 32 on 64 bit OS
1225
(w32-short-file-name (getenv "ProgramFiles"))) ;; always 32 on 32 bit OS
1226
nil)
1227
"Safe (no embedded blanks) 8.3 name for 32-bit programs that works across internationalization."
1228
:group 'ess
1229
:type 'string)
1230
1231
(defcustom ess-program-files-64 ;; 64 bit version
1232
(if (and ess-microsoft-p (getenv "ProgramW6432"))
1233
(w32-short-file-name (getenv "ProgramW6432"))
1234
nil)
1235
"Safe (no embedded blanks) 8.3 name for 64-bit programs that works across internationalization."
1236
:group 'ess
1237
:type 'string)
1238
1239
(defcustom ess-directory-containing-R nil
1240
"nil (the default) means the search for all occurences of R
1241
on the machine will use the default location of the R directory
1242
(inside \"c:/Program Files\" in English locale Windows systems).
1243
Non-nil values mean use the specified location as the
1244
directory in which \"R/\" is located. For example, setting
1245
`ess-directory-containing-R' to \"c:\" will tell ESS to search
1246
for R versions with pathnames of the form \"c:/R/R-x.y.z\".
1247
1248
Currently only used when `ess-microsoft-p'. If you change the
1249
value of this variable, you need to restart Emacs for it to take
1250
effect. It also needs to be set before you load ess-site as its
1251
value is used once only when ESS is loaded."
1252
1253
:group 'ess
1254
:type 'directory)
1255
1256
(defcustom ess-rterm-version-paths nil
1257
"Stores the full path file names of Rterm versions, computed via
1258
\\[ess-find-rterm]. If you have versions of R in locations other than
1259
in ../../R-*/bin/Rterm.exe or ../../rw*/bin/Rterm.exe, relative to the
1260
directory in the `exec-path' variable containing your default location
1261
of Rterm, you will need to redefine this variable with a
1262
`custom-set-variables' statement in your site-start.el or .emacs
1263
file."
1264
:group 'ess-R
1265
:type '(repeat string))
1266
1267
(defcustom ess-SHOME-versions
1268
;; ess-program-files ~= "c:/progra~1" for typical locales/languages
1269
(mapcar
1270
(lambda (ch) (concat ess-program-files ch))
1271
'("/Insightful/splus62"
1272
"/Insightful/splus61"
1273
"/MathSoft/splus6"
1274
"/spls45se"
1275
"/Insightful/splus62netclient"
1276
"/Insightful/splus62net/server"
1277
"/Insightful/splus61netclient"
1278
"/Insightful/splus61net/server"
1279
"/Insightful/splus6se"
1280
"/Insightful/splus61se"
1281
"/Insightful/splus62se"
1282
"/Insightful/splus70"
1283
"/Insightful/splus71"
1284
"/Insightful/splus8.0.1"
1285
"/Insightful/splus8.0.4"
1286
"/Insightful/splus80"
1287
"/TIBCO/splus81"
1288
"/TIBCO/splus82"
1289
))
1290
"List of possible values of the environment variable SHOME for recent
1291
releases of S-Plus. These are the default locations for several
1292
current and recent releases of S-Plus. If any of these pathnames
1293
correspond to a directory on your machine, running the function
1294
`ess-sqpe-versions-create' will create a function, for example,
1295
\\[splus70], that will start the corresponding version Sqpe inside an
1296
emacs buffer in iESS[S] mode. If you have versions of S-Plus in
1297
locations other than these default values, redefine this variable with
1298
a `custom-set-variables' statement in your site-start.el or .emacs
1299
file. The list of functions actually created appears in the *ESS*
1300
buffer and should appear in the \"ESS / Start Process / Other\"
1301
menu."
1302
:group 'ess-SPLUS
1303
:type '(repeat string))
1304
1305
(defcustom ess-SHOME-versions-64
1306
;; ess-program-files-64 ~= "c:/progra~1" for typical locales/languages
1307
(mapcar
1308
(lambda (ch) (concat ess-program-files-64 ch))
1309
'("/TIBCO/splus82"
1310
))
1311
"List of possible values of the environment variable SHOME for recent
1312
releases of 64-bit S-Plus. These are the default locations for several
1313
current and recent releases of S-Plus. If any of these pathnames
1314
correspond to a directory on your machine, running the function
1315
`ess-sqpe-versions-create' will create a function, for example,
1316
\\[splus70], that will start the corresponding version Sqpe inside an
1317
emacs buffer in iESS[S] mode. If you have versions of 64-bit S-Plus in
1318
locations other than these default values, redefine this variable with
1319
a `custom-set-variables' statement in your site-start.el or .emacs
1320
file. The list of functions actually created appears in the *ESS*
1321
buffer and should appear in the \"ESS / Start Process / Other\"
1322
menu."
1323
:group 'ess-SPLUS
1324
:type '(repeat string))
1325
1326
(defcustom inferior-S3-program-name "/disk05/s/S"
1327
"Program name for invoking an inferior ESS with S3()."
1328
:group 'ess-S
1329
:type 'string)
1330
1331
(defcustom inferior-S+3-program-name "Splus"
1332
"Program name for invoking an inferior ESS with S+3()."
1333
:group 'ess-SPLUS
1334
:type 'string)
1335
1336
(defcustom inferior-S+4-program-name
1337
(concat ess-program-files "/spls45se/cmd/Splus.exe")
1338
"Program name for invoking an external GUI S+4.
1339
The default value is correct for a default installation of
1340
S-Plus 4.5 Student Edition and with bash as the shell.
1341
For any other version or location, change this value in ess-site.el or
1342
site-start.el. Use the 8.3 version of the pathname.
1343
Use double backslashes if you use the msdos shell."
1344
:group 'ess-SPLUS
1345
:type 'string)
1346
1347
(defcustom inferior-S+4-print-command "S_PRINT_COMMAND=emacsclientw.exe"
1348
"Destination of print icon in S+4 Commands window."
1349
:group 'ess-SPLUS
1350
:type 'string)
1351
1352
(defcustom inferior-S+4-editor-pager-command
1353
"options(editor='emacsclient.exe', pager='emacsclientw.exe')"
1354
"Programs called by the editor() and pager() functions
1355
in S+4 Commands window and in Sqpe+4 buffer."
1356
:group 'ess-S
1357
:type 'string)
1358
1359
(defcustom inferior-Sqpe+4-program-name
1360
(concat ess-program-files "/spls45se/cmd/Sqpe.exe")
1361
"Program name for invoking an inferior ESS with Sqpe+4()."
1362
:group 'ess-SPLUS
1363
:type 'string)
1364
1365
(defcustom inferior-Sqpe+4-SHOME-name
1366
(if ess-microsoft-p (concat ess-program-files "/spls45se" ""))
1367
"SHOME name for invoking an inferior ESS with Sqpe+4().
1368
The default value is correct for a default installation of
1369
S-Plus 4.5 Student Edition. For any other version or location,
1370
change this value in ess-site.el or site-start.el. Use the 8.3
1371
version of the pathname."
1372
:group 'ess-SPLUS
1373
:type 'string)
1374
;;(if ess-microsoft-p
1375
;; (let* ((SHOME (getenv "SHOME"))
1376
;; (PATH (getenv "PATH"))
1377
;; (split-PATH (split-string PATH ";")) ;; Unix uses ":"
1378
;; (num 0)
1379
;; pathname)
1380
;; (if (not SHOME)
1381
;; (while (< num (length split-PATH))
1382
;; (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
1383
;; (if (not (file-exists-p pathname))
1384
;; (setq num (1+ num))
1385
;; (progn
1386
;; (setq num (length split-PATH))
1387
;; (setq SHOME (expand-file-name (concat pathname "/../..")))))))
1388
;; (setq-default inferior-Sqpe+4-SHOME-name SHOME)))
1389
1390
1391
(defcustom inferior-S-elsewhere-program-name "sh"
1392
"Program name to invoke an inferior ESS with S on a different computer."
1393
:group 'ess-proc
1394
:type 'string)
1395
1396
(defcustom inferior-ESS-elsewhere-program-name "sh"
1397
"Program name to invoke an inferior ESS with program on a
1398
different computer."
1399
:group 'ess-proc
1400
:type 'string)
1401
1402
(defcustom inferior-S4-program-name "S4"
1403
"Program name to invoke an inferior ESS with S4()."
1404
:group 'ess-S
1405
:type 'string)
1406
1407
(defcustom inferior-S+5-program-name "Splus5"
1408
"Program name to invoke an inferior ESS with S+5()."
1409
:group 'ess-SPLUS
1410
:type 'string)
1411
1412
(defvaralias 'S+6-dialect-name 'S+-dialect-name)
1413
(defcustom S+-dialect-name "S+"
1414
"Name of 'dialect' for S-PLUS 6.x and later.
1415
Easily changeable in a user's `.emacs'."
1416
:group 'ess-SPLUS
1417
:type 'string)
1418
1419
(defvaralias 'inferior-S+6-program-name 'inferior-S+-program-name)
1420
(if ess-microsoft-p
1421
(defcustom inferior-S+-program-name
1422
(concat ess-program-files "/TIBCO/splus82/cmd/Splus.exe")
1423
"Program name to invoke an external GUI S+ for Windows.
1424
The default value is correct for a default installation of
1425
S-Plus 8.1 and with bash as the shell.
1426
For any other version or location, change this value in ess-site.el or
1427
site-start.el. Use the 8.3 version of the pathname.
1428
Use double backslashes if you use the msdos shell."
1429
:group 'ess-SPLUS
1430
:type 'string)
1431
(defcustom inferior-S+-program-name "Splus"
1432
"Program name to invoke an inferior ESS with S+ for Unix."
1433
:group 'ess-SPLUS
1434
:type 'string))
1435
1436
(defvaralias 'inferior-S+6-start-args 'inferior-S+-start-args)
1437
(defvaralias 'inferior-Splus-args 'inferior-S+-start-args)
1438
(defcustom inferior-S+-start-args ""
1439
"String of arguments used when starting S.
1440
These arguments are currently passed only to S+6 and higher."
1441
:group 'ess-SPLUS
1442
:type 'string)
1443
1444
1445
(defvaralias 'inferior-Sqpe-start-args 'inferior-Sqpe+-start-args)
1446
(defcustom inferior-Sqpe+-start-args " "
1447
"Default is empty. Can be used for license manager information, for example
1448
`(setq inferior-Sqpe+-start-args \" [email protected] ELMTIMEOUT=60 \")'."
1449
;; (setq inferior-Sqpe+-start-args " [email protected] ELMTIMEOUT=60 ") ;; use this line as the model for your site-start.el
1450
:group 'ess-SPLUS
1451
:type 'string
1452
)
1453
1454
1455
(defcustom inferior-Splus-objects-command "objects(where=%d)\n"
1456
"Format string for R command to get a list of objects at position %d.
1457
Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
1458
:group 'ess-command
1459
:type 'string)
1460
1461
(defvaralias 'inferior-S+6-print-command 'inferior-S+-print-command)
1462
1463
(defcustom inferior-S+-print-command "S_PRINT_COMMAND=emacsclientw.exe"
1464
"Destination of print icon in S+ for Windows Commands window."
1465
:group 'ess-SPLUS
1466
:type 'string)
1467
1468
(defvaralias 'inferior-S+6-editor-pager-command 'inferior-S+-editor-pager-command)
1469
(defcustom inferior-S+-editor-pager-command
1470
"options(editor='emacsclient.exe', pager='emacsclientw.exe')"
1471
"Programs called by the editor() and pager() functions in S+
1472
for Windows Commands window and in Sqpe+6 for Windows buffer."
1473
:group 'ess-SPLUS
1474
:type 'string)
1475
1476
(defvaralias 'inferior-Sqpe+6-program-name 'inferior-Sqpe+-program-name)
1477
(defcustom inferior-Sqpe+-program-name
1478
(concat ess-program-files "/TIBCO/splus82/cmd/Sqpe.exe")
1479
"Program name for invoking an inferior ESS with Sqpe+6() for Windows."
1480
:group 'ess-S
1481
:type 'string)
1482
1483
(defvaralias 'inferior-Sqpe+6-SHOME-name 'inferior-Sqpe+-SHOME-name)
1484
(defcustom inferior-Sqpe+-SHOME-name
1485
(if ess-microsoft-p (concat ess-program-files "/TIBCO/splus82" ""))
1486
"SHOME name for invoking an inferior ESS with Sqpe+6 and higher for Windows.
1487
The default value is correct for a default installation of
1488
S-Plus 8.1. For any other version or location,
1489
change this value in ess-site.el or site-start.el. Use the 8.3
1490
version of the pathname."
1491
:group 'ess-SPLUS
1492
:type 'string)
1493
;;(if ess-microsoft-p
1494
;; (let* ((SHOME (getenv "SHOME"))
1495
;; (PATH (getenv "PATH"))
1496
;; (split-PATH (split-string PATH ";")) ;; Unix uses ":"
1497
;; (num 0)
1498
;; pathname)
1499
;; (if (not SHOME)
1500
;; (while (< num (length split-PATH))
1501
;; (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
1502
;; (if (not (file-exists-p pathname))
1503
;; (setq num (1+ num))
1504
;; (progn
1505
;; (setq num (length split-PATH))
1506
;; (setq SHOME (expand-file-name (concat pathname "/../..")))))))
1507
;; (setq-default inferior-Sqpe+6-SHOME-name SHOME)))
1508
1509
(defcustom ess-S-quit-kill-buffers-p nil
1510
"Controls whether S buffers should also be killed once a process is killed.
1511
This is used only when an iESS process is killed using C-c C-q.
1512
Possible values:
1513
nil - do not kill any S buffers associated with the process.
1514
t - kill S buffers associated with the process.
1515
ask - ask the user whether the S buffers should be killed."
1516
:group 'ess-S
1517
:type '(choice (const nil) (const t) (const ask)))
1518
1519
(defcustom inferior-XLS-program-name "xlispstat"
1520
"Program name for invoking an inferior ESS with \\[XLS]."
1521
:group 'ess-XLS
1522
:type 'string)
1523
1524
(defcustom inferior-VST-program-name "vista"
1525
"Program name for invoking an inferior ESS with \\[ViSta]."
1526
:group 'ess-XLS
1527
:type 'string)
1528
1529
(defcustom inferior-ARC-program-name "arc"
1530
"Program name for invoking an inferior ESS with \\[ARC]."
1531
:group 'ess-XLS
1532
:type 'string)
1533
1534
(defcustom inferior-SAS-program-name "sas"
1535
"Program name for invoking an inferior ESS with SAS()."
1536
:group 'ess-sas
1537
:type 'string)
1538
1539
(defcustom inferior-STA-program-name "stata"
1540
"Program name for invoking an inferior ESS with stata().
1541
This is NOT Stata, because we need to call stata with TERM=emacs in
1542
order for it to work right. And Emacs is too smart for it."
1543
:group 'ess-Stata
1544
:type 'string)
1545
1546
(defcustom ess-sta-delimiter-friendly nil
1547
"Non-nil means convert embedded semi-colons to newlines for Stata processing."
1548
:group 'ess-Stata
1549
:type 'string)
1550
1551
(defcustom inferior-OMG-program-name "omegahat"
1552
"Program name for invoking an inferior ESS with omegahat()."
1553
:group 'ess-OMG
1554
:type 'string)
1555
1556
1557
;;;;; names for setting the pager and editor options of the
1558
;;;;; inferior-ess-process
1559
;;;
1560
;;; S-editor and S-pager,
1561
;;; R-editor and R-pager,
1562
;;; ess-editor and ess-pager,
1563
;;; and inferior-ess-language-start
1564
;;; apply in principle to the 15 files essd[s-]*.el
1565
;;; Several of the files (ess-sp4-d.el and ess-sp6w-d.el) have more
1566
;;; than one *-customize-alist.
1567
;;; These variables are currently used only with the S language files for
1568
;;; S S-Plus R.
1569
1570
(defcustom R-editor
1571
(if ess-microsoft-p "emacsclient.exe"
1572
(if (equal system-type 'Apple-Macintosh) nil
1573
(if (featurep 'xemacs) "gnuclient" "emacsclient"))) ;; unix
1574
"Editor called by R process with 'edit()' command."
1575
:group 'ess
1576
:type 'string)
1577
1578
(defcustom R-pager 'nil ; Usually nil is correct as ESS and page() cooperate.
1579
"Pager called by R process with 'page()' command."
1580
:group 'ess
1581
:type '(choice (const nil) string))
1582
1583
1584
;; FIXME: For GNU emacs, "emacsclient" (without ".exe") also works on Windoze
1585
;; (if (>= emacs-major-version 22) "emacsclient" ; for all platforms
1586
(defcustom S-editor
1587
(if ess-microsoft-p "emacsclient.exe"
1588
(if (equal system-type 'Apple-Macintosh) nil
1589
;; unix:
1590
(if (featurep 'xemacs) "gnuclient" "emacsclient")))
1591
"Editor called by S process with 'edit()' command."
1592
:group 'ess
1593
:type 'string)
1594
1595
(defcustom S-pager
1596
(if ess-microsoft-p "emacsclientw.exe"
1597
(if (equal system-type 'Apple-Macintosh) nil
1598
(if (featurep 'xemacs) "gnuclient" "emacsclient")))
1599
"Pager called by S process with 'page()' command."
1600
;; Change made to provide a better help(function) experience with
1601
;; S+6 and xemacs
1602
;; gnuclient -q will open a buffer with an HTML help file
1603
;; you can view it with M-x browse-url-of-buffer
1604
:group 'ess
1605
:type 'string)
1606
1607
(defvar ess-editor nil
1608
"*Editor by which the process sends information to an emacs buffer
1609
for editing and then to be returned to the process.")
1610
1611
(defvar ess-pager nil
1612
"*Pager by which the process sends information to an emacs buffer.")
1613
1614
(defvar inferior-ess-language-start nil
1615
"*Initialization commands sent to the ESS process.")
1616
1617
(make-variable-buffer-local 'ess-editor)
1618
(make-variable-buffer-local 'ess-pager)
1619
(make-variable-buffer-local 'inferior-ess-language-start)
1620
1621
1622
1623
;;;;; names for S-Plus help files on MS-Windows
1624
1625
(defcustom inferior-ess-help-filetype nil
1626
"S-Plus and Sqpe for Windows use the \"chm\" (compiled html) filetype
1627
for help files. The default value is nil for other systems."
1628
:group 'ess-proc
1629
:type 'string)
1630
(make-variable-buffer-local 'inferior-ess-help-filetype)
1631
(setq-default inferior-ess-help-filetype nil)
1632
1633
1634
;;;;; names for communication using MS-Windows 9x/NT ddeclient mechanism
1635
1636
(defcustom inferior-ess-ddeclient nil
1637
"ddeclient is the intermediary between emacs and the stat program."
1638
:group 'ess-proc
1639
:type 'string)
1640
1641
(make-variable-buffer-local 'inferior-ess-ddeclient)
1642
1643
(defcustom inferior-ess-client-name nil
1644
"Name of ESS program ddeclient talks to."
1645
:group 'ess-proc
1646
:type 'string)
1647
1648
(make-variable-buffer-local 'inferior-ess-client-name)
1649
1650
(defcustom inferior-ess-client-command nil
1651
"ddeclient command sent to the ESS program."
1652
:group 'ess-proc
1653
:type '(choice (const nil) string))
1654
1655
(make-variable-buffer-local 'inferior-ess-client-command)
1656
1657
;;;;; user settable defaults
1658
(defvar inferior-S-program-name inferior-S+3-program-name
1659
"*Program name for invoking an inferior ESS with S().")
1660
;;- (setq inferior-S-program
1661
;;- (cond ((string= S-proc-prefix "S") "Splus")
1662
;;- ((string= S-proc-prefix "R") "R")
1663
;;- (t "S")
1664
;;- ))
1665
;;(make-local-variable 'inferior-S-program)
1666
1667
(defvar inferior-ess-program nil ;inferior-S-program-name
1668
"*Default program name for invoking inferior-ess().
1669
The other variables ...-program-name should be changed, for the
1670
corresponding program.")
1671
1672
(make-variable-buffer-local 'inferior-ess-program)
1673
;; (setq-default inferior-ess-program inferior-S-program-name)
1674
1675
1676
(defvar inferior-R-version "R (newest)"
1677
"A (short) name of the current R version. A global variable for
1678
ESS internal communication.")
1679
1680
(defvar inferior-ess-start-args ""
1681
"String of arguments passed to the ESS process.
1682
If you wish to pass arguments to a process, see e.g. `inferior-R-args'.")
1683
1684
(defcustom inferior-ess-start-file nil
1685
"File dumped into process, if non-nil."
1686
:group 'ess-proc
1687
:type '(choice (const nil) file))
1688
1689
(defcustom inferior-ess-pager "cat"
1690
"Pager to use for reporting help files and similar things."
1691
:group 'ess-proc
1692
:type 'string)
1693
1694
;; does it make sense to customize here, as we currently set this *directly*
1695
;; in the FOO-BAR-cust-alist's ???
1696
;; VS: Right. It only confuses users. It should be set in post-run-hook if
1697
;; desired; inferior-S-prompt should be customized instead.
1698
(defvar inferior-ess-primary-prompt "> "
1699
"Regular expression used by `ess-mode' to detect the primary prompt.")
1700
1701
(make-variable-buffer-local 'inferior-ess-primary-prompt)
1702
;; (setq-default inferior-ess-primary-prompt "> ")
1703
1704
(defvar inferior-ess-secondary-prompt nil
1705
"Regular expression used by ess-mode to detect the secondary prompt.
1706
This is issued by S to continue an incomplete expression.
1707
Set to nil if language doesn't support secondary prompt.")
1708
;; :group 'ess-proc
1709
;; :type 'string)
1710
1711
(make-variable-buffer-local 'inferior-ess-secondary-prompt)
1712
;; (setq-default inferior-ess-secondary-prompt "+ ")
1713
1714
(defvar ess-traceback-command nil
1715
"Command to generate error traceback.")
1716
1717
;; need to recognise + + + > > >
1718
;; and "+ . + " in tracebug prompt
1719
(defcustom inferior-S-prompt "[]a-zA-Z0-9.[]*\\(?:[>+.] \\)*> "
1720
"Regexp used in S and R inferior and transcript buffers for prompt navigation.
1721
Customise it to make `comint-previous-prompt' quiqly navigate to
1722
interesting portions of the buffer.
1723
"
1724
:group 'ess-proc
1725
:type 'string)
1726
1727
(defvaralias 'inferior-ess-S-prompt 'inferior-S-prompt)
1728
;;*;; Variables controlling interaction with the ESS process
1729
1730
(defcustom ess-execute-in-process-buffer nil
1731
"Non-nil means the ess-execute- commands output to the process buffer.
1732
Otherwise, they get their own temporary buffer."
1733
:group 'ess-proc
1734
:type 'boolean)
1735
1736
(defcustom ess-eval-empty nil
1737
"Non-nil means `ess-eval-line*' will send empty lines to the ESS process."
1738
:group 'ess-proc
1739
:type 'boolean)
1740
1741
(defvaralias 'ess-eval-visibly-p 'ess-eval-visibly)
1742
1743
(defcustom ess-eval-visibly t
1744
"Non-nil means ess-eval- commands display commands in the process buffer.
1745
If t, ESS waits after each line of the command for the process
1746
output. This results in a nice sequence of input and output but
1747
stalls emacs on long output (like Sys.sleep(5) in R).
1748
1749
If 'nowait, ESS still shows the input commands, but don't wait
1750
for the process. Thus all the output is printed after the input
1751
lines.
1752
1753
If nil, ESS doesn't print input commands and doesn't wait for the process.
1754
1755
This variable also affect the evaluation of input code in
1756
iESS. The effect is similar to the above. If t then ess waits for
1757
the process output, otherwise not.
1758
"
1759
:group 'ess-proc
1760
:type '(choice (const t) (const nowait) (const nil)))
1761
1762
;; (when (boundp 'ess-eval-visibly-p)
1763
;; (setq ess-eval-visibly ess-eval-visibly-p))
1764
1765
1766
1767
(defcustom ess-eval-deactivate-mark (fboundp 'deactivate-mark); was nil till 2010-03-22
1768
"Non-nil means that after ess-eval- commands the mark is deactivated,
1769
(see \\[deactivate-mark]). The default is true since ESS version 5.9,
1770
except on XEmacs which doesn't have \\[deactivate-mark] and friends:
1771
only affects the situation where `transient-mark-mode' is non-nil."
1772
:group 'ess-proc
1773
:type 'boolean)
1774
1775
(defcustom ess-synchronize-evals nil
1776
"Non-nil means all evaluations will synchronize with the ESS process.
1777
This means ess-mode will wait for S to dent a prompt before sending the next
1778
line of code. This allows users of Emacs version 18.57 or less to
1779
evaluate large regions of code without causing an error. Users of newer
1780
Emacsen usually do not want this feature, since it locks up use
1781
of Emacs until the code has been successfully evaluated."
1782
:group 'ess-proc
1783
:type 'boolean)
1784
1785
(defcustom ess-eval-visibly-at-end t
1786
"Non-nil means ess-eval- commands display output at end of process buffer."
1787
:group 'ess-proc
1788
:type 'boolean)
1789
1790
(defcustom ess-use-R-completion t
1791
"Non-nil means use R-builtin completion mechanism when available."
1792
:group 'ess-proc
1793
:type 'boolean)
1794
1795
(defcustom ess-eval-ddeclient-sleep 0.06
1796
"If non-nil, a number specifying *seconds* to wait after certain
1797
\\[ess-eval-linewise-ddeclient] calls, such as those at startup."
1798
;; i.e this currently only applies to (if microsoft-p ...) !
1799
:group 'ess-proc
1800
:type '(choice (const nil) number))
1801
1802
(defcustom ess-sleep-for-shell (if ess-microsoft-p 5 1)
1803
"*Pause before sending output to the shell."
1804
:group 'ess-proc
1805
:type 'number)
1806
1807
; System variables
1808
1809
;;*;; Variables relating to multiple processes
1810
1811
;; VS[17-08-2012]: all of the occurrences in the code should should eventually
1812
;; go away, (once we are sure this doesn't break anything)
1813
(defvaralias 'ess-current-process-name 'ess-local-process-name)
1814
1815
(defvar ess--mode-line-process-indicator '("" ess-local-process-name)
1816
"List of ESS mode-line indicators.
1817
Local in process buffers and must start with a string. Changes of
1818
this variable are automatically reflected in mode-lines of the
1819
process and all associated with it buffers.
1820
1821
Each symbol must evaluate ot one of the standard mode line
1822
objecst. See info node `(elisp)Mode Line Data'). Add a symbol
1823
with `add-to-list' and remove with `delq'. Note that the symbols
1824
which are part of this list should better have
1825
'risky-local-variable property set to t, otherwise the text
1826
properties are not displayed.
1827
1828
External utilities such as `ess-tracebug' and `ess-developer'
1829
customize this variable to indicate changes in the process
1830
status.
1831
")
1832
(put 'ess--mode-line-process-indicator 'risky-local-variable t)
1833
(make-variable-buffer-local 'ess--mode-line-process-indicator)
1834
1835
(defvar ess--local-mode-line-process-indicator '("")
1836
"List of local process indicators.
1837
See `ess--mode-line-process-indicator' for how to set it.
1838
1839
This is an internal varialbe used by tools like `ess-developer'
1840
and `ess-tracebug'.")
1841
(put 'ess--local-mode-line-process-indicator 'risky-local-variable t)
1842
(make-variable-buffer-local 'ess--local-mode-line-process-indicator)
1843
1844
(defvar ess-process-name-list nil
1845
"Alist of active ESS processes.")
1846
1847
;;*;; Inferior ESS commands
1848
1849
(defvar ess-load-command "source(\"%s\")\n"
1850
"Dialect specific format-string for building the ess command to load a file.
1851
1852
This format string should use %s to substitute a file name and should
1853
result in an ESS expression that will command the inferior ESS to load
1854
that file.")
1855
(define-obsolete-variable-alias 'inferior-ess-load-command 'ess-load-command "ESS v13.09")
1856
1857
(defvar ess-load-visibly-command nil
1858
"Dialect specific format-string for building the ess command to
1859
load a file with echo.")
1860
1861
(defvar ess-load-visibly-noecho-command nil
1862
"Dialect specific format-string for building the ess command to
1863
load a file with visible output but no echo.")
1864
1865
(defvar ess-eval-command nil
1866
"Dialect specific format-string for building the command to evaluate a string.
1867
1868
This format string should use %s as a placeholder for the string
1869
to be evaluated and, optionally, %f for the file name to be
1870
reported in the error references.
1871
1872
The resulting command should not echo code or print any
1873
transitory output. See also `ess-eval-visibly-command' and
1874
`ess-eval-visibly-noecho-command'.")
1875
1876
(defvar ess-eval-visibly-command nil
1877
"Dialect specific format-string for building the command to
1878
evaluate a string with visible output and code echo.
1879
See ")
1880
1881
(defvar ess-eval-visibly-noecho-command nil
1882
"Dialect specific format-string for building the command to
1883
evaluate a string with visible output but no echo.")
1884
1885
(defcustom inferior-ess-dump-command "dump(\"%s\",file=\"%s\")\n"
1886
"Format-string for building the ess command to dump an object into a file.
1887
1888
Use first %s to substitute an object name
1889
Use second %s to substitute the dump file name."
1890
:group 'ess-command
1891
:type 'string)
1892
1893
(defvar inferior-ess-help-command "help(\"%s\")\n"
1894
"Format-string for building the ESS command to ask for help on an object.
1895
1896
This format string should use %s to substitute an object name.")
1897
1898
(make-variable-buffer-local 'inferior-ess-help-command)
1899
(setq-default inferior-ess-help-command "help(\"%s\")\n")
1900
1901
1902
(defcustom inferior-ess-r-help-command ".ess.help(\"%s\", help.type=\"text\")\n"
1903
"Format-string for building the R command to ask for help on an object.
1904
1905
This format string should use %s to substitute an object name.
1906
If set, changes will take effect when next R session is started."
1907
:group 'ess-command
1908
:type 'string)
1909
1910
(defvar ess-get-help-topics-function nil
1911
"Dialect specific help topics retrieval")
1912
(make-variable-buffer-local 'ess-get-help-topics-function)
1913
1914
(defcustom inferior-ess-exit-command "q()\n"
1915
"Format-string for building the ess command to exit.
1916
1917
This format string should use %s to substitute an object name."
1918
:group 'ess-command
1919
:type 'string)
1920
1921
(make-variable-buffer-local 'inferior-ess-exit-command)
1922
(setq-default inferior-ess-exit-command "q()\n")
1923
1924
(defvar inferior-ess-search-list-command nil
1925
"`ess-language' command that prints out the search list;
1926
i.e. the list of directories and (recursive) objects that `ess-language' uses
1927
when it searches for objects.
1928
1929
Really set in <ess-lang>-customize-alist in ess[dl]-*.el")
1930
(make-variable-buffer-local 'inferior-ess-search-list-command)
1931
1932
;; and hence made buffer-local via that scheme...
1933
1934
;; ;; FIXME: this is nowhere used :
1935
;; (defcustom inferior-ess-names-command "names(%s)\n"
1936
;; "Format string for ESS command to extract names from an object.
1937
1938
;; %s is replaced by the object name -- usually a list or data frame."
1939
;; :group 'ess-command
1940
;; :type 'string)
1941
1942
(defcustom inferior-ess-safe-names-command
1943
"tryCatch(base::print(base::names(%s), max=1e6), error=function(e){})\n"
1944
"Format string for ESS command to extract names from an object *safely*.
1945
1946
%s is replaced by an \"object name\" -- usually a list or data frame, but in R also
1947
e.g., 'package:stats'."
1948
1949
:group 'ess-command
1950
:type 'string)
1951
1952
(defcustom inferior-ess-get-prompt-command "options()$prompt\n"
1953
"Command to find the value of the current S prompt."
1954
:group 'ess-command
1955
:type 'string)
1956
1957
(defvar ess-cmd-delay nil
1958
"*Set to a positive number if ESS will include delays proportional to
1959
`ess-cmd-delay' in some places. These delays are introduced to
1960
prevent timeouts in certain processes, such as completion.
1961
1962
This variable has no effect from ESS12.03
1963
")
1964
(make-variable-buffer-local 'ess-cmd-delay)
1965
1966
(defvar ess-R-cmd-delay nil
1967
"Used to initialize `ess-cmd-delay'.
1968
1969
This variable has no effect from ESS12.03
1970
")
1971
1972
(defvar ess-S+-cmd-delay 1.0
1973
"Used to initialize `ess-cmd-delay'.
1974
This variable has no effect from ESS12.03
1975
")
1976
1977
;;*;; Regular expressions
1978
(defvar inferior-ess-prompt nil
1979
"The regular expression used for recognizing prompts.
1980
1981
It is always used in transcript mode. In inferior ess mode it is
1982
used only if `comint-use-prompt-regexp' is t.
1983
1984
If not set in language's customise-alist it is constructed at run time
1985
from `inferior-ess-primary-prompt' and `inferior-ess-secondary-prompt'.")
1986
1987
(make-variable-buffer-local 'inferior-ess-prompt)
1988
1989
(defvar ess-change-sp-regexp ""
1990
"The regexp for matching the S/R/.. commands that change the search path.")
1991
(make-variable-buffer-local 'ess-change-sp-regexp)
1992
1993
(defvar ess-S+-change-sp-regexp
1994
"\\(attach(\\([^)]\\|$\\)\\|detach(\\|collection(\\|library(\\|module(\\|source(\\)"
1995
"The regexp for matching the S-plus commands that change the search path.")
1996
1997
(defvar ess-S-change-sp-regexp
1998
"\\(attach(\\([^)]\\|$\\)\\|detach(\\|library(\\|source(\\)"
1999
"The regexp for matching the S commands that change the search path.")
2000
2001
(defvar ess-R-change-sp-regexp
2002
"\\(attach(\\([^)]\\|$\\)\\|detach(\\|library(\\|require(\\|source(\\)"
2003
"The regexp for matching the R commands that change the search path.")
2004
2005
;;*;; Process-dependent variables
2006
2007
(defvar ess-search-list nil
2008
"Deprecated. Use (ess-search-list) or (ess-process-get 'search-list) instead.")
2009
(make-obsolete-variable 'ess-search-list nil "ESS[12.09]")
2010
2011
(defvar ess-sl-modtime-alist nil
2012
"Alist of modification times for all ess directories accessed this
2013
session.")
2014
2015
(make-variable-buffer-local 'ess-sl-modtime-alist)
2016
2017
(defvar ess-sp-change nil
2018
"Variable not used. Use (ess-process-get 'sp-for-help-changed?) instead.")
2019
(make-obsolete-variable 'ess-sp-change nil "ESS[12.09]")
2020
;; (make-variable-buffer-local 'ess-sp-change)
2021
2022
(defvar ess-prev-load-dir/file nil
2023
"This symbol saves the (directory . file) pair used in the last
2024
`ess-load-file' command. Used for determining the default in the next one.")
2025
2026
(make-variable-buffer-local 'ess-prev-load-dir/file)
2027
2028
(defvar ess-object-list nil
2029
;; This is a list of the currently known object names. It is
2030
;; current only for one command entry; it exists under the
2031
;; assumption that the list of objects doesn't change while entering
2032
;; a command.
2033
"Cache of object names")
2034
2035
(make-variable-buffer-local 'ess-object-list)
2036
2037
(defvar ess-help-topics-list nil
2038
;; List of currently known help topics.
2039
"Cache of help topics")
2040
2041
(make-variable-buffer-local 'ess-help-topics-list)
2042
2043
;;*;; Miscellaneous system variables
2044
2045
(defvar ess-temp-point nil
2046
"Variable used to retain a buffer position past let or let*.")
2047
2048
2049
;; SJE: Wed 29 Dec 2004 - following 3 ess-object* variables can be removed
2050
;; soon if no-one needs the completion code.
2051
(defvar ess-object-name-db-file "ess-namedb"
2052
"File containing definitions for `ess-object-name-db'.")
2053
2054
(defvar ess-object-name-db-file-loaded '()
2055
"List of programs whose name-db file has been loaded.")
2056
2057
(defvar ess-object-name-db nil
2058
"Alist of lists of object names, with directory names as keys.
2059
The file ess-namedb.el is loaded (if it exists) to define this variable.
2060
See also function `ess-create-object-name-db'.")
2061
2062
(make-variable-buffer-local 'ess-object-name-db)
2063
(setq-default ess-object-name-db nil)
2064
2065
;; SJE: 2007-07-16 -- add to quieten byte compile.
2066
(defvar ess-loop-timeout nil
2067
"Number of loops ess-mode will wait for prompt before signalling an error.")
2068
2069
(defcustom ess-S-loop-timeout 2000000
2070
"Integer specifying how many loops ess-mode will wait for the prompt
2071
before signaling an error. Will be set to `ess-loop-timeout' in the S dialects'
2072
alists. Increase this, if you have a fast(er) machine."
2073
:group 'ess-proc
2074
:type 'integer)
2075
2076
(defcustom ess-XLS-loop-timeout 50000
2077
"Integer specifying how many loops ess-mode will wait for the prompt
2078
before signaling an error. Will be set to `ess-loop-timeout' in the XLispStat
2079
dialects' alists. Increase this, if you have a fast(er) machine."
2080
:group 'ess-proc
2081
:type 'integer)
2082
2083
;; NOTA BENE: Other languages/dialect currently set `ess-loop-timeout'
2084
;; **directly** in their ess-*-d.el alist !!
2085
2086
;;;*;;; Font-lock support
2087
2088
;;; for programming, transcript, and inferior process modes.
2089
2090
(defcustom ess-font-lock-mode global-font-lock-mode
2091
"Non-nil means we use font lock support for ESS buffers.
2092
Default is t, to use font lock support.
2093
If you change the value of this variable, restart Emacs for it to take effect."
2094
:group 'ess
2095
:type 'boolean)
2096
2097
(defvar inferior-ess-font-lock-input t
2098
"
2099
2100
This variable has no effect. Customize
2101
`inferior-ess-font-lock-keywords' directly.
2102
")
2103
(make-obsolete-variable 'inferior-ess-font-lock-input nil "ESS[12.09]")
2104
2105
;; "Reserved Words" -- part 1 --
2106
(defvar ess-RS-constants
2107
'("TRUE" "FALSE" "NA" "NULL" "Inf" "NaN"))
2108
(defvar ess-R-constants
2109
(append ess-RS-constants
2110
'("NA_integer_" "NA_real_" "NA_complex_" "NA_character_")))
2111
(defvar ess-S-constants
2112
(append ess-RS-constants
2113
'("T" "F")))
2114
2115
(defvar ess-R-keywords
2116
;; "Reserved Words" -- part 2 --
2117
'("while" "for" "in" "repeat" "if" "else" "switch" "break" "next" "function"
2118
;; note that these are *NOT* reserved words in R:
2119
"return" "message" "warning" "stop"))
2120
2121
(defvar ess-S-keywords
2122
(append ess-R-keywords '("terminate")))
2123
2124
;; only some of these keywords "look like functions but are not":
2125
(defvar ess-S-non-functions
2126
'("if" "for" "function" "while"))
2127
2128
;; first the common ones
2129
(defvar ess-S-modifyiers
2130
'("library" "attach" "detach" "source" "module"))
2131
(defvar ess-R-modifyiers
2132
'("library" "attach" "detach" "source" "require"))
2133
2134
2135
(defvar ess-R-message-prefixes
2136
'("Error:" "Error in"
2137
"Warning:" "Warning in"
2138
"Warning messages"))
2139
(defvar ess-S-message-prefixes
2140
(append ess-R-message-prefixes
2141
'("Syntax error:" "Dumped")))
2142
2143
;;
2144
(defvar ess-R-assign-ops
2145
'("<<-" "<-" "->") ; don't want "=" here which is not only for assign
2146
;; VS??: it's good to have different colour for = anyhow,
2147
;; very helpful to read code like foo(x=xa, p=pa, x_not_na)
2148
)
2149
(defvar ess-S-assign-ops ess-R-assign-ops) ; since "_" is deprecated for S-plus as well
2150
2151
2152
;; ;; Note: \\s\" is really \s" which means match a char belonging to the
2153
;; ;; "quote character" syntax class.
2154
;; (defvar ess-R-function-name-regexp
2155
;; (concat "\\s\"?\\(\\(\\sw\\|\\s_\\)+"
2156
;; "\\(<-\\)?\\)\\s\"?\\s-*\\(<-\\)"
2157
;; "\\(\\s-\\|\n\\)*function")
2158
;; )
2159
2160
2161
;; VS: simpler and more general:
2162
(defvar ess-R-function-name-regexp
2163
(concat "\\(\\(?2:\\s\"\\).+\\2\\|\\sw+\\)"
2164
"\\s-*\\(<-\\)"
2165
"[ \t\n]*function"))
2166
2167
2168
(defvar ess-S-function-name-regexp
2169
ess-R-function-name-regexp ; since "_" is deprecated for S-plus as well
2170
)
2171
2172
2173
(defvar ess-font-lock-keywords nil
2174
"Internal. Holds a name of the dialect sepcific font-lock
2175
keywords in the current buffer. See `ess-R-font-lock-keywords'
2176
for an example.")
2177
(make-variable-buffer-local 'ess-font-lock-keywords)
2178
2179
(defvar ess-font-lock-defaults nil
2180
"Internal. Holds dialect sepcific font-lock defaults in the
2181
current buffer. Old system. From ESS[12.09] switched to new
2182
system described in `ess-font-lock-keywords'.")
2183
(make-variable-buffer-local 'ess-font-lock-defaults)
2184
2185
2186
2187
(defvar ess-fl-keyword:fun-calls
2188
(cons "\\(\\sw+\\) ?(" '(1 ess-function-call-face keep))
2189
"Font lock for function calls.")
2190
2191
(defvar ess-fl-keyword:numbers
2192
(cons "\\b\\.?[0-9]+[.eEL]?[0-9]*\\b" 'ess-numbers-face)
2193
"Numbers")
2194
2195
(defvar ess-fl-keyword:delimiters
2196
(cons "\\s(\\|\\s)" 'font-lock-builtin-face)
2197
"Parenthesis")
2198
2199
(defvar ess-fl-keyword:=
2200
(cons "=" 'font-lock-constant-face)
2201
"=")
2202
2203
2204
(defvar ess-fl-keyword:operators
2205
(cons "[-=+></%]+" 'font-lock-constant-face)
2206
"Operators.")
2207
2208
2209
;;; fl-keywords S
2210
(defvar ess-S-fl-keyword:modifiers
2211
(cons (concat "\\<" (regexp-opt ess-S-modifyiers 'enc-paren) "\\>")
2212
'font-lock-constant-face) ; modify search list or source (i.e. directives)
2213
"Font-lock keyword R modifiers")
2214
2215
(defvar ess-S-fl-keyword:fun-defs
2216
(cons ess-S-function-name-regexp
2217
'(1 font-lock-function-name-face t) ; override
2218
)
2219
"Font-lock function deffinitions keyword.")
2220
2221
(defvar ess-S-fl-keyword:keywords
2222
(cons (concat "\\<" (regexp-opt ess-S-keywords 'enc-paren) "\\>")
2223
'font-lock-keyword-face))
2224
2225
(defvar ess-S-fl-keyword:assign-ops
2226
(cons (regexp-opt ess-S-assign-ops) 'font-lock-constant-face)
2227
"Font-lock assign operators")
2228
2229
(defvar ess-S-fl-keyword:constants
2230
(cons (concat "\\<" (regexp-opt ess-S-constants 'enc-paren) "\\>")
2231
'font-lock-type-face)
2232
"Font-lock constants keyword.")
2233
2234
2235
(defcustom ess-S-font-lock-keywords
2236
'((ess-S-fl-keyword:modifiers . t)
2237
(ess-S-fl-keyword:fun-defs . t)
2238
(ess-S-fl-keyword:keywords . t)
2239
(ess-S-fl-keyword:assign-ops . t)
2240
(ess-S-fl-keyword:constants . t)
2241
(ess-fl-keyword:fun-calls)
2242
(ess-fl-keyword:numbers)
2243
(ess-fl-keyword:operators)
2244
(ess-fl-keyword:delimiters)
2245
(ess-fl-keyword:=)
2246
)
2247
"An alist of available font-lock keywords for the S mode.
2248
The key of each cons cell is a name of the keyword. The value
2249
should be t or nil to indicate if the keyword is activated by
2250
default or not."
2251
:group 'ess-S
2252
:type 'alist)
2253
2254
2255
2256
;;; fl-keywords R
2257
(defvar ess-R-fl-keyword:modifiers
2258
(cons (concat "\\<" (regexp-opt ess-R-modifyiers 'enc-paren) "\\>")
2259
'font-lock-constant-face) ; modify search list or source (i.e. directives)
2260
"Font-lock keyword R modifiers")
2261
2262
(defvar ess-R-fl-keyword:fun-defs
2263
(cons ess-R-function-name-regexp
2264
'(1 font-lock-function-name-face t) ; override
2265
)
2266
"Font-lock keyword - function defintions for R.")
2267
2268
(defvar ess-R-fl-keyword:keywords
2269
(cons (concat "\\<" (regexp-opt ess-R-keywords 'enc-paren) "\\>")
2270
'font-lock-keyword-face))
2271
2272
(defvar ess-R-fl-keyword:assign-ops
2273
(cons (regexp-opt ess-R-assign-ops) 'font-lock-constant-face)
2274
"Font-lock assign operators")
2275
2276
(defvar ess-R-fl-keyword:constants
2277
(cons (concat "\\<" (regexp-opt ess-R-constants 'enc-paren) "\\>")
2278
'font-lock-type-face)
2279
"Font-lock constants keyword.")
2280
2281
(defvar ess-R-fl-keyword:numbers
2282
(cons "\\b[0-9]*[.eE]?[0-9]+[eEL]?\\b" 'ess-numbers-face)
2283
"Font-lock numbers")
2284
2285
(defvar ess-R-fl-keyword:F&T
2286
(cons "\\b[FT]\\b" 'font-lock-type-face)
2287
"Highlith T and F in addition to TRUE and FALSE in R.")
2288
2289
2290
(defcustom ess-R-font-lock-keywords
2291
'((ess-R-fl-keyword:modifiers . t)
2292
(ess-R-fl-keyword:fun-defs . t)
2293
(ess-R-fl-keyword:keywords . t)
2294
(ess-R-fl-keyword:assign-ops . t)
2295
(ess-R-fl-keyword:constants . t)
2296
(ess-fl-keyword:fun-calls)
2297
(ess-fl-keyword:numbers)
2298
(ess-fl-keyword:operators)
2299
(ess-fl-keyword:delimiters)
2300
(ess-fl-keyword:=)
2301
(ess-R-fl-keyword:F&T))
2302
"An alist of available font-lock keywords for the R mode.
2303
The key of each cons cell is a name of the keyword. The value
2304
should be t or nil to indicate if the keyword is active or not."
2305
:group 'ess-R
2306
:type 'alist)
2307
2308
2309
(defvar inferior-ess-font-lock-keywords nil
2310
"Internal. Holds a name of the dialect sepcific font-lock
2311
keywords in the current buffer. See
2312
`inferior-R-font-lock-keywords' for an example.")
2313
(make-variable-buffer-local 'inferior-ess-font-lock-keywords)
2314
2315
(defvar inferior-ess-font-lock-defaults nil
2316
"Internal. Holds dialect sepcific font-lock defaults in the
2317
current buffer. Old system. From ESS[12.09] switched to new
2318
system described in `inferior-ess-font-lock-keywords'.")
2319
(make-variable-buffer-local 'inferior-ess-font-lock-defaults)
2320
2321
(defvar comint-highlight-prompt 'comint-highlight-prompt)
2322
;; needed for proper font-lock
2323
2324
(defvar ess-S-fl-keyword:prompt
2325
(cons (concat "^" inferior-S-prompt) 'comint-highlight-prompt)
2326
"Highlight prompts missed by comint.")
2327
2328
;; (defvar ess-S-fl-keyword:input-line
2329
;; (cons "^[a-zA-Z0-9 ]*[>+]\\(.*$\\)" '(1 font-lock-variable-name-face keep t)))
2330
2331
(defvar ess-fl-keyword:matrix-labels
2332
(cons "\\[,?[1-9][0-9]*,?\\]" 'font-lock-constant-face)
2333
"Matrix and vector numeric labels.
2334
") ;; also matches subsetting
2335
2336
(defvar ess-R-fl-keyword:messages
2337
(cons (regexp-opt ess-R-message-prefixes 'enc-paren)
2338
'font-lock-warning-face)
2339
"Inferior-ess problems or errors.")
2340
2341
(defcustom inferior-R-font-lock-keywords
2342
'((ess-S-fl-keyword:prompt . t) ;; comint does that, but misses some prompts
2343
;; (ess-S-fl-keyword:input-line) ;; comint boguously highlights input with text props, no use for this
2344
(ess-R-fl-keyword:messages . t)
2345
(ess-R-fl-keyword:modifiers . t)
2346
(ess-R-fl-keyword:fun-defs . t)
2347
(ess-R-fl-keyword:keywords . t)
2348
(ess-R-fl-keyword:assign-ops . t)
2349
(ess-R-fl-keyword:constants . t)
2350
(ess-fl-keyword:matrix-labels . t)
2351
(ess-fl-keyword:fun-calls)
2352
(ess-fl-keyword:numbers)
2353
(ess-fl-keyword:operators)
2354
(ess-fl-keyword:delimiters)
2355
(ess-fl-keyword:=)
2356
(ess-R-fl-keyword:F&T)
2357
;;VS[17-09-2012]: what is this matching?
2358
;; (cons "^\\*\\*\\*.*\\*\\*\\*\\s *$" 'font-lock-comment-face); ess-mode msg
2359
2360
;; (cons "#" 'font-lock-comment-face) ; comment
2361
;; (cons "^[^#]*#\\(.*$\\)" '(1 font-lock-comment-face keep t)) ; comments
2362
)
2363
"Font-lock patterns (alist) used in inferior-R-mode buffers.
2364
The key of each cons cell is a name of the keyword. The value
2365
should be t or nil to indicate if the keyword is active or not."
2366
:group 'ess-R
2367
:type 'alist
2368
)
2369
2370
2371
(defvar ess-S-common-font-lock-keywords nil
2372
"
2373
NOT used. See `inferior-S-font-lock-keywords'")
2374
(make-obsolete-variable 'ess-S-common-font-lock-keywords nil "ESS[12.09]")
2375
2376
(defvar ess-S-fl-keyword:messages
2377
(cons (regexp-opt ess-S-message-prefixes 'enc-paren)
2378
'font-lock-warning-face)
2379
"Inferior-ess problems or errors.")
2380
2381
(defcustom inferior-S-font-lock-keywords
2382
'((ess-S-fl-keyword:prompt . t)
2383
(ess-S-fl-keyword:messages . t)
2384
(ess-S-fl-keyword:modifiers . t)
2385
(ess-S-fl-keyword:fun-defs . t)
2386
(ess-S-fl-keyword:keywords . t)
2387
(ess-S-fl-keyword:assign-ops . t)
2388
(ess-S-fl-keyword:constants . t)
2389
(ess-fl-keyword:fun-calls)
2390
(ess-fl-keyword:numbers)
2391
(ess-fl-keyword:operators)
2392
(ess-fl-keyword:delimiters)
2393
(ess-fl-keyword:=))
2394
"Font-lock patterns used in inferior-S-mode buffers.
2395
The key of each cons cell is a name of the keyword. The value
2396
should be t or nil to indicate if the keyword is active by
2397
default."
2398
:group 'ess-S
2399
:type 'alist)
2400
2401
;; use the inferior-* ones directly in ess-trns.el
2402
;; (defvar ess-trans-font-lock-keywords
2403
;; inferior-ess-font-lock-keywords
2404
;; "Font-lock patterns used in `ess-transcript-mode' buffers.")
2405
2406
2407
;;;*;;; ess-help variables
2408
2409
; ess-help-mode
2410
;; This will never need to be loaded independently of any of the other
2411
;; modules, but they can all call it so we may as well put it here.
2412
2413
;;*;; Variables relating to ess-help-mode
2414
2415
2416
(defcustom ess-help-pop-to-buffer t
2417
"If non-nil ess-help buffers are given focus during the display.
2418
The default is t (except when `focus-follows-mouse' and
2419
`mouse-autoselect-window' are both t)."
2420
:group 'ess-help
2421
:type 'boolean)
2422
2423
(defcustom ess-help-own-frame nil
2424
"Controls whether ESS help buffers should start in a different frame.
2425
2426
Possible values are:
2427
nil: Display help in current frame.
2428
'one: All help buffers are shown in one dedicated frame.
2429
t: Each help buffer gets its own frame.
2430
2431
The parameters of this frame are stored in `ess-help-frame-alist'.
2432
See also `inferior-ess-own-frame'."
2433
:group 'ess-help
2434
:type '(choice (const nil) (const one) (const t)))
2435
2436
(defcustom ess-help-reuse-window t
2437
"If t, ESS tries to display new help buffers in the existing help window"
2438
:type 'boolean
2439
:group 'ess-help)
2440
2441
(defcustom ess-help-frame-alist special-display-frame-alist
2442
"Alist of frame parameters used to create help frames.
2443
This defaults to `special-display-frame-alist' and is used only when
2444
the variable `ess-help-own-frame' is non-nil."
2445
:group 'ess-help
2446
:type 'alist)
2447
2448
2449
; User changeable variables
2450
;;;=====================================================
2451
;;; Users note: Variables with document strings starting
2452
;;; with a * are the ones you can generally change safely, and
2453
;;; may have to upon occasion.
2454
2455
(defvar ess-function-call-face 'ess-function-call-face
2456
"Face name to use for highlighting function calls.")
2457
2458
(defvar ess-numbers-face 'ess-numbers-face
2459
"Face name to use for highlighting numbers.")
2460
2461
(if (featurep 'xemacs)
2462
;; just to make xemacs not to choke on ESS
2463
(setq ess-function-call-face font-lock-builtin-face
2464
ess-numbers-face font-lock-type-face)
2465
2466
(defface ess-function-call-face
2467
'((default (:slant normal :inherit font-lock-function-name-face)))
2468
"Font Lock face used to highlight function calls in ess buffers."
2469
:group 'ess)
2470
2471
(defface ess-numbers-face
2472
'((default (:slant normal :inherit font-lock-type-face)))
2473
"Font Lock face used to highlight numbers in ess-mode buffers."
2474
:group 'ess)
2475
)
2476
2477
2478
(defcustom ess-help-kill-bogus-buffers t
2479
"Non-nil means kill ESS help buffers immediately if they are \"bogus\"."
2480
:group 'ess-help
2481
:type 'boolean)
2482
2483
(defvar ess-help-form 'separate-buffer
2484
"*Place to show help. NOT IMPLEMENTED YET.
2485
Choices are `separate-buffer', `s-process', `www'. The latter uses
2486
`browse-url' to find the location.")
2487
2488
(defvar ess-help-web-search-command nil
2489
"Dialect specific command web help search.
2490
Passed to `ess-execute-dialect-specific' which see. ")
2491
(make-variable-buffer-local 'ess-help-web-search-command)
2492
2493
(defvar ess-manual-lookup-command nil
2494
"Dialect specific command manual lookup.
2495
Passed to `ess-execute-dialect-specific' which see. ")
2496
(make-variable-buffer-local 'ess-manual-lookup-command)
2497
2498
(defvar ess-reference-lookup-command nil
2499
"Dialect specific command for reference lookup..
2500
Passed to `ess-execute-dialect-specific' which see. ")
2501
(make-variable-buffer-local 'ess-reference-lookup-command)
2502
2503
(defvar ess-funargs-command nil
2504
"Dialect specific command to return a list of function arguments.
2505
See `ess-function-arguments' and .ess_funargs command in R and
2506
S+ for details of the format that should be returned.")
2507
(make-variable-buffer-local 'ess-funargs-command)
2508
2509
(defvar ess-eldoc-function nil
2510
"Holds a dialect specific eldoc function,
2511
See `ess-R-eldoc-function' and `ess-julia-eldoc-function' for examples.")
2512
2513
(defcustom ess-r-args-noargsmsg "No args found."
2514
"Message returned if \\[ess-r-args-get] cannot find a list of arguments."
2515
:group 'ess-R
2516
:type 'string)
2517
2518
(defcustom ess-r-args-show-prefix "ARGS: "
2519
"A prefix string that is shown before the arguments list."
2520
:group 'ess-R
2521
:type 'string)
2522
2523
(defcustom ess-r-args-show-as 'message
2524
"How ess-r-args-show should show the argument list. Possible values
2525
are: 'message' (the default) or 'tooltip'."
2526
:group 'ess-R
2527
:type '(choice
2528
(const :tag "message" :value 'message)
2529
(const :tag "tooltip" :value 'tooltip)))
2530
2531
(defcustom ess-r-args-keep-silent ess-S-non-functions
2532
"List of functions names which should *not* trigger \\[ess-r-args-show];
2533
Defaults to `ess-S-non-functions'."
2534
:group 'ess-R
2535
:type '(repeat string))
2536
2537
(defcustom ess-r-args-electric-paren nil
2538
"Non-nil means re-assign \"(\" to \\[ess-r-args-auto-show]."
2539
:group 'ess-R
2540
:type 'boolean)
2541
2542
2543
; System variables
2544
;;;=====================================================
2545
;;; Users note: You will rarely have to change these
2546
;;; variables.
2547
2548
;;*;; Variables relating to ess-help-mode
2549
2550
;;-- ess-help-S-.. and ess-help-R-.. : in ess-s-l.el (are used in ess-inf).
2551
2552
(defvar ess-help-sec-keys-alist nil
2553
"Alist of (key . string) pairs for use in section searching.")
2554
2555
(defvar ess-help-sec-regex nil
2556
"Reg(ular) Ex(pression) of section headers in help file")
2557
2558
(make-variable-buffer-local 'ess-help-sec-keys-alist)
2559
(make-variable-buffer-local 'ess-help-sec-regex)
2560
2561
2562
; julia-mode
2563
(defcustom inferior-julia-program-name (if (executable-find "julia-basic")
2564
"julia-basic"
2565
"julia")
2566
"julia' executable.
2567
Need to be a full path if julia executable is not in the `exec-path'"
2568
:group 'ess-Julia)
2569
2570
(defvar julia-basic-offset 4
2571
"Offset for julia code editing")
2572
2573
2574
2575
; ess-mode: editing S source
2576
2577
;;; This syntax table is required by ess-mode.el, ess-inf.el and
2578
;;; ess-trns.el, so we provide it here.
2579
(defvar ess-mode-syntax-table nil "Syntax table for `ess-mode'.")
2580
(make-variable-buffer-local 'ess-mode-syntax-table)
2581
2582
2583
; Buffer local customization stuff
2584
2585
(defvar ess-source-modes '(ess-mode)
2586
"A list of modes used to determine if a buffer contains ess source code.")
2587
;;; If a file is loaded into a buffer that is in one of these major modes, it
2588
;;; is considered an ess source file. The function ess-load-file uses this to
2589
;;; determine defaults.
2590
2591
(defcustom ess-error-buffer-name "*ESS-errors*"
2592
"Name of buffer to keep process error messages in.
2593
Created for each process."
2594
:group 'ess-proc
2595
:type 'string)
2596
2597
(defvar ess-error-regexp-alist nil
2598
"List of symbols which are looked up in `compilation-error-regexp-alist-alist'.")
2599
2600
(defcustom ess-verbose nil
2601
"Non-nil means write more information to `ess-dribble-buffer' than usual."
2602
:group 'ess-proc
2603
:type 'boolean)
2604
2605
(defvar ess-dribble-buffer (generate-new-buffer "*ESS*")
2606
"Buffer for temporary use for setting default variable values.
2607
Used for recording status of the program, mainly for debugging.")
2608
2609
(defvar ess-customize-alist nil
2610
"Variable settings to use for proper behavior.
2611
Not buffer local!")
2612
;; TODO: fixme We cannot make it local as yet, Not list is set on inferior startup.
2613
;; (make-variable-buffer-local 'ess-customize-alist)
2614
;; (defvaralias 'ess-local-customize-alist 'ess-customize-alist)
2615
2616
(defvar ess-local-customize-alist nil
2617
"Buffer local settings for proper behavior.
2618
Used to store the values for passing on to newly created buffers.")
2619
2620
(make-variable-buffer-local 'ess-local-customize-alist)
2621
2622
(defvar ess-mode-editing-alist nil
2623
"Variable settings for ess-mode.")
2624
2625
(defvar ess-transcript-minor-mode nil
2626
"Non-nil if using `ess-transcript-mode' as a minor mode of some other mode.")
2627
2628
(make-variable-buffer-local 'ess-transcript-minor-mode)
2629
2630
(defvar ess-listing-minor-mode nil
2631
"Non-nil if using ess-listing-minor-mode.")
2632
2633
(make-variable-buffer-local 'ess-listing-minor-mode)
2634
2635
(provide 'ess-custom)
2636
2637
; Local variables section
2638
2639
;;; This file is automatically placed in Outline minor mode.
2640
;;; The file is structured as follows:
2641
;;; Chapters: ^L ;
2642
;;; Sections: ;;*;;
2643
;;; Subsections: ;;;*;;;
2644
;;; Components: defuns, defvars, defconsts
2645
;;; Random code beginning with a ;;;;* comment
2646
2647
;;; Local variables:
2648
;;; mode: emacs-lisp
2649
;;; mode: outline-minor
2650
;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
2651
;;; End:
2652
2653
;;; ess-custom.el ends here
2654
2655