~ubuntu-branches/ubuntu/raring/ess/raring-proposed

« back to all changes in this revision

Viewing changes to lisp/ess-custom.el

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2012-05-09 08:00:38 UTC
  • mfrom: (1.2.23)
  • Revision ID: package-import@ubuntu.com-20120509080038-7an3nhbtgaj02a17
Tags: 12.04-1-1
New upstream patch version released today

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; ess-custom.el --- Customize variables for ESS
2
2
 
3
3
;; Copyright (C) 1997--2010 A.J. Rossini, Rich M. Heiberger, Martin
4
 
;;      Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
 
4
;;      Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
5
5
;; Copyright (C) 2011--2012 A.J. Rossini, Richard M. Heiberger, Martin Maechler,
6
 
;;      Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu.
 
6
;;      Kurt Hornik, Rodney Sparapani, Stephen Eglen and Vitalie Spinu.
7
7
 
8
 
;; Original Author: A.J. Rossini <blindglobe@gmail.com>
 
8
;; Author: A.J. Rossini <blindglobe@gmail.com>
9
9
;; Created: 05 June 2000
10
 
;; Maintainers: ESS-core <ESS-core@r-project.org>
 
10
;; Maintainer: ESS-core <ESS-core@r-project.org>
11
11
 
12
 
;; Keywords: editing and process modes.
 
12
;; Keywords: languages
13
13
 
14
14
;; This file is part of ESS
15
15
 
26
26
;; You should have received a copy of the GNU General Public License
27
27
;; along with GNU Emacs; see the file COPYING.  If not, write to
28
28
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29
 
;;
30
 
;; In short: you may use this code any way you like, as long as you
31
 
;; don't charge more than a distribution fee for it, do distribute the
32
 
;; source with any binaries, remove this notice, or hold anyone liable
33
 
;; for its results.
34
29
 
35
30
;;; Code:
36
31
 
132
127
  :prefix "ess-")
133
128
;; Variables (not user-changeable)
134
129
 
135
 
(defvar ess-version "YY.MM" ;; updated by 'make'
 
130
(defvar ess-version "12.04-1" ;; updated by 'make'
136
131
  "Version of ESS currently loaded.")
137
132
 
138
 
(defvar ess-revision "YY-MM-rNNNN" ;; updated by 'make'
139
 
  "SVN revision of ESS currently loaded.")
 
133
(defvar ess-revision nil ;; set
 
134
  "The subversion revision and date of ESS.
 
135
Is set  by \\[ess-version-string].")
 
136
 
140
137
 
141
138
(defvar no-doc
142
139
  "This function is part of ESS, but has not yet been loaded.
176
173
 
177
174
;;
178
175
 
179
 
(defcustom ess-handy-commands '(("change-directory"     . ess-change-directory)
180
 
                                ("install.packages"     . ess-install.packages)
181
 
                                ("library"              . ess-library)
182
 
                                ("objects[ls]"          . ess-execute-objects)
183
 
                                ("help-index"           . ess-display-index)
184
 
                                ("help-object"          . ess-display-help-on-object)
185
 
                                ("search"               . ess-execute-search)
186
 
                                ("set-width"            . ess-execute-screen-options)
187
 
                                ("setRepos"             . ess-setRepositories)
188
 
                                ("sos"                  . ess-sos)
189
 
                                ("vignettes"            . ess-display-vignettes)
190
 
                                )
 
176
(defcustom ess-handy-commands '(("change-directory"     . ess-change-directory)
 
177
                                ("install.packages"     . ess-install.packages)
 
178
                                ("library"              . ess-library)
 
179
                                ("objects[ls]"          . ess-execute-objects)
 
180
                                ("help-index"           . ess-display-index)
 
181
                                ("help-object"          . ess-display-help-on-object)
 
182
                                ("search"               . ess-execute-search)
 
183
                                ("set-width"            . ess-execute-screen-options)
 
184
                                ("setRepos"             . ess-setRepositories)
 
185
                                ("sos"                  . ess-sos)
 
186
                                ("vignettes"            . ess-display-vignettes)
 
187
                                )
191
188
  "An alist of custom ESS commands available for call by `ess-smart-comma' function."
192
189
  :group 'ess
193
190
  :type (if (featurep 'emacs) 'alist 'list))
220
217
.emacs (also see ess-site.el)."
221
218
  :group 'ess
222
219
  :type '(choice (const :tag "Initial" :value "Initial")
223
 
                 (const :tag "S"       :value "S")
224
 
                 (const :tag "XLS"     :value "XLS")
225
 
                 (const :tag "SAS"     :value "SAS")
226
 
                 (const :tag "R"       :value "R")))
 
220
                 (const :tag "S"       :value "S")
 
221
                 (const :tag "XLS"     :value "XLS")
 
222
                 (const :tag "SAS"     :value "SAS")
 
223
                 (const :tag "R"       :value "R")))
227
224
 
228
225
(make-variable-buffer-local 'ess-language)
229
226
(setq-default ess-language "Initial")
290
287
  :group 'ess
291
288
  :type '(choice (const :tag "Off" nil)
292
289
                 (const :tag "On" t)
293
 
                 file))
 
290
                 file))
294
291
 
