1 ;;; ess-cust.el --- Customize variables for ESS
3 ;; Copyright (C) 1997--2005 A.J. Rossini, Rich M. Heiberger, Martin
4 ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
6 ;; Original Author: A.J. Rossini <rossini@u.washington.edu>
7 ;; Created: 05 June 2000
8 ;; Maintainers: ESS-core <ESS-core@stat.math.ethz.ch>
10 ;; Keywords: editing and process modes.
12 ;; This file is part of ESS
14 ;; This file is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
19 ;; This file is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to
26 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 ;; In short: you may use this code any way you like, as long as you
29 ;; don't charge more than a distribution fee for it, do distribute the
30 ;; source with any binaries, remove this notice, or hold anyone liable
35 ;; Stolen from w3-cus.el (via Per Abrahamsen's advice on the widgets page).
36 ;; This code provides compatibility with non-customized Emacsen.
41 (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
42 nil ;; We've got what we needed
43 ;; We have the old custom-library, hack around it!
44 (defmacro defgroup (&rest args)
46 (defmacro defface (var values doc &rest args)
47 (` (make-face (, var))))
48 (defmacro defcustom (var value doc &rest args)
49 (` (defvar (, var) (, value) (, doc))))))
51 ;; Customization Groups
54 "ESS: Emacs Speaks Statistics."
57 (defgroup ess-edit nil
58 "ESS: editing behavior, including coments/indentation."
62 (defgroup ess-proc nil
63 "ESS: process control."
67 (defgroup ess-command nil
68 "ESS: Commands for various things."
72 (defgroup ess-help nil
73 "ESS: help functions."
77 (defgroup ess-hooks nil
78 "ESS: hooks for customization."
87 (defgroup ess-origS nil
88 "ESS: Original S Dialect from Bell Labs/AT&T."
92 (defgroup ess-SPLUS nil
93 "ESS: S-PLUS Dialect of S."
98 "ESS: R Dialect of S."
102 (defgroup ess-sas nil
107 (defgroup ess-Stata nil
112 (defgroup ess-XLS nil
117 (defgroup ess-OMG nil
122 (defgroup ess-mouse nil ;; FIXME: this is not used yet <--> ./ess-mous.el
127 ;; Variables (not user-changeable)
129 (defvar ess-version "5.2.7"
130 "Version of ESS currently loaded.")
133 "This function is part of ESS, but has not yet been loaded.
134 Full documentation will be available after autoloading the function."
135 "Documentation for autoload functions.")
138 \f ; User changeable variables
140 ;;; Common user changeable variable are described and documented in
141 ;;; ess-site.el. Please check there first!
142 ;;;=====================================================
143 ;;; In general: Variables with document strings starting with a * are
144 ;;; the ones you can generally change safely, and may have to upon
147 ;;*;; Options and Initialization
149 ;; Menus and pulldowns.
151 (defcustom ess-funcmenu-use-p (fboundp 'func-menu)
152 "If t, funcmenu is present."
156 (defcustom ess-speedbar-use-p (fboundp 'speedbar)
157 "If t, speedbar is present."
161 (defcustom ess-imenu-use-p (fboundp 'imenu)
162 "Use imenu facility if it exists.
163 This value can be overridden by mode-specific variables, such
164 as `ess-imenu-use-S'."
170 (defcustom ess-ask-for-ess-directory t
171 "*If non-nil, the process directory will be requested each time S is run."
175 (defcustom ess-ask-about-transfile nil
176 "*If non-nil, asks about a transcript file before running ESS."
180 (defcustom ess-language nil
181 "*Prefix of all ESS processes, and defines the dialect in use.
182 Currently acceptable values are `S', `XLS', `SAS'.
183 Can be changed, e.g., to `R'. Use `setq-default' if setting it in
184 .emacs (also see ess-site.el)."
186 :type '(choice (const :tag "Initial" :value "Initial")
187 (const :tag "S" :value "S")
188 (const :tag "XLS" :value "XLS")
189 (const :tag "SAS" :value "SAS")
190 (const :tag "R" :value "R")))
192 (make-variable-buffer-local 'ess-language)
193 (setq-default ess-language "Initial")
195 (defvar ess-dialect nil
196 "String version of the dialect being run for the inferior process.
197 This, plus `ess-language', should be able to determine the exact
198 version of the statistical package being executed in the particular
201 Current values could include:
202 for `ess-dialect' = S3, S4, Sp3, Sp4, Sp5, Sp6, R, XLS, SAS, STA
204 Used to adjust for changes in versions of the program.")
206 (make-variable-buffer-local 'ess-dialect)
207 ;;(setq-default ess-dialect "Initial-dialect")
208 (setq-default ess-dialect nil)
209 ;;; SJE -- why use "Initial-dialect"? If we use nil, it matches "None"
210 ;;; in the custom choice.
212 ;; (defcustom ess-etc-directory
213 ;; (expand-file-name (concat ess-lisp-directory "/../etc/"))
214 ;; "*Location of the ESS etc/ directory.
215 ;; The ESS etc directory stores various auxillary files that are useful
216 ;; for ESS, such as icons."
220 (defcustom ess-directory-function nil
221 "*Function to return the directory that ESS is run from.
222 If nil or if the function returns nil then you get `ess-directory'."
224 :type '(choice (const nil) function))
226 (defcustom ess-setup-directory-function nil
227 "*Function to setup the directory that ESS is run from.
228 This function can be called to set environment variables or to create
231 :type '(choice (const nil) function))
233 (defcustom ess-directory nil
234 "*The directory ESS is run from. It must end in a slash.
235 Provided as a default if `ess-ask-for-ess-directory' is non-nil.
236 A nil value means use the current buffer's default directory.
237 Buffer-local: in process buffers, this contains the directory ESS was
240 :type '(choice (const nil) directory))
242 (defcustom ess-history-directory nil
243 "*Directory to pick up `ess-history-file' from.
244 If this is nil, the history file is relative to `ess-directory'."
246 :type '(choice (const nil) directory))
248 (defcustom ess-history-file nil
249 "*File to pick up history from.
250 If this is a relative file name, it is relative to `ess-history-directory'."
252 :type '(choice (const nil) file))
254 (defcustom ess-plain-first-buffername t
255 "*No fancy process buffname for the first process of each type (novice mode)."
259 (defcustom ess-S-assign " <- "
260 "*String to be used for left assignment in all S dialects.
261 Used by \\[ess-smart-underscore]."
265 ;;*;; Variables concerning editing behaviour
267 (defcustom ess-filenames-map t
268 "Declares if the filenames in an attached directory are the same
269 as objects in that directory (when t). This is not true for DOS and
270 other OS's with limited filename lengths. Even if this is set
271 incorrectly, the right things will probably still happen, however."
275 ;;; SJE -- this is set in ess-site.el to be "always", so I changed
276 ;;; value t to be "always", so that ess-site.el does not need editing.
277 ;;; However, this is a bit messy, and would be nicer if ess-site.el
278 ;;; value was t rather than "always".
279 (defcustom ess-keep-dump-files 'ask
280 "*Variable controlling whether to delete dump files after a successful load.
281 If nil: always delete. If `ask', confirm to delete. If `check', confirm
282 to delete, except for files created with ess-dump-object-into-edit-buffer.
283 Anything else, never delete. This variable only affects the behaviour
284 of `ess-load-file'. Dump files are never deleted if an error occurs
287 :type '(choice (const :tag "Check" :value 'check)
288 (const :tag "Ask" :value 'ask)
289 (const :tag "Always keep" :value "always")
290 (const :tag "Always delete" :value nil)
294 (defcustom ess-delete-dump-files nil
295 "*If non-nil, delete dump files after they are created. This
296 applies to dump files created with `ess-dump-object-into-edit-buffer',
299 Boolean flag which determines what to do with the dump files
300 generated by \\[ess-dump-object-into-edit-buffer], as follows:
302 If nil: dump files are deleted after each use, and so appear
303 only transiently. The one exception to this is when a loading error
304 occurs, in which case the file is retained until the error is
305 corrected and the file re-loaded.
307 If non-nil: dump files are not deleted, and backups are kept
308 as usual. This provides a simple method for keeping an archive of S
309 functions in text-file form.
311 Auto-save is always enabled in dump-file buffers to enable recovery
314 This is useful to prevent sources file being created for objects
315 you don't actually modify. Once the buffer is modified and saved
316 however, the file is not subsequently unless `ess-keep-dump-files' is
317 nil, and the file is successfully loaded back into S."
323 (defcustom ess-mode-silently-save t
324 "*If non-nil, automatically save ESS source buffers before loading."
328 ;;*;; Variables controlling editing
330 ;;;*;;; Edit buffer processing
331 (defcustom ess-function-template " <- function( )\n{\n\n}\n"
332 "If non-nil, function template used when editing nonexistent objects.
334 The edit buffer will contain the object name in quotes, followed by
335 this string. Point will be placed after the first parenthesis or
340 ;;; By K.Shibayama 5.14.1992
341 ;;; Setting any of the following variables in your .emacs is equivalent
342 ;;; to modifying the DEFAULT style.
344 ;;;*;;; Indentation parameters
346 (defcustom ess-auto-newline nil
347 "*Non-nil means automatically newline before and after braces
352 (defcustom ess-tab-always-indent t
353 "*Non-nil means TAB in S mode should always reindent the current line,
354 regardless of where in the line point is when the TAB command is used."
358 (defcustom ess-indent-level 2
359 "*Indentation of S statements with respect to containing block."
363 (defcustom ess-brace-imaginary-offset 0
364 "*Imagined indentation of an open brace following a statement."
368 (defcustom ess-brace-offset 0
369 "*Extra indentation for open braces.
370 Compares with other text in same context."
374 (defcustom ess-continued-statement-offset 2
375 "*Extra indent for lines not starting new statements."
379 (defcustom ess-continued-brace-offset 0
380 "*Extra indent for substatements that start with open-braces.
381 This is in addition to ess-continued-statement-offset."
385 (defcustom ess-arg-function-offset 2
386 "*Extra indent for internal substatements of function `foo' that called
387 in `arg=foo(...)' form.
388 If not number, the statements are indented at open-parenthesis following foo."
392 ;;added rmh 2Nov97 at request of Terry Therneau
393 (defcustom ess-close-brace-offset 0
394 "*Extra indentation for closing braces."
398 ;;added rmh 2Nov97 at request of Terry Therneau
399 (defcustom ess-fancy-comments t
400 "*Non-nil means distiguish between #, ##, and ### for indentation."
405 ;; PeterDalgaard, 1Apr97 :
406 ;;The default ess-else-offset should be 0, not 2 IMHO (try looking at
407 ;;the ls() function, for instance). Was 2.
408 (defcustom ess-else-offset 0
409 "*Extra indent for `else' lines."
413 (defcustom ess-expression-offset 4
414 "*Extra indent for internal substatements of `expression' that specified
415 in `obj <- expression(...)' form.
416 If not number, the statements are indented at open-parenthesis following
421 ;;;*;;; Editing styles
423 ;;; **FIXME** The following NEEDS to be customized.
424 ;; SJE: I disagree; this variable should not be customized; individual vars,
425 ;; such as ess-indent-level are already customizable.
426 (defvar ess-default-style-list
428 (cons 'ess-indent-level ess-indent-level)
429 (cons 'ess-continued-statement-offset ess-continued-statement-offset)
430 (cons 'ess-brace-offset ess-brace-offset)
431 (cons 'ess-expression-offset ess-expression-offset)
432 (cons 'ess-else-offset ess-else-offset)
433 (cons 'ess-brace-imaginary-offset ess-brace-imaginary-offset)
434 (cons 'ess-continued-brace-offset ess-continued-brace-offset)
435 (cons 'ess-arg-function-offset ess-arg-function-offset)
436 (cons 'ess-close-brace-offset ess-close-brace-offset))
437 "Default style constructed from initial values of indentation variables.")
439 (defvar ess-style-alist
440 (cons ess-default-style-list
441 '((GNU (ess-indent-level . 2)
442 (ess-continued-statement-offset . 2)
443 (ess-brace-offset . 0)
444 (ess-arg-function-offset . 4)
445 (ess-expression-offset . 2)
446 (ess-else-offset . 0)
447 (ess-close-brace-offset . 0))
448 (BSD (ess-indent-level . 8)
449 (ess-continued-statement-offset . 8)
450 (ess-brace-offset . -8)
451 (ess-arg-function-offset . 0)
452 (ess-expression-offset . 8)
453 (ess-else-offset . 0)
454 (ess-close-brace-offset . 0))
455 (K&R (ess-indent-level . 5)
456 (ess-continued-statement-offset . 5)
457 (ess-brace-offset . -5)
458 (ess-arg-function-offset . 0)
459 (ess-expression-offset . 5)
460 (ess-else-offset . 0)
461 (ess-close-brace-offset . 0))
462 (C++ (ess-indent-level . 4)
463 (ess-continued-statement-offset . 4)
464 (ess-brace-offset . -4)
465 (ess-arg-function-offset . 0)
466 (ess-expression-offset . 4)
467 (ess-else-offset . 0)
468 (ess-close-brace-offset . 0))
469 ;; R added ajr 17Feb04 to match "common R" use
470 (RRR (ess-indent-level . 4)
471 (ess-continued-statement-offset . 4)
472 (ess-brace-offset . 0)
473 (ess-arg-function-offset . 4)
474 (ess-expression-offset . 4)
475 (ess-else-offset . 0)
476 (ess-close-brace-offset . 0))
477 ;; CLB added rmh 2Nov97 at request of Terry Therneau
478 (CLB (ess-indent-level . 2)
479 (ess-continued-statement-offset . 4)
480 (ess-brace-offset . 0)
481 (ess-arg-function-offset . 0)
482 (ess-expression-offset . 4)
483 (ess-else-offset . 0)
484 (ess-close-brace-offset . 2))))
485 "Predefined formatting styles for ESS code.
486 Values for all groups, except DEFAULT, are fixed.
487 To change the value of variables in the DEFAULT group, change
488 the corresponding variables, e.g. `ess-indent-level'.
489 The default style in use is controlled by `ess-default-style'.")
491 (defcustom ess-default-style 'DEFAULT
492 "*The default value of `ess-style'.
493 See the variable `ess-style-alist' for how these groups (DEFAULT,
494 GNU, BSD, ...) map onto different settings for variables."
495 :type '(choice (const DEFAULT)
500 (const :tag "Common R" :value 'RRR)
504 (defvar ess-style ess-default-style
505 "*The buffer specific ESS indentation style.")
507 ;;*;; Variables controlling behaviour of dump files
509 (defcustom ess-source-directory "/tmp/"
510 "*Directory in which to place dump files.
511 This can be a string (an absolute directory name ending in a slash) or
512 a lambda expression of no arguments which will return a suitable string
513 value. The lambda expression is evaluated with the process buffer as the
518 '(lambda () (file-name-as-directory
519 (expand-file-name (concat (car ess-search-list) \"/.Src\"))))
521 This always dumps to a sub-directory (\".Src\") of the current ess
522 working directory (i.e. first elt of search list)."
527 (defcustom ess-dump-filename-template-proto (concat (user-login-name) ".%s.S")
528 "*Prototype template for filenames of dumped objects.
529 The ending `S' is replaced by the current \\[ess-suffix], to give
530 \\[ess-dump-filename-template] when an inferior ESS process starts.
532 By default, gives filenames like `user.foofun.S', so as not to clash with
533 other users if you are using a shared directory. Other alternatives:
534 \"%s.S\" ; Don't bother uniquifying if using your own directory(ies)
535 \"dumpdir\"; Always dump to a specific filename. This makes it impossible
536 to edit more than one object at a time, though.
537 (make-temp-name \"scr.\") ; Another way to uniquify"
538 ;; MM: The last 3-4 lines above suck (I don't understand them) -- FIXME --
546 (defcustom ess-mode-hook nil
547 "*Hook for customizing ESS each time it is entered."
551 (defcustom ess-mode-load-hook nil
552 "*Hook to call when ess.el is loaded."
556 (defcustom ess-pre-run-hook nil
557 "*Hook to call before starting up ESS.
558 Good for setting up your directory."
562 (defcustom ess-post-run-hook nil
563 "*Hook to call just after the ESS process starts up.
564 Good for evaluating ESS code."
568 (defcustom inferior-ess-mode-hook nil
569 "*Hook for customizing inferior ESS mode. Called after
570 `inferior-ess-mode' is entered and variables have been initialised."
574 ;;; make it possible to save an inferior-ess-mode buffer without losing
575 ;;; the connection to the running ESS process.
576 (put 'inferior-ess-mode 'mode-class 'special)
577 ;; FIXME AJR: Should the above be there? I don't think so!
578 ;; MM : the functionality should be, right? Move statement to ./ess.el ?
579 ;; AJR: No, we should move the statement to ./ess-inf.el
581 (defcustom ess-help-mode-hook nil
582 "Functions to call when entering `ess-help-mode'. "
586 (defcustom ess-send-input-hook nil
587 "Hook called just before line input is sent to the process."
591 (defcustom ess-transcript-mode-hook nil
592 "Hook for customizing ESS transcript mode."
596 \f ; System variables
598 (defcustom ess-local-process-name nil
599 "The name of the ESS process associated with the current buffer."
601 :type '(choice (const nil) string))
603 (make-variable-buffer-local 'ess-local-process-name)
606 (defcustom ess-kermit-command "gkermit -T"
607 "*Kermit command invoked by `ess-kermit-get' and `ess-kermit-send'."
612 (defcustom ess-kermit-prefix "#"
613 "*String files must begin with to use kermit file transfer."
618 (defcustom ess-kermit-remote-directory "."
619 "*Buffer local variable that designates remote directory of file."
624 (make-variable-buffer-local 'ess-kermit-remote-directory)
626 ;;*;; Regular expressions
628 ;; FIXME : This is just for the S dialects; need to define this for others,
630 ;; {however "XLS-mode" should just use standard lisp "beginning of function"}
632 (defcustom ess-R-function-pattern
636 "\\(\\sw\\|\\s_\\)+\\(<-\\)?" ; symbol (replacement?)
639 "\\(^\\|[ ]\\)" ; beginning of name
640 "\\(\\sw\\|\\s_\\)+" ; symbol
641 "\\)\\)" ; END EITHER OR
642 "\\s-*\\(<-\\|=\\)" ; whitespace, assign, whitespace/nl
643 "\\(\\(\\s-\\|\n\\)*\\s<.*\\s>\\)*" ; whitespace, comment
644 "\\(\\s-\\|\n\\)*function\\s-*(" ; whitespace, function keyword, parenthesis
646 "The regular expression for matching the beginning of an R function."
650 (defcustom ess-S-function-pattern
651 ;; the same as "R" - but allowing "_" in assign
655 "\\(\\sw\\|\\s_\\)+\\(<-\\)?" ; symbol (replacement?)
658 ;; "\\<\\(\\sw\\|\\s_\\)+" ; symbol
659 ;; "[0-9a-zA-Z0-9$.]+" ; symbol
660 "\\(^\\|[ ]\\)" ; beginning of name
661 "\\(\\sw\\|\\s_\\)+" ; symbol
662 "\\)\\)" ; END EITHER OR
663 "\\s-*\\(<-\\|_\\|=\\)" ; whitespace, assign, whitespace/nl
664 "\\(\\(\\s-\\|\n\\)*\\s<.*\\s>\\)*" ; whitespace, comment
665 "\\(\\s-\\|\n\\)*function\\s-*(" ; whitespace, function keyword, parenthesis
667 "The regular expression for matching the beginning of an S function."
672 ;; Fixme: the following is just for S dialects :
673 (defcustom ess-dumped-missing-re
674 "\\(<-\nDumped\n\\'\\)\\|\\(<-\\(\\s \\|\n\\)*\\'\\)"
675 "If a dumped object's buffer matches this re, then it is replaced
676 by `ess-function-template'."
680 (defcustom ess-dump-error-re
681 (if (string= ess-language "S") "\nDumped\n\\'"
683 "Regexp used to detect an error when loading a file."
687 ;;;; This is tested for S dialects (actually only for R) -- be careful with it!
688 (defvar ess-help-arg-regexp "\\(['\"]?\\)\\([^,=)'\"]*\\)\\1"
689 "Reg(ular) Ex(pression) of help(.) arguments. MUST: 2nd \\(.\\) = arg.")
691 \f ; ess-inf: variables for inferior-ess.
693 ;;*;; System dependent variables
695 ;; If you need to change the *-program-name variables, do so in
696 ;; ess-site.el. Do NOT make the changes here!!
697 ;; Keep a copy of your revised ess-site.el to use as a starting point
698 ;; for upgrades of ESS.
700 (defcustom inferior-ess-own-frame nil
701 "*Non-nil means that inferior ESS buffers should start in their own frame.
702 The parameters of this frame are stored in `inferior-ess-frame-alist'."
706 (defcustom inferior-ess-frame-alist default-frame-alist
707 "*Alist of frame parameters used to create new frames for iESS buffers.
708 This defaults to `default-frame-alist' and is used only when
709 the variable `inferior-ess-own-frame' is non-nil."
713 (defcustom inferior-ess-same-window t
714 "*Non-nil indicates new inferior ESS process appears in current window.
715 Otherwise, the new inferior ESS buffer is shown in another window in the
716 current frame. This variable is ignored if `inferior-ess-own-frame' is
721 (defcustom inferior-R-program-name
722 (if ess-microsoft-p "Rterm" "R")
723 "*Program name for invoking an inferior ESS with \\[R]."
727 (defcustom inferior-R-args ""
728 "*String of arguments used when starting R.
729 These arguments are currently not passed to other versions of R that have
730 been created using the variable `ess-r-versions'."
734 (defcustom inferior-R-objects-command "objects(pos=%d, all.names=TRUE)\n"
735 "Format string for R command to get a list of objects at position %d.
736 Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
740 (defcustom ess-r-versions '( "R-1" "R-2")
741 "*List of partial strings for versions of R to access within ESS.
742 Each string specifies the start of a filename. If a filename
743 beginning with one of these strings is found on `exec-path', a M-x
744 command for that version of R is made available. For example, if the
745 file \"R-1.8.1\" is found and this variable includes the string
746 \"R-1\", a function called `M-x R-1.8.1' will be available to run that
748 If duplicate versions of the same program are found (which happens if
749 the same path is listed on `exec-path' more than once), they are
750 ignored by calling `ess-uniq-list'."
752 :type '(repeat string))
755 (defcustom ess-rterm-versions nil
756 "*Construct ess-rterm-versions. If you have versions of R in
757 locations other than in ../../rw*/bin/Rterm.exe, relative to the
758 directory in the `exec-path' variable containing your default location
759 of Rterm, you will need to redefine this variable with a
760 `custom-set-variables' statement in your site-start.el or .emacs
763 :type '(repeat string))
765 (defcustom ess-SHOME-versions
766 '("c:/progra~1/Insightful/splus62"
767 "c:/progra~1/Insightful/splus61"
768 "c:/progra~1/MathSoft/splus6"
769 "c:/progra~1/spls45se"
770 "c:/progra~1/Insightful/splus62netclient"
771 "c:/progra~1/Insightful/splus62net/server"
772 "c:/progra~1/Insightful/splus61netclient"
773 "c:/progra~1/Insightful/splus61net/server"
774 "c:/progra~1/Insightful/splus6se"
775 "c:/progra~1/Insightful/splus61se"
776 "c:/progra~1/Insightful/splus62se"
777 "c:/progra~1/Insightful/splus70"
778 "c:/progra~1/Insightful/splus71")
779 "*List of possible values of the environment variable SHOME for recent
780 releases of S-Plus. These are the default locations for several
781 current and recent releases of S-Plus. If any of these pathnames
782 correspond to a directory on your machine, running the function
783 `ess-sqpe-versions-create' will create a function, for example, `M-x
784 splus62', that will start the corresponding version Sqpe inside an
785 emacs buffer in iESS[S] mode. If you have versions of S-Plus in
786 locations other than these default values, redefine this variable with
787 a `custom-set-variables' statement in your site-start.el or .emacs
788 file. The list of functions actually created appears in the *ESS*
789 buffer and should appear in the \"ESS / Start Process / Other\"
792 :type '(repeat string))
794 (defcustom inferior-S3-program-name "/disk05/s/S"
795 "*Program name for invoking an inferior ESS with S3()."
799 (defcustom inferior-S+3-program-name "Splus"
800 "*Program name for invoking an inferior ESS with S+3()."
804 (defcustom inferior-S+4-program-name "c:/progra~1/spls45se/cmd/Splus.exe"
805 "*Program name for invoking an external GUI S+4.
806 The default value is correct for a default installation of
807 S-Plus 4.5 Student Edition and with bash as the shell.
808 For any other version or location, change this value in ess-site.el or
809 site-start.el. Use the 8.3 version of the pathname.
810 Use double backslashes if you use the msdos shell."
814 (defcustom inferior-S+4-print-command "S_PRINT_COMMAND=gnuclientw.exe"
815 "*Destination of print icon in S+4 Commands window."
819 (defcustom inferior-S+4-editor-pager-command
820 "options(editor='gnuclient.exe', pager='gnuclientw.exe')"
821 "*Programs called by the editor() and pager() functions
822 in S+4 Commands window and in Sqpe+4 buffer."
826 (defcustom inferior-Sqpe+4-program-name "c:/progra~1/spls45se/cmd/Sqpe.exe"
827 "*Program name for invoking an inferior ESS with Sqpe+4()."
831 ;;; SJE - avoid mismatch by changing default nil to ""
832 (defcustom inferior-Sqpe+4-SHOME-name
833 (if ess-microsoft-p "c:/progra~1/spls45se" "")
834 "*SHOME name for invoking an inferior ESS with Sqpe+4().
835 The default value is correct for a default installation of
836 S-Plus 4.5 Student Edition. For any other version or location,
837 change this value in ess-site.el or site-start.el. Use the 8.3
838 version of the pathname."
841 ;;(if ess-microsoft-p
842 ;; (let* ((SHOME (getenv "SHOME"))
843 ;; (PATH (getenv "PATH"))
844 ;; (split-PATH (split-string PATH ";")) ;; Unix uses ":"
848 ;; (while (< num (length split-PATH))
849 ;; (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
850 ;; (if (not (file-exists-p pathname))
851 ;; (setq num (1+ num))
853 ;; (setq num (length split-PATH))
854 ;; (setq SHOME (expand-file-name (concat pathname "/../..")))))))
855 ;; (setq-default inferior-Sqpe+4-SHOME-name SHOME)))
858 (defcustom inferior-S-elsewhere-program-name "sh"
859 "*Program name for invoking an inferior ESS with S on a different computer."
863 (defcustom inferior-ESS-elsewhere-program-name "sh"
864 "*Program name for invoking an inferior ESS with program on a
869 (defcustom inferior-S4-program-name "S4"
870 "*Program name for invoking an inferior ESS with S4()."
874 (defcustom inferior-S+5-program-name "Splus5"
875 "*Program name for invoking an inferior ESS with S+5()."
880 (defcustom inferior-S+6-program-name
881 "c:/progra~1/insigh~1/splus6/cmd/Splus.exe"
882 "*Program name for invoking an external GUI S+6 for Windows.
883 The default value is correct for a default installation of
884 S-Plus 6.0.3 Release 2 and with bash as the shell.
885 For any other version or location, change this value in ess-site.el or
886 site-start.el. Use the 8.3 version of the pathname.
887 Use double backslashes if you use the msdos shell."
890 (defcustom inferior-S+6-program-name "Splus6"
891 "*Program name for invoking an inferior ESS with S+6() for Unix."
895 (defcustom inferior-Splus-args ""
896 "*String of arguments used when starting S.
897 These arguments are currently passed only to S+6."
901 (defcustom inferior-Splus-objects-command "objects(where=%d)\n"
902 "Format string for R command to get a list of objects at position %d.
903 Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
907 (defcustom inferior-S+6-print-command "S_PRINT_COMMAND=gnuclientw.exe"
908 "*Destination of print icon in S+6 for Windows Commands window."
912 (defcustom inferior-S+6-editor-pager-command
913 "options(editor='gnuclient.exe', pager='gnuclientw.exe')"
914 "*Programs called by the editor() and pager() functions
915 in S+6 for Windows Commands window and in Sqpe+6 for Windows buffer."
919 (defcustom inferior-Sqpe+6-program-name
920 "c:/progra~1/insigh~1/splus6/cmd/Sqpe.exe"
921 "*Program name for invoking an inferior ESS with Sqpe+6() for Windows."
925 ;;; SJE - avoid mismatch by changing default nil to ""
926 (defcustom inferior-Sqpe+6-SHOME-name
927 (if ess-microsoft-p "c:/progra~1/insigh~1/splus6" "")
928 "*SHOME name for invoking an inferior ESS with Sqpe+6() for Windows.
929 The default value is correct for a default installation of
930 S-Plus 6.0.3 Release 2. For any other version or location,
931 change this value in ess-site.el or site-start.el. Use the 8.3
932 version of the pathname."
935 ;;(if ess-microsoft-p
936 ;; (let* ((SHOME (getenv "SHOME"))
937 ;; (PATH (getenv "PATH"))
938 ;; (split-PATH (split-string PATH ";")) ;; Unix uses ":"
942 ;; (while (< num (length split-PATH))
943 ;; (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
944 ;; (if (not (file-exists-p pathname))
945 ;; (setq num (1+ num))
947 ;; (setq num (length split-PATH))
948 ;; (setq SHOME (expand-file-name (concat pathname "/../..")))))))
949 ;; (setq-default inferior-Sqpe+6-SHOME-name SHOME)))
951 (defcustom ess-S-quit-kill-buffers-p nil
952 "Controls whether S buffers should also be killed once a process is killed.
953 This is used only when an iESS process is killed using C-c C-q.
955 nil - do not kill any S buffers associated with the process.
956 t - kill S buffers associated with the process.
957 ask - ask the user whether the S buffers should be killed."
959 :type '(choice (const nil) (const t) (const ask)))
961 (defcustom inferior-XLS-program-name "xlispstat"
962 "*Program name for invoking an inferior ESS with \\[XLS]."
966 (defcustom inferior-VST-program-name "vista"
967 "*Program name for invoking an inferior ESS with \\[ViSta]."
971 (defcustom inferior-ARC-program-name "arc"
972 "*Program name for invoking an inferior ESS with \\[ARC]."
976 (defcustom inferior-SAS-program-name "sas"
977 "*Program name for invoking an inferior ESS with SAS()."
981 (defcustom inferior-STA-program-name "env"
982 "*Program name for invoking an inferior ESS with stata().
983 This is NOT Stata, because we need to call stata with TERM=emacs in
984 order for it to work right. And Emacs is too smart for it."
988 (defcustom inferior-OMG-program-name "omegahat"
989 "*Program name for invoking an inferior ESS with omegahat()."
994 ;;;;; names for setting the pager and editor options of the
995 ;;;;; inferior-ess-process
997 ;;; S-editor and S-pager,
998 ;;; R-editor and R-pager,
999 ;;; ess-editor and ess-pager,
1000 ;;; and inferior-ess-language-start
1001 ;;; apply in principle to the 15 files essd[s-]*.el
1002 ;;; Several of the files (essd-sp4.el and essd-sp6w.el) have more
1003 ;;; than one *-customize-alist.
1004 ;;; These variables are currently used only with the S language files for
1008 (if ess-microsoft-p "gnuclient.exe"
1009 (if (equal system-type 'Apple-Macintosh) nil
1010 (if (featurep 'xemacs) "gnuclient -q" "emacsclient"))) ;; unix
1011 "*Editor called by R process with 'edit()' command."
1015 (defcustom R-pager 'nil ; Usually nil is correct as ESS and page() cooperate.
1016 "*Pager called by R process with 'page()' command."
1018 :type '(choice (const nil) string))
1021 (if ess-microsoft-p "gnuclient.exe"
1022 (if (equal system-type 'Apple-Macintosh) nil
1023 (if (featurep 'xemacs) "gnuclient -q" "emacsclient"))) ;; unix
1024 "*Editor called by S process with 'edit()' command."
1029 (if ess-microsoft-p "gnuclientw.exe"
1030 (if (equal system-type 'Apple-Macintosh) nil
1031 (if (featurep 'xemacs) "gnuclient -q" "emacsclient")))
1032 "*Pager called by S process with 'page()' command."
1033 ;; Change made to provide a better help(function) experience with
1035 ;; gnuclient -q will open a buffer with an HTML help file
1036 ;; you can view it with M-x browse-url-of-buffer
1040 (defvar ess-editor nil
1041 "*Editor by which the process sends information to an emacs buffer
1042 for editing and then to be returned to the process.")
1044 (defvar ess-pager nil
1045 "*Pager by which the process sends information to an emacs buffer.")
1047 (defvar inferior-ess-language-start nil
1048 "*Initialization commands sent to the ESS process.")
1050 (make-variable-buffer-local 'ess-editor)
1051 (make-variable-buffer-local 'ess-pager)
1052 (make-variable-buffer-local 'inferior-ess-language-start)
1056 ;;;;; names for communication using MS-Windows 9x/NT ddeclient mechanism
1058 (defcustom inferior-ess-ddeclient nil
1059 "*ddeclient is the intermediary between emacs and the stat program."
1063 (make-variable-buffer-local 'inferior-ess-ddeclient)
1065 (defcustom inferior-ess-client-name nil
1066 "*Name of ESS program ddeclient talks to."
1070 (make-variable-buffer-local 'inferior-ess-client-name)
1072 (defcustom inferior-ess-client-command nil
1073 "*ddeclient command sent to the ESS program."
1075 :type '(choice (const nil) string))
1077 (make-variable-buffer-local 'inferior-ess-client-command)
1079 ;;;;; user settable defaults
1080 (defvar inferior-S-program-name inferior-S+3-program-name
1081 "*Program name for invoking an inferior ESS with S().")
1082 ;;- (setq inferior-S-program
1083 ;;- (cond ((string= S-proc-prefix "S") "Splus")
1084 ;;- ((string= S-proc-prefix "R") "R")
1087 ;;(make-local-variable 'inferior-S-program)
1089 (defvar inferior-ess-program nil ;inferior-S-program-name
1090 "*Default program name for invoking inferior-ess().
1091 The other variables ...-program-name should be changed, for the
1092 corresponding program.")
1094 (make-variable-buffer-local 'inferior-ess-program)
1095 (setq-default inferior-ess-program inferior-S-program-name)
1098 (defvar inferior-ess-start-args ""
1099 "String of arguments passed to the ESS process.
1100 If you wish to pass arguments to a process, see e.g. `inferior-R-args'.")
1102 (defcustom inferior-ess-start-file nil
1103 "*File dumped into process, if non-nil."
1105 :type '(choice (const nil) file))
1107 (defcustom inferior-ess-pager "cat"
1108 "*Pager to use for reporting help files and similar things."
1112 (defcustom inferior-ess-primary-prompt "[a-zA-Z0-9() ]*> ?"
1113 "Regular expression used by `ess-mode' to detect the primary prompt.
1114 Do not anchor to bol with `^'.")
1116 (make-variable-buffer-local 'inferior-ess-primary-prompt)
1117 (setq-default inferior-ess-primary-prompt "[a-zA-Z0-9() ]*> ?")
1119 (defcustom inferior-ess-secondary-prompt "+ ?"
1120 "Regular expression used by ess-mode to detect the secondary prompt.
1121 (This is issued by S to continue an incomplete expression). Do not
1122 anchor to bol with `^'.")
1124 (make-variable-buffer-local 'inferior-ess-secondary-prompt)
1125 (setq-default inferior-ess-secondary-prompt "+ ?")
1127 ;;*;; Variables controlling interaction with the ESS process
1129 (defcustom ess-execute-in-process-buffer nil
1130 "*If non-nil, the ess-execute- commands output to the process buffer.
1131 Otherwise, they get their own temporary buffer."
1135 (defcustom ess-eval-empty nil
1136 "*If non-nil, `ess-eval-line-and-step' and `ess-eval-linewise'
1137 will send empty lines to the ESS process."
1141 (defcustom ess-eval-visibly-p t
1142 "*If non-nil, the ess-eval- commands display the text to be evaluated
1143 in the process buffer."
1147 (defcustom ess-synchronize-evals nil
1148 "*If t, then all evaluations will synchronize with the ESS process. This
1149 means ess-mode will wait for S to dent a prompt before sending the next
1150 line of code. This allows users of Emacs version 18.57 or less to
1151 evaluate large regions of code without causing an error. Users of newer
1152 Emacsen usually do not want this feature, since it locks up use
1153 of Emacs until the code has been successfully evaluated."
1157 (defcustom ess-eval-visibly-at-end t
1158 "*If non-nil, the ess-eval- commands display the results of evaluation
1159 at the bottom of the process buffer."
1163 \f ; System variables
1165 ;;*;; Variables relating to multiple processes
1167 (defcustom ess-current-process-name nil
1168 "Name of the current S process."
1170 :type '(choice (const nil) string))
1172 ;; defconst ess-local-process-name now done in S.el
1174 (defcustom ess-process-name-list nil
1175 "Alist of active ESS processes.")
1177 ;;*;; Inferior ESS commands
1179 (defcustom inferior-ess-load-command "source(\"%s\")\n"
1180 "Format-string for building the ess command to load a file.
1182 This format string should use %s to substitute a file name and should
1183 result in an ESS expression that will command the inferior ESS to load
1188 (defcustom inferior-ess-dump-command "dump(\"%s\",file=\"%s\")\n"
1189 "Format-string for building the ess command to dump an object into a file.
1191 Use first %s to substitute an object name
1192 Use second %s to substitute the dump file name."
1196 (defcustom inferior-ess-help-command "help(\"%s\")\n"
1197 "Format-string for building the ESS command to ask for help on an object.
1199 This format string should use %s to substitute an object name."
1203 (make-variable-buffer-local 'inferior-ess-help-command)
1204 (setq-default inferior-ess-help-command "help(\"%s\")\n")
1206 (defcustom inferior-ess-exit-command "q()\n"
1207 "Format-string for building the ess command to exit.
1209 This format string should use %s to substitute an object name."
1213 (make-variable-buffer-local 'inferior-ess-exit-command)
1214 (setq-default inferior-ess-exit-command "q()\n")
1216 (defvar inferior-ess-search-list-command nil
1217 "`ess-language' command that prints out the search list;
1218 i.e. the list of directories and (recursive) objects that `ess-language' uses
1219 when it searches for objects.
1221 Really set in <ess-lang>-customize-alist in ess[dl]-*.el")
1222 ;; and hence made buffer-local via that scheme...
1224 (defcustom inferior-ess-names-command "names(%s)\n"
1225 "Format string for ESS command to extract names from an object.
1227 %s is replaced by the object name -- usually a list or data frame."
1231 (defcustom inferior-ess-get-prompt-command "options()$prompt\n"
1232 "Command to find the value of the current S prompt."
1236 (defvar ess-cmd-delay nil
1237 "*Set to a positive number if ESS will include delays proportional to
1238 `ess-cmd-delay' in some places. These delays are introduced to
1239 prevent timeouts in certain processes, such as completion.")
1240 (make-variable-buffer-local 'ess-cmd-delay)
1242 (defcustom ess-R-cmd-delay nil
1243 "used to initialize `ess-cmd-delay'."
1245 :type '(choice (const nil) number))
1247 (defcustom ess-S+-cmd-delay 1.0
1248 "used to initialize `ess-cmd-delay'."
1250 :type '(choice (const nil) number))
1252 ;;*;; Regular expressions
1254 (defvar inferior-ess-prompt nil
1255 "The regular expression inferior ess mode uses for recognizing prompts.
1256 Constructed at run time from `inferior-ess-primary-prompt' and
1257 `inferior-ess-secondary-prompt' within `inferior-ess-mode'.")
1259 (make-variable-buffer-local 'inferior-ess-prompt)
1261 (defvar ess-change-sp-regexp ""
1262 "The regexp for matching the S/R/.. commands that change the search path.")
1263 (make-variable-buffer-local 'ess-change-sp-regexp)
1265 (defcustom ess-S+-change-sp-regexp
1266 "\\(attach(\\([^)]\\|$\\)\\|detach(\\|collection(\\|library(\\|module(\\|source(\\)"
1267 "The regexp for matching the S-plus commands that change the search path."
1271 (defcustom ess-S-change-sp-regexp
1272 "\\(attach(\\([^)]\\|$\\)\\|detach(\\|library(\\|source(\\)"
1273 "The regexp for matching the S commands that change the search path."
1277 (defcustom ess-R-change-sp-regexp
1278 "\\(attach(\\([^)]\\|$\\)\\|detach(\\|library(\\|require(\\|source(\\)"
1279 "The regexp for matching the R commands that change the search path."
1284 ;;*;; Process-dependent variables
1286 (defvar ess-search-list nil
1287 "Cache of list of directories and objects to search for ESS objects.")
1289 (make-variable-buffer-local 'ess-search-list)
1291 (defvar ess-sl-modtime-alist nil
1292 "Alist of modification times for all ess directories accessed this
1295 (make-variable-buffer-local 'ess-sl-modtime-alist)
1297 (defvar ess-sp-change nil
1298 "This symbol flags a change in the ess search path.")
1300 (make-variable-buffer-local 'ess-sp-change)
1302 (defvar ess-prev-load-dir/file nil
1303 "This symbol saves the (directory . file) pair used in the last
1304 `ess-load-file' command. Used for determining the default in the next one.")
1306 (make-variable-buffer-local 'ess-prev-load-dir/file)
1308 (defvar ess-object-list nil
1309 ;; This is a list of the currently known object names. It is
1310 ;; current only for one command entry; it exists under the
1311 ;; assumption that the list of objects doesn't change while entering
1313 "Cache of object names")
1315 (make-variable-buffer-local 'ess-object-list)
1317 ;;*;; Miscellaneous system variables
1319 (defvar ess-temp-point nil
1320 "Variable used to retain a buffer position past let or let*.")
1322 (defvar ess-mode-map nil
1323 "Keymap for `ess-mode'.")
1325 (defvar ess-eval-map nil
1326 "Keymap for ess-eval functions.")
1328 (defvar inferior-ess-mode-map nil
1329 "Keymap for `inferior-ess' mode.")
1331 (defvar ess-mode-minibuffer-map nil)
1333 ;; SJE: Wed 29 Dec 2004 - following 3 ess-object* variables can be removed
1334 ;; soon if no-one needs the completion code.
1335 (defvar ess-object-name-db-file "ess-namedb"
1336 "File containing definitions for `ess-object-name-db'.")
1338 (defvar ess-object-name-db-file-loaded '()
1339 "List of programs whose name-db file has been loaded.")
1341 (defvar ess-object-name-db nil
1342 "Alist of lists of object names, with directory names as keys.
1343 The file ess-namedb.el is loaded (if it exists) to define this variable.
1344 See also function `ess-create-object-name-db'.")
1346 (make-variable-buffer-local 'ess-object-name-db)
1347 (setq-default ess-object-name-db nil)
1349 (defcustom ess-S-loop-timeout 2000000
1350 "Integer specifying how many loops ess-mode will wait for the prompt
1351 before signaling an error. Will be set to `ess-loop-timeout' in the S dialects'
1352 alists. Increase this, if you have a fast(er) machine."
1356 (defcustom ess-XLS-loop-timeout 50000
1357 "Integer specifying how many loops ess-mode will wait for the prompt
1358 before signaling an error. Will be set to `ess-loop-timeout' in the XLispStat
1359 dialects' alists. Increase this, if you have a fast(er) machine."
1363 ;; NOTA BENE: Other languages/dialect currently set `ess-loop-timeout'
1364 ;; **directly** in their essd-*.el alist !!
1366 ;;;*;;; Font-lock support
1368 ;;; for programming, transcript, and inferior process modes.
1370 (defcustom inferior-ess-font-lock-input t
1371 "*If non-nil, input is syntactically font-locked.
1372 If nil, input is in the `font-lock-variable-name-face'."
1376 (defvar ess-R-constants
1377 '("TRUE" "FALSE" "NA" "NULL" "Inf" "NaN"))
1379 (defvar ess-S-constants
1380 (append ess-R-constants '("T" "F")))
1382 ;; first the common ones
1383 (defvar ess-S-modifyiers
1384 '("library" "attach" "detach" "source" "module"))
1385 (defvar ess-R-modifyiers
1386 '("library" "attach" "detach" "source" "require"))
1388 (defvar ess-R-keywords
1389 '("while" "for" "in" "repeat" "if" "else" "switch" "break" "next"
1390 "function" "return" "message" "warning" "stop"))
1391 (defvar ess-S-keywords
1392 (append ess-R-keywords '("terminate")))
1394 (defvar ess-R-message-prefixes
1395 '("Error:" "Error in"
1396 "Warning:" "Warning in"
1397 "Warning messages?"))
1398 (defvar ess-S-message-prefixes
1399 (append ess-R-message-prefixes
1400 '("Syntax error:" "Dumped")))
1403 (defvar ess-R-assign-ops
1404 '("<<-" "<-" "->") ; don't want "=" here which is not only for assign
1406 (defvar ess-S-assign-ops
1407 '("<<-" "<-" "_" "->") ; don't want "=" here which is not only for assign
1410 (defvar ess-R-function-name-regexp
1411 (concat "\\s\"?\\(\\(\\sw\\|\\s_\\)+"
1412 "\\(<-\\)?\\)\\s\"?\\s-*\\(<-\\)"
1413 "\\(\\s-\\|\n\\)*function")
1415 (defvar ess-S-function-name-regexp
1416 ess-R-function-name-regexp ; since "_" is deprecated for S-plus as well
1420 (defvar ess-R-mode-font-lock-keywords
1422 (cons (regexp-opt ess-R-assign-ops)
1423 'font-lock-reference-face) ; assign
1424 (cons (concat "\\<" (regexp-opt ess-R-constants 'enc-paren) "\\>")
1425 'font-lock-type-face) ; constants
1426 (cons (concat "\\<" (regexp-opt ess-R-modifyiers 'enc-paren) "\\>")
1427 'font-lock-reference-face) ; modify search list or source
1429 (cons (concat "\\<" (regexp-opt ess-R-keywords 'enc-paren) "\\>")
1430 'font-lock-keyword-face) ; keywords
1431 (cons ess-R-function-name-regexp
1432 '(1 font-lock-function-name-face t))
1435 "Font-lock patterns used in `R-mode' buffers.")
1437 (defvar ess-S-mode-font-lock-keywords
1439 (cons (regexp-opt ess-S-assign-ops)
1440 'font-lock-reference-face) ; assign
1441 (cons (concat "\\<" (regexp-opt ess-S-constants 'enc-paren) "\\>")
1442 'font-lock-type-face) ; constants
1443 (cons (concat "\\<" (regexp-opt ess-S-modifyiers 'enc-paren) "\\>")
1444 'font-lock-reference-face) ; modify search list or source
1446 (cons (concat "\\<" (regexp-opt ess-S-keywords 'enc-paren) "\\>")
1447 'font-lock-keyword-face) ; keywords
1448 (cons ess-S-function-name-regexp
1449 '(1 font-lock-function-name-face t))
1452 "Font-lock patterns used in `S-mode' buffers.")
1457 (defvar inferior-ess-R-font-lock-keywords
1459 '(("^[a-zA-Z0-9 ]*[>+]" . font-lock-keyword-face)) ; "prompt" must be first
1461 (if (not inferior-ess-font-lock-input) ;; don't font-lock input :
1462 (list (cons "^[a-zA-Z0-9 ]*[>+]\\(.*$\\)"
1463 '(1 font-lock-variable-name-face keep t))) )
1465 ess-R-mode-font-lock-keywords
1468 (cons "^\\*\\*\\*.*\\*\\*\\*\\s *$" 'font-lock-comment-face); ess-mode msg
1469 (cons "\\[,?[1-9][0-9]*,?\\]" 'font-lock-reference-face);Vector/matrix labels
1470 (cons (concat "^" (regexp-opt ess-R-message-prefixes 'enc-paren))
1471 'font-lock-reference-face) ; inferior-ess problems or errors
1472 (cons "#" 'font-lock-comment-face) ; comment
1473 (cons "^[^#]*#\\(.*$\\)" '(1 font-lock-comment-face keep t)) ; comments
1475 "Font-lock patterns used in inferior-R-mode buffers.")
1477 (defvar inferior-ess-S-font-lock-keywords
1479 '(("^[a-zA-Z0-9 ]*[>+]" . font-lock-keyword-face)) ; "prompt" must be first
1481 (if (not inferior-ess-font-lock-input) ;; don't font-lock input :
1482 (list (cons "^[a-zA-Z0-9 ]*[>+]\\(.*$\\)"
1483 '(1 font-lock-variable-name-face keep t))) )
1485 ess-S-mode-font-lock-keywords
1488 (cons "^\\*\\*\\*.*\\*\\*\\*\\s *$" 'font-lock-comment-face) ; ess-mode msg
1489 (cons "\\[,?[1-9][0-9]*,?\\]" 'font-lock-reference-face);Vector/matrix labels
1490 (cons (concat "^" (regexp-opt ess-S-message-prefixes 'enc-paren))
1491 'font-lock-reference-face) ; inferior-ess problems or errors
1492 (cons "#" 'font-lock-comment-face) ; comment
1493 (cons "^[^#]*#\\(.*$\\)" '(1 font-lock-comment-face keep t)) ; comments
1495 "Font-lock patterns used in inferior-S-mode buffers.")
1497 ;; use the inferior-* ones directly in ess-trns.el
1498 ;; (defvar ess-trans-font-lock-keywords
1499 ;; inferior-ess-font-lock-keywords
1500 ;; "Font-lock patterns used in `ess-transcript-mode' buffers.")
1503 ;;;*;;; ess-help variables
1506 ;; This will never need to be loaded independently of any of the other
1507 ;; modules, but they can all call it so we may as well put it here.
1509 ;;*;; Variables relating to ess-help-mode
1511 (defcustom ess-help-own-frame nil
1512 "*Controls whether ESS help buffers should start in a different frame.
1514 Possible values are:
1515 nil: Display help in current frame.
1516 'one: All help buffers are shown in one dedicated frame.
1517 t: Each help buffer gets its own frame.
1519 The parameters of this frame are stored in `ess-help-frame-alist'.
1520 See also `inferior-ess-own-frame'."
1522 :type '(choice (const nil) (const one) (const t)))
1524 (defcustom ess-help-frame-alist special-display-frame-alist
1525 "*Alist of frame parameters used to create help frames.
1526 This defaults to `special-display-frame-alist' and is used only when
1527 the variable `ess-help-own-frame' is non-nil."
1532 \f ; User changeable variables
1533 ;;;=====================================================
1534 ;;; Users note: Variables with document strings starting
1535 ;;; with a * are the ones you can generally change safely, and
1536 ;;; may have to upon occasion.
1538 (defcustom ess-help-kill-bogus-buffers nil
1539 "*If non-nil, kill ESS help buffers immediately if they are \"bogus\"."
1543 (defvar ess-help-form 'separate-buffer
1544 "*Place to show help. NOT IMPLEMENTED YET.
1545 Choices are `separate-buffer', `s-process', `www'. The latter uses
1546 `browse-url' to find the location.")
1548 ;; WWW Help NOT included yet. Be patient.
1549 (defvar ess-help-w3-url-prefix "http://pyrite.cfas.washington.edu/ESS/R/"
1550 "*Head URL for finding function help.")
1552 (defvar ess-help-w3-url-funs "funs/"
1553 "Place to find functions.")
1556 \f ; System variables
1557 ;;;=====================================================
1558 ;;; Users note: You will rarely have to change these
1561 ;;*;; Variables relating to ess-help-mode
1563 ;;-- ess-help-S-.. and ess-help-R-.. : in essl-s.el (are used in ess-inf).
1565 (defvar ess-help-sec-keys-alist nil
1566 "Alist of (key . string) pairs for use in section searching.")
1568 (defvar ess-help-sec-regex nil
1569 "Reg(ular) Ex(pression) of section headers in help file")
1571 (make-variable-buffer-local 'ess-help-sec-keys-alist)
1572 (make-variable-buffer-local 'ess-help-sec-regex)
1575 \f ; ess-mode: editing S source
1577 ;;; This syntax table is required by ess-mode.el, ess-inf.el and
1578 ;;; ess-trans.el, so we provide it here.
1579 (defvar ess-mode-syntax-table nil "Syntax table for `ess-mode'.")
1580 (make-variable-buffer-local 'ess-mode-syntax-table)
1583 \f ; Buffer local customization stuff
1585 (defvar ess-source-modes '(ess-mode)
1586 "A list of modes used to determine if a buffer contains ess source code.")
1587 ;;; If a file is loaded into a buffer that is in one of these major modes, it
1588 ;;; is considered an ess source file. The function ess-load-file uses this to
1589 ;;; determine defaults.
1591 (defcustom ess-error-buffer-name "*ESS-errors*"
1592 "Name of buffer to keep process error messages in.
1593 Created for each process."
1597 (defcustom ess-verbose nil
1598 "if non-nil, write more information to `ess-dribble-buffer' than usual."
1602 (defvar ess-dribble-buffer (generate-new-buffer "*ESS*")
1603 "Buffer for temporary use for setting default variable values.
1604 Used for recording status of the program, mainly for debugging.")
1606 (defvar ess-customize-alist nil
1607 "Variable settings to use for proper behavior.
1610 (defvar ess-local-customize-alist nil
1611 "Buffer local settings for proper behavior.
1612 Used to store the values for passing on to newly created buffers.")
1614 (make-variable-buffer-local 'ess-local-customize-alist)
1616 (defvar ess-mode-editing-alist nil
1617 "Variable settings for ess-mode.")
1619 (defvar ess-transcript-minor-mode nil
1620 "Non-nil if using `ess-transcript-mode' as a minor mode of some other mode.")
1622 (make-variable-buffer-local 'ess-transcript-minor-mode)
1624 (defvar ess-listing-minor-mode nil
1625 "Non-nil if using ess-listing-minor-mode.")
1627 (make-variable-buffer-local 'ess-listing-minor-mode)
1631 \f ; Local variables section
1633 ;;; This file is automatically placed in Outline minor mode.
1634 ;;; The file is structured as follows:
1637 ;;; Subsections: ;;;*;;;
1638 ;;; Components: defuns, defvars, defconsts
1639 ;;; Random code beginning with a ;;;;* comment
1641 ;;; Local variables:
1642 ;;; mode: emacs-lisp
1643 ;;; mode: outline-minor
1644 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
1647 ;;; ess-cust.el ends here