295
292
(defcustom ess-plain-first-buffername t
296
293
  "No fancy process buffname for the first process of each type (novice mode)."
344
341
"
345
342
  :group 'ess
346
343
  :type '(choice (const nil)
347
 
                 (const symbol)
348
 
                 (const symbol-or-paren)
349
 
                 (const symbol-or-paren-or-punct)
350
 
                 (const unless-eol)
351
 
                 (const t)))
 
344
                 (const symbol)
 
345
                 (const symbol-or-paren)
 
346
                 (const symbol-or-paren-or-punct)
 
347
                 (const unless-eol)
 
348
                 (const t)))
352
349
 
353
350
(defalias 'ess-first-tab-never-completes-p  ess-first-tab-never-complete)
354
351
 
468
465
during the load. "
469
466
  :group 'ess-edit
470
467
  :type '(choice (const :tag "Check" :value  'check)
471
 
                 (const :tag "Ask"   :value  'ask)
472
 
                 (const :tag "Always keep"   :value "always")
473
 
                 (const :tag "Always delete"   :value nil)
474
 
                 ))
 
468
                 (const :tag "Ask"   :value  'ask)
 
469
                 (const :tag "Always keep"   :value "always")
 
470
                 (const :tag "Always delete"   :value nil)
 
471
                 ))
475
472
 
476
473
 
477
474
(defcustom ess-delete-dump-files nil
482
479
Boolean flag which determines what to do with the dump files
483
480
generated by \\[ess-dump-object-into-edit-buffer], as follows:
484
481
 
485
 
        If nil: dump files are deleted after each use, and so appear
 
482
        If nil: dump files are deleted after each use, and so appear
486
483
only transiently. The one exception to this is when a loading error
487
484
occurs, in which case the file is retained until the error is
488
485
corrected and the file re-loaded.
489
486
 
490
 
        If non-nil: dump files are not deleted, and backups are kept
 
487
        If non-nil: dump files are not deleted, and backups are kept
491
488
as usual.  This provides a simple method for keeping an archive of S
492
489
functions in text-file form.
493
490
 
633
630
 
634
631
(defvar ess-default-style-list
635
632
  (list 'DEFAULT
636
 
        (cons 'ess-indent-level ess-indent-level)
637
 
        (cons 'ess-continued-statement-offset ess-continued-statement-offset)
638
 
        (cons 'ess-brace-offset ess-brace-offset)
639
 
        (cons 'ess-expression-offset ess-expression-offset)
640
 
        (cons 'ess-else-offset ess-else-offset)
641
 
        (cons 'ess-brace-imaginary-offset ess-brace-imaginary-offset)
642
 
        (cons 'ess-continued-brace-offset ess-continued-brace-offset)
643
 
        (cons 'ess-arg-function-offset ess-arg-function-offset)
644
 
        (cons 'ess-arg-function-offset-new-line ess-arg-function-offset-new-line)
645
 
        (cons 'ess-close-brace-offset ess-close-brace-offset))
 
633
        (cons 'ess-indent-level ess-indent-level)
 
634
        (cons 'ess-continued-statement-offset ess-continued-statement-offset)
 
635
        (cons 'ess-brace-offset ess-brace-offset)
 
636
        (cons 'ess-expression-offset ess-expression-offset)
 
637
        (cons 'ess-else-offset ess-else-offset)
 
638
        (cons 'ess-brace-imaginary-offset ess-brace-imaginary-offset)
 
639
        (cons 'ess-continued-brace-offset ess-continued-brace-offset)
 
640
        (cons 'ess-arg-function-offset ess-arg-function-offset)
 
641
        (cons 'ess-arg-function-offset-new-line ess-arg-function-offset-new-line)
 
642
        (cons 'ess-close-brace-offset ess-close-brace-offset))
646
643
  "Default style constructed from initial values of indentation variables.")
647
644
 
648
645
(defvar ess-style-alist
649
646
  (cons ess-default-style-list
650
 
        '((GNU (ess-indent-level . 2)
651
 
               (ess-continued-statement-offset . 2)
652
 
               (ess-brace-offset . 0)
653
 
               (ess-arg-function-offset . 4)
654
 
               (ess-arg-function-offset-new-line . 4)
655
 
               (ess-expression-offset . 2)
656
 
               (ess-else-offset . 0)
657
 
               (ess-close-brace-offset . 0))
658
 
          (BSD (ess-indent-level . 8)
659
 
               (ess-continued-statement-offset . 8)
660
 
               (ess-brace-offset . -8)
661
 
               (ess-arg-function-offset . 0)
662
 
               (ess-arg-function-offset-new-line . 0)
663
 
               (ess-expression-offset . 8)
664
 
               (ess-else-offset . 0)
665
 
               (ess-close-brace-offset . 0))
666
 
          (K&R (ess-indent-level . 5)
667
 
               (ess-continued-statement-offset . 5)
668
 
               (ess-brace-offset . -5)
669
 
               (ess-arg-function-offset . 0)
670
 
               (ess-arg-function-offset-new-line . 0)
671
 
               (ess-expression-offset . 5)
672
 
               (ess-else-offset . 0)
673
 
               (ess-close-brace-offset . 0))
674
 
          (C++ (ess-indent-level . 4)
675
 
               (ess-continued-statement-offset . 4)
676
 
               (ess-brace-offset . -4)
677
 
               (ess-arg-function-offset . 0)
678
 
               (ess-arg-function-offset-new-line . 0)
679
 
               (ess-expression-offset . 4)
680
 
               (ess-else-offset . 0)
681
 
               (ess-close-brace-offset . 0))
682
 
          ;; R added ajr 17Feb04 to match "common R" use
683
 
          (RRR (ess-indent-level . 4)
684
 
               (ess-continued-statement-offset . 4)
685
 
               (ess-brace-offset . 0)
686
 
               (ess-arg-function-offset . 4)
687
 
               (ess-arg-function-offset-new-line . 4)
688
 
               (ess-expression-offset . 4)
689
 
               (ess-else-offset . 0)
690
 
               (ess-close-brace-offset . 0))
691
 
          ;; CLB added rmh 2Nov97 at request of Terry Therneau
692
 
          (CLB (ess-indent-level . 2)
693
 
               (ess-continued-statement-offset . 4)
694
 
               (ess-brace-offset . 0)
695
 
               (ess-arg-function-offset . 0)
696
 
               (ess-arg-function-offset-new-line . 0)
697
 
               (ess-expression-offset . 4)
698
 
               (ess-else-offset . 0)
699
 
               (ess-close-brace-offset . 2))))
 
647
        '((GNU (ess-indent-level . 2)
 
648
               (ess-continued-statement-offset . 2)
 
649
               (ess-brace-offset . 0)
 
650
               (ess-arg-function-offset . 4)
 
651
               (ess-arg-function-offset-new-line . 4)
 
652
               (ess-expression-offset . 2)
 
653
               (ess-else-offset . 0)
 
654
               (ess-close-brace-offset . 0))
 
655
          (BSD (ess-indent-level . 8)
 
656
               (ess-continued-statement-offset . 8)
 
657
               (ess-brace-offset . -8)
 
658
               (ess-arg-function-offset . 0)
 
659
               (ess-arg-function-offset-new-line . 0)
 
660
               (ess-expression-offset . 8)
 
661
               (ess-else-offset . 0)
 
662
               (ess-close-brace-offset . 0))
 
663
          (K&R (ess-indent-level . 5)
 
664
               (ess-continued-statement-offset . 5)
 
665
               (ess-brace-offset . -5)
 
666
               (ess-arg-function-offset . 0)
 
667
               (ess-arg-function-offset-new-line . 0)
 
668
               (ess-expression-offset . 5)
 
669
               (ess-else-offset . 0)
 
670
               (ess-close-brace-offset . 0))
 
671
          (C++ (ess-indent-level . 4)
 
672
               (ess-continued-statement-offset . 4)
 
673
               (ess-brace-offset . -4)
 
674
               (ess-arg-function-offset . 0)
 
675
               (ess-arg-function-offset-new-line . 0)
 
676
               (ess-expression-offset . 4)
 
677
               (ess-else-offset . 0)
 
678
               (ess-close-brace-offset . 0))
 
679
          ;; R added ajr 17Feb04 to match "common R" use
 
680
          (RRR (ess-indent-level . 4)
 
681
               (ess-continued-statement-offset . 4)
 
682
               (ess-brace-offset . 0)
 
683
               (ess-arg-function-offset . 4)
 
684
               (ess-arg-function-offset-new-line . 2)
 
685
               (ess-expression-offset . 4)
 
686
               (ess-else-offset . 0)
 
687
               (ess-close-brace-offset . 0))
 
688
          ;; CLB added rmh 2Nov97 at request of Terry Therneau
 
689
          (CLB (ess-indent-level . 2)
 
690
               (ess-continued-statement-offset . 4)
 
691
               (ess-brace-offset . 0)
 
692
               (ess-arg-function-offset . 0)
 
693
               (ess-arg-function-offset-new-line . 0)
 
694
               (ess-expression-offset . 4)
 
695
               (ess-else-offset . 0)
 
696
               (ess-close-brace-offset . 2))))
700
697
  "Predefined formatting styles for ESS code.
701
698
Values for all groups, except OWN, are fixed.  To change the
702
699
value of variables in the OWN group, customize the variable
718
715
  :type '(repeat (cons symbol integer))
719
716
  :initialize 'custom-initialize-set
720
717
  :set (lambda (symbol value)
721
 
         (set symbol value)
722
 
         (ess-add-style 'OWN value)))
 
718
         (set symbol value)
 
719
         (ess-add-style 'OWN value)))
723
720
 
724
721
(defcustom ess-default-style 'DEFAULT
725
722
  "The default value of `ess-style'.
726
723
See the variable `ess-style-alist' for how these groups (DEFAULT,
727
724
OWN, GNU, BSD, ...) map onto different settings for variables."
728
725
  :type '(choice (const DEFAULT)
729
 
                 (const OWN)
730
 
                 (const GNU)
731
 
                 (const BSD)
732
 
                 (const K&R)
733
 
                 (const C++)
734
 
                 (const :tag "Common R" :value RRR)
735
 
                 (const CLB))
 
726
                 (const OWN)
 
727
                 (const GNU)
 
728
                 (const BSD)
 
729
                 (const K&R)
 
730
                 (const C++)
 
731
                 (const :tag "Common R" :value RRR)
 
732
                 (const CLB))
736
733
  :group 'ess-edit)
737
734
 
738
735
;; the real setting of this happens via <foo>-editing-alist:
752
749
Possible value:
753
750
 
754
751
 (lambda () (file-name-as-directory
755
 
             (expand-file-name (concat (car ess-search-list) \"/.Src\"))))
 
752
             (expand-file-name (concat (car ess-search-list) \"/.Src\"))))
756
753
 
757
754
This always dumps to a sub-directory (\".Src\") of the current ess
758
755
working directory (i.e. first elt of search list)."
771
768
\"dumpdir\"; Always dump to a specific filename. This makes it impossible
772
769
to edit more than one object at a time, though.
773
770
(make-temp-name \"scr.\") ; Another way to uniquify"
774
 
  ;; MM: The last 3-4 lines above suck (I don't understand them) -- FIXME --
 
771
;; MM: The last 3-4 lines above suck (I don't understand them) -- FIXME --
775
772
 
776
 
  :group 'ess-edit
777
 
  :type 'string)
 
773
:group 'ess-edit
 
774
:type 'string)
778
775
 
779
776
 
780
777
;;*;; Hooks
811
808
;;; the connection to the running ESS process.
812
809
(put 'inferior-ess-mode 'mode-class 'special)
813
810
;; FIXME AJR: Should the above be there?  I don't think so!
814
 
;;       MM : the functionality should be, right? Move statement to ./ess.el ?
 
811
;;       MM : the functionality should be, right? Move statement to ./ess.el ?
815
812
;;       AJR: No, we should move the statement to ./ess-inf.el
816
813
 
817
814
(defcustom ess-help-mode-hook nil
867
864
  :type '(repeat string))
868
865
 
869
866
(defcustom ess-roxy-tags-param '("author" "aliases" "concept"
870
 
                                 "examples" "format" "keywords"
871
 
                                 "method" "exportMethod"
872
 
                                 "name" "note" "param"
873
 
                                 "include" "references" "return"
874
 
                                 "seealso" "source" "docType"
875
 
                                 "title" "TODO" "usage" "import"
 
867
                                 "examples" "format" "keywords"
 
868
                                 "method" "exportMethod"
 
869
                                 "name" "note" "param"
 
870
                                 "include" "references" "return"
 
871
                                 "seealso" "source" "docType"
 
872
                                 "title" "TODO" "usage" "import"
876
873
                                 "exportClass" "exportPattern" "S3method"
877
874
                                 "importFrom" "importClassesFrom"
878
875
                                 "importMethodsFrom" "useDynLib"
884
881
 
885
882
(defcustom ess-roxy-template-alist
886
883
  (list (cons "description"  ".. content for \\description{} (no empty lines) ..")
887
 
        (cons "details" ".. content for \\details{} ..")
888
 
        (cons "title" "")
889
 
        (cons "param"  "")
890
 
        (cons "return" "")
891
 
        (cons "author" ess-user-full-name))
 
884
        (cons "details" ".. content for \\details{} ..")
 
885
        (cons "title" "")
 
886
        (cons "param"  "")
 
887
        (cons "return" "")
 
888
        (cons "author" ess-user-full-name))
892
889
  "The tags and defaults to insert when creating empty templates.
893
890
Param is a place holder for where to enter
894
891
parameters. Description and details do not use @ tags, but are
1028
1025
  :group 'ess-R
1029
1026
  :type 'string)
1030
1027
 
 
1028
(defcustom inferior-STA-start-file nil
 
1029
  "Initialization file for Stata."
 
1030
  :group 'ess-Stata)
 
1031
 
 
1032
(defcustom inferior-STA-start-args ""
 
1033
  "String of switches used when starting stata.
 
1034
Don't use this to send initialization command to stata, use
 
1035
`inferior-STA-start-file' instead. Also see
 
1036
`inferior-STA-program-name'."
 
1037
  :group 'ess-Stata
 
1038
  :type 'string)
 
1039
 
1031
1040
(defcustom inferior-R-objects-command "print(objects(pos=%d, all.names=TRUE), max = 1e6)\n"
1032
1041
  "Format string for R command to get a list of objects at position %d.
1033
1042
Used in e.g., \\[ess-execute-objects] or \\[ess-display-help-on-object]."
1039
1048
(defcustom ess-program-files ;; 32 bit version
1040
1049
  (if ess-microsoft-p
1041
1050
      (if (getenv "ProgramW6432")
1042
 
          (w32-short-file-name (getenv "ProgramFiles(x86)"));; always 32 on 64 bit OS
1043
 
        (w32-short-file-name (getenv "ProgramFiles")))      ;; always 32 on 32 bit OS
 
1051
          (w32-short-file-name (getenv "ProgramFiles(x86)"));; always 32 on 64 bit OS
 
1052
        (w32-short-file-name (getenv "ProgramFiles")))      ;; always 32 on 32 bit OS
1044
1053
    nil)
1045
1054
  "Safe (no embedded blanks) 8.3 name for 32-bit programs that works across internationalization."
1046
1055
  :group 'ess
1066
1075
  :type '(repeat string))
1067
1076
 
1068
1077
(defcustom ess-SHOME-versions
1069
 
    ;;   ess-program-files  ~= "c:/progra~1"  for typical locales/languages
1070
 
    (mapcar
1071
 
     (lambda (ch) (concat ess-program-files ch))
1072
 
     '("/Insightful/splus62"
1073
 
       "/Insightful/splus61"
1074
 
       "/MathSoft/splus6"
1075
 
       "/spls45se"
1076
 
       "/Insightful/splus62netclient"
1077
 
       "/Insightful/splus62net/server"
1078
 
       "/Insightful/splus61netclient"
1079
 
       "/Insightful/splus61net/server"
1080
 
       "/Insightful/splus6se"
1081
 
       "/Insightful/splus61se"
1082
 
       "/Insightful/splus62se"
1083
 
       "/Insightful/splus70"
1084
 
       "/Insightful/splus71"
1085
 
       "/Insightful/splus8.0.1"
1086
 
       "/Insightful/splus8.0.4"
1087
 
       "/Insightful/splus80"
1088
 
       "/TIBCO/splus81"
1089
 
       "/TIBCO/splus82"
1090
 
))
 
1078
  ;;   ess-program-files  ~= "c:/progra~1"  for typical locales/languages
 
1079
  (mapcar
 
1080
   (lambda (ch) (concat ess-program-files ch))
 
1081
   '("/Insightful/splus62"
 
1082
     "/Insightful/splus61"
 
1083
     "/MathSoft/splus6"
 
1084
     "/spls45se"
 
1085
     "/Insightful/splus62netclient"
 
1086
     "/Insightful/splus62net/server"
 
1087
     "/Insightful/splus61netclient"
 
1088
     "/Insightful/splus61net/server"
 
1089
     "/Insightful/splus6se"
 
1090
     "/Insightful/splus61se"
 
1091
     "/Insightful/splus62se"
 
1092
     "/Insightful/splus70"
 
1093
     "/Insightful/splus71"
 
1094
     "/Insightful/splus8.0.1"
 
1095
     "/Insightful/splus8.0.4"
 
1096
     "/Insightful/splus80"
 
1097
     "/TIBCO/splus81"
 
1098
     "/TIBCO/splus82"
 
1099
     ))
1091
1100
  "List of possible values of the environment variable SHOME for recent
1092
1101
releases of S-Plus.  These are the default locations for several
1093
1102
current and recent releases of S-Plus.  If any of these pathnames
1104
1113
  :type '(repeat string))
1105
1114
 
1106
1115
(defcustom ess-SHOME-versions-64
1107
 
    ;;   ess-program-files-64  ~= "c:/progra~1"  for typical locales/languages
1108
 
    (mapcar
1109
 
     (lambda (ch) (concat ess-program-files-64 ch))
1110
 
     '("/TIBCO/splus82"
1111
 
))
 
1116
  ;;   ess-program-files-64  ~= "c:/progra~1"  for typical locales/languages
 
1117
  (mapcar
 
1118
   (lambda (ch) (concat ess-program-files-64 ch))
 
1119
   '("/TIBCO/splus82"
 
1120
     ))
1112
1121
  "List of possible values of the environment variable SHOME for recent
1113
1122
releases of 64-bit S-Plus.  These are the default locations for several
1114
1123
current and recent releases of S-Plus.  If any of these pathnames
1174
1183
  :type 'string)
1175
1184
;;(if ess-microsoft-p
1176
1185
;;    (let* ((SHOME (getenv "SHOME"))
1177
 
;;         (PATH (getenv "PATH"))
1178
 
;;         (split-PATH (split-string PATH ";")) ;; Unix uses ":"
1179
 
;;         (num 0)
1180
 
;;         pathname)
 
1186
;;         (PATH (getenv "PATH"))
 
1187
;;         (split-PATH (split-string PATH ";")) ;; Unix uses ":"
 
1188
;;         (num 0)
 
1189
;;         pathname)
1181
1190
;;      (if (not SHOME)
1182
 
;;        (while (< num (length split-PATH))
1183
 
;;          (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
1184
 
;;          (if (not (file-exists-p pathname))
1185
 
;;              (setq num (1+ num))
1186
 
;;            (progn
1187
 
;;              (setq num (length split-PATH))
1188
 
;;              (setq SHOME (expand-file-name (concat pathname "/../..")))))))
 
1191
;;        (while (< num (length split-PATH))
 
1192
;;          (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
 
1193
;;          (if (not (file-exists-p pathname))
 
1194
;;              (setq num (1+ num))
 
1195
;;            (progn
 
1196
;;              (setq num (length split-PATH))
 
1197
;;              (setq SHOME (expand-file-name (concat pathname "/../..")))))))
1189
1198
;;      (setq-default inferior-Sqpe+4-SHOME-name SHOME)))
1190
1199
 
1191
1200
 
1267
1276
  :type 'string)
1268
1277
;;(if ess-microsoft-p
1269
1278
;;    (let* ((SHOME (getenv "SHOME"))
1270
 
;;         (PATH (getenv "PATH"))
1271
 
;;         (split-PATH (split-string PATH ";")) ;; Unix uses ":"
1272
 
;;         (num 0)
1273
 
;;         pathname)
 
1279
;;         (PATH (getenv "PATH"))
 
1280
;;         (split-PATH (split-string PATH ";")) ;; Unix uses ":"
 
1281
;;         (num 0)
 
1282
;;         pathname)
1274
1283
;;      (if (not SHOME)
1275
 
;;        (while (< num (length split-PATH))
1276
 
;;          (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
1277
 
;;          (if (not (file-exists-p pathname))
1278
 
;;              (setq num (1+ num))
1279
 
;;            (progn
1280
 
;;              (setq num (length split-PATH))
1281
 
;;              (setq SHOME (expand-file-name (concat pathname "/../..")))))))
 
1284
;;        (while (< num (length split-PATH))
 
1285
;;          (setq pathname (concat (nth num split-PATH) "/Sqpe.exe"))
 
1286
;;          (if (not (file-exists-p pathname))
 
1287
;;              (setq num (1+ num))
 
1288
;;            (progn
 
1289
;;              (setq num (length split-PATH))
 
1290
;;              (setq SHOME (expand-file-name (concat pathname "/../..")))))))
1282
1291
;;      (setq-default inferior-Sqpe+6-SHOME-name SHOME)))
1283
1292
 
1284
1293
(defcustom ess-S-quit-kill-buffers-p nil
1311
1320
  :group 'ess-sas
1312
1321
  :type 'string)
1313
1322
 
1314
 
(defcustom inferior-STA-program-name "env"
 
1323
(defcustom inferior-STA-program-name "stata"
1315
1324
  "Program name for invoking an inferior ESS with stata().
1316
1325
This is NOT Stata, because we need to call stata with TERM=emacs in
1317
1326
order for it to work right.  And Emacs is too smart for it."
1350
1359
  :group 'ess
1351
1360
  :type 'string)
1352
1361
 
1353
 
(defcustom R-pager 'nil ; Usually nil is correct as ESS and page() cooperate.
 
1362
(defcustom R-pager 'nil ; Usually nil is correct as ESS and page() cooperate.
1354
1363
  "Pager called by R process with 'page()' command."
1355
1364
  :group 'ess
1356
1365
  :type '(choice (const nil) string))
1434
1443
  "*Program name for invoking an inferior ESS with S().")
1435
1444
;;- (setq inferior-S-program
1436
1445
;;-       (cond ((string= S-proc-prefix "S") "Splus")
1437
 
;;-         ((string= S-proc-prefix "R") "R")
1438
 
;;-         (t "S")
1439
 
;;-         ))
 
1446
;;-         ((string= S-proc-prefix "R") "R")
 
1447
;;-         (t "S")
 
1448
;;-         ))
1440
1449
;;(make-local-variable 'inferior-S-program)
1441
1450
 
1442
1451
(defvar inferior-ess-program nil ;inferior-S-program-name
1474
1483
  "Regular expression used by `ess-mode' to detect the primary prompt.")
1475
1484
 
1476
1485
(make-variable-buffer-local 'inferior-ess-primary-prompt)
1477
 
(setq-default inferior-ess-primary-prompt "> ")
 
1486
;; (setq-default inferior-ess-primary-prompt "> ")
1478
1487
 
1479
 
(defvar inferior-ess-secondary-prompt "+ "
 
1488
(defvar inferior-ess-secondary-prompt nil
1480
1489
  "Regular expression used by ess-mode to detect the secondary prompt.
1481
 
 (This is issued by S to continue an incomplete expression).")
1482
 
  ;; :group 'ess-proc
1483
 
  ;; :type 'string)
 
1490
(This is issued by S to continue an incomplete expression).
 
1491
Set to nil if language doesn't support secondary prompt.")
 
1492
;; :group 'ess-proc
 
1493
;; :type 'string)
1484
1494
 
1485
1495
(make-variable-buffer-local 'inferior-ess-secondary-prompt)
1486
 
(setq-default inferior-ess-secondary-prompt "+ ")
 
1496
;; (setq-default inferior-ess-secondary-prompt "+ ")
1487
1497
 
1488
1498
;; need to recognise  + + + > > >
1489
1499
;; and "+ . + " in tracebug prompt
1546
1556
(defcustom ess-eval-ddeclient-sleep 0.06
1547
1557
  "If non-nil, a number specifying *seconds* to wait after certain
1548
1558
\\[ess-eval-linewise-ddeclient] calls, such as those at startup."
1549
 
;; i.e this currently only applies to (if microsoft-p ...) !
 
1559
  ;; i.e this currently only applies to (if microsoft-p ...) !
1550
1560
  :group 'ess-proc
1551
1561
  :type '(choice (const nil) number))
1552
1562
 
1615
1625
(make-variable-buffer-local 'inferior-ess-help-command)
1616
1626
(setq-default inferior-ess-help-command "help(\"%s\")\n")
1617
1627
 
 
1628
 
1618
1629
(defcustom inferior-ess-r-help-command ".help.ESS(\"%s\", help_type=\"text\")\n"
1619
1630
  "Format-string for building the R command to ask for help on an object.
1620
1631
 
1623
1634
  :group 'ess-command
1624
1635
  :type 'string)
1625
1636
 
 
1637
(defvar ess-get-help-topics-function nil
 
1638
  "Dialect specific help topics retrival"
 
1639
  )
 
1640
(make-variable-buffer-local 'ess-get-help-topics-function)
1626
1641
 
1627
1642
(defcustom inferior-ess-exit-command "q()\n"
1628
1643
  "Format-string for building the ess command to exit.
1640
1655
when it searches for objects.
1641
1656
 
1642
1657
Really set in <ess-lang>-customize-alist in ess[dl]-*.el")
 
1658
(make-variable-buffer-local 'inferior-ess-search-list-command)
 
1659
 
1643
1660
;; and hence made buffer-local via that scheme...
1644
1661
 
1645
1662
;; ;; FIXME: this is nowhere used :
1681
1698
  :type '(choice (const nil) number))
1682
1699
 
1683
1700
;;*;; Regular expressions
1684
 
 
1685
1701
(defvar inferior-ess-prompt nil
1686
1702
  "The regular expression  used for recognizing prompts.
1687
1703
 
1688
1704
It is always used in transcript mode.  In inferior ess mode it is
1689
1705
used only if `comint-use-prompt-regexp' is t.
1690
1706
 
1691
 
If not set in language cust-alist it is constructed at run time
 
1707
If not set in language's customise-alist it is constructed at run time
1692
1708
from `inferior-ess-primary-prompt' and
1693
 
`inferior-ess-secondary-prompt' within \\[ess-multi].")
 
1709
`inferior-ess-secondary-prompt' within `ess-multi'.")
1694
1710
 
1695
1711
(make-variable-buffer-local 'inferior-ess-prompt)
1696
1712
 
1759
1775
;;*;; Miscellaneous system variables
1760
1776
 
1761
1777
(defvar ess-temp-point nil
1762
 
 "Variable used to retain a buffer position past let or let*.")
 
1778
  "Variable used to retain a buffer position past let or let*.")
1763
1779
 
1764
1780
(defvar ess-mode-map nil
1765
1781
  "Keymap for `ess-mode'.")
1838
1854
          '("NA_integer_" "NA_real_" "NA_complex_" "NA_character_")))
1839
1855
(defvar ess-S-constants
1840
1856
  (append ess-RS-constants
1841
 
          '("T" "F")))
 
1857
          '("T" "F")))
1842
1858
 
1843
1859
(defvar ess-R-keywords
1844
1860
  ;; "Reserved Words" -- part 2 --
1865
1881
    "Warning messages"))
1866
1882
(defvar ess-S-message-prefixes
1867
1883
  (append ess-R-message-prefixes
1868
 
          '("Syntax error:" "Dumped")))
 
1884
          '("Syntax error:" "Dumped")))
1869
1885
 
1870
1886
;;
1871
1887
(defvar ess-R-assign-ops
1872
1888
  '("<<-" "<-" "->") ; don't want "=" here which is not only for assign
1873
 
)
 
1889
  )
1874
1890
(defvar ess-S-assign-ops
1875
1891
  '("<<-" "<-" "_" "->") ; don't want "=" here which is not only for assign
1876
 
)
 
1892
  )
1877
1893
 
1878
1894
;; Note: \\s\" is really \s" which means match a char belonging to the
1879
1895
;; "quote character" syntax class.
1880
1896
(defvar ess-R-function-name-regexp
1881
1897
  (concat "\\s\"?\\(\\(\\sw\\|\\s_\\)+"
1882
 
          "\\(<-\\)?\\)\\s\"?\\s-*\\(<-\\)"
1883
 
          "\\(\\s-\\|\n\\)*function")
1884
 
)
 
1898
          "\\(<-\\)?\\)\\s\"?\\s-*\\(<-\\)"
 
1899
          "\\(\\s-\\|\n\\)*function")
 
1900
  )
1885
1901
(defvar ess-S-function-name-regexp
1886
1902
  ess-R-function-name-regexp ; since "_" is deprecated for S-plus as well
1887
 
)
 
1903
  )
1888
1904
 
1889
1905
(defvar ess-R-common-font-lock-keywords
1890
1906
  (list
1891
1907
   (cons (regexp-opt ess-R-assign-ops)
1892
 
         'font-lock-reference-face)     ; assign
 
1908
         'font-lock-reference-face)     ; assign
1893
1909
   (cons (concat "\\<" (regexp-opt ess-R-constants 'enc-paren) "\\>")
1894
 
         'font-lock-type-face)          ; constants
 
1910
         'font-lock-type-face)          ; constants
1895
1911
   (cons (concat "\\<" (regexp-opt ess-R-modifyiers 'enc-paren) "\\>")
1896
 
         'font-lock-reference-face)     ; modify search list or source
1897
 
                                        ; new definitions
 
1912
         'font-lock-reference-face)     ; modify search list or source
 
1913
                                        ; new definitions
1898
1914
   (cons ess-R-function-name-regexp
1899
 
         '(1 font-lock-function-name-face t))
1900
 
                                        ; function name
 
1915
         '(1 font-lock-function-name-face t))
 
1916
                                        ; function name
1901
1917
   )
1902
1918
  "Font-lock patterns used in `R-mode' and R-output buffers.")
1903
1919
 
1904
1920
(defvar ess-R-mode-font-lock-keywords
1905
1921
  (append ess-R-common-font-lock-keywords
1906
 
          (list (cons (concat "\\<" (regexp-opt ess-R-keywords 'enc-paren) "\\>")
1907
 
                      'font-lock-keyword-face))) ; keywords
 
1922
          (list (cons (concat "\\<" (regexp-opt ess-R-keywords 'enc-paren) "\\>")
 
1923
                      'font-lock-keyword-face))) ; keywords
1908
1924
  "Font-lock patterns used in `R-mode' buffers.")
1909
1925
 
1910
1926
(defvar ess-S-common-font-lock-keywords
1911
1927
  (list
1912
1928
   (cons (regexp-opt ess-S-assign-ops)
1913
 
         'font-lock-reference-face)     ; assign
 
1929
         'font-lock-reference-face)     ; assign
1914
1930
   (cons (concat "\\<" (regexp-opt ess-S-constants 'enc-paren) "\\>")
1915
 
         'font-lock-type-face)          ; constants
 
1931
         'font-lock-type-face)          ; constants
1916
1932
   (cons (concat "\\<" (regexp-opt ess-S-modifyiers 'enc-paren) "\\>")
1917
 
         'font-lock-reference-face)     ; modify search list or source
1918
 
                                        ; new definitions
 
1933
         'font-lock-reference-face)     ; modify search list or source
 
1934
                                        ; new definitions
1919
1935
   (cons ess-S-function-name-regexp
1920
 
         '(1 font-lock-function-name-face t))
1921
 
                                        ; function name
 
1936
         '(1 font-lock-function-name-face t))
 
1937
                                        ; function name
1922
1938
   )
1923
1939
  "Font-lock patterns used in `S-mode' and S-output buffers.")
1924
1940
 
1925
1941
(defvar ess-S-mode-font-lock-keywords
1926
1942
  (append ess-S-common-font-lock-keywords
1927
 
          (list (cons (concat "\\<" (regexp-opt ess-S-keywords 'enc-paren) "\\>")
1928
 
                'font-lock-keyword-face)))      ; keywords
 
1943
          (list (cons (concat "\\<" (regexp-opt ess-S-keywords 'enc-paren) "\\>")
 
1944
                      'font-lock-keyword-face)))        ; keywords
1929
1945
  "Font-lock patterns used in `S-mode' buffers.")
1930
1946
 
1931
1947
 
1936
1952
 
1937
1953
   (if (not inferior-ess-font-lock-input) ;; don't font-lock input :
1938
1954
       (list (cons "^[a-zA-Z0-9 ]*[>+]\\(.*$\\)"
1939
 
                   '(1 font-lock-variable-name-face keep t))) )
 
1955
                   '(1 font-lock-variable-name-face keep t))) )
1940
1956
 
1941
1957
   ess-R-common-font-lock-keywords
1942
1958
 
1944
1960
    (cons "^\\*\\*\\*.*\\*\\*\\*\\s *$" 'font-lock-comment-face); ess-mode msg
1945
1961
    (cons "\\[,?[1-9][0-9]*,?\\]" 'font-lock-reference-face);Vector/matrix labels
1946
1962
    (cons (concat "^" (regexp-opt ess-R-message-prefixes 'enc-paren))
1947
 
          'font-lock-reference-face) ; inferior-ess problems or errors
 
1963
          'font-lock-reference-face) ; inferior-ess problems or errors
1948
1964
    (cons "#" 'font-lock-comment-face) ; comment
1949
1965
    (cons "^[^#]*#\\(.*$\\)" '(1 font-lock-comment-face keep t)) ; comments
1950
1966
    ))
1956
1972
 
1957
1973
   (if (not inferior-ess-font-lock-input) ;; don't font-lock input :
1958
1974
       (list (cons "^[a-zA-Z0-9 ]*[>+]\\(.*$\\)"
1959
 
                   '(1 font-lock-variable-name-face keep t))) )
 
1975
                   '(1 font-lock-variable-name-face keep t))) )
1960
1976
 
1961
1977
   ess-S-common-font-lock-keywords
1962
1978
 
1964
1980
    (cons "^\\*\\*\\*.*\\*\\*\\*\\s *$" 'font-lock-comment-face) ; ess-mode msg
1965
1981
    (cons "\\[,?[1-9][0-9]*,?\\]" 'font-lock-reference-face);Vector/matrix labels
1966
1982
    (cons (concat "^" (regexp-opt ess-S-message-prefixes 'enc-paren))
1967
 
          'font-lock-reference-face) ; inferior-ess problems or errors
1968
 
    (cons "#" 'font-lock-comment-face)  ; comment
 
1983
          'font-lock-reference-face) ; inferior-ess problems or errors
 
1984
    (cons "#" 'font-lock-comment-face)  ; comment
1969
1985
    (cons "^[^#]*#\\(.*$\\)" '(1 font-lock-comment-face keep t)) ; comments
1970
1986
    ))
1971
1987
  "Font-lock patterns used in inferior-S-mode buffers.")
2051
2067
are: 'message' (the default) or 'tooltip'."
2052
2068
  :group 'ess-R
2053
2069
  :type '(choice
2054
 
          (const :tag "message" :value 'message)
2055
 
          (const :tag "tooltip" :value 'tooltip)))
 
2070
          (const :tag "message" :value 'message)
 
2071
          (const :tag "tooltip" :value 'tooltip)))
2056
2072
 
2057
2073
(defcustom ess-r-args-keep-silent ess-S-non-functions
2058
2074
  "List of functions names which should *not* trigger \\[ess-r-args-show];