1 ;;; essd-sp6.el --- S-Plus 6 customization
3 ;; Copyright (C) 2001--2004 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>
8 ;; Maintainer: ESS Core Team <ESS-core@stat.math.ethz.ch>
10 ;; Keywords: start up, configuration.
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.
29 ;;; AJR copied S+5 to be S+6.
30 ;;; AJR copied S4 to be S+5.
31 ;;; DB contributed the changes from essd-sp3.el to
32 ;;; essd-s4.el. (removed the old ugly approach).
33 ;;; This file defines Sp5 customizations for ess-mode. Lots of thanks
34 ;;; to RMH and JMC for code and suggestions
35 ;;; Thanks to MM for making this sensible.
37 ;;; Requires and Autoloads:
41 (autoload 'inferior-ess "ess-inf" "Run an ESS process.")
42 (autoload 'ess-mode "ess-mode" "Edit an ESS process.")
46 ;; You now need to make sure you've defined if you are running 5.0 or 5.1.
47 ;; Lots of things are broken between them, GRR...
49 (defvar S+6-dialect-name "S+6"
50 "Name of 'dialect' for S-PLUS 6.");easily changeable in a user's .emacs
52 (defun S+6-directory-p (directory)
53 "Splus 5++ directories have a .Data directory and a __Meta directory within."
55 (file-directory-p (concat directory ".Data"))
56 (file-directory-p (concat directory ".Data/__Meta"))))
58 (defvar S+6-directory-function
60 (if (S+6-directory-p default-directory)
62 (or ess-directory default-directory))))
64 (defvar S+6-setup-directory-function
66 (if (and startdir (S+6-directory-p startdir))
70 (concat startdir ":" (getenv "S_WORK"))
71 ;;(message "adding %s to S_WORK" startdir)
75 (defvar S+6-customize-alist
77 '((ess-local-customize-alist . 'S+6-customize-alist)
78 (ess-dialect . S+6-dialect-name)
79 (ess-loop-timeout . ess-S-loop-timeout);fixme: dialect spec.
80 (ess-function-pattern . ess-R-function-pattern)
82 (ess-object-name-db-file . "ess-sp6-namedb.el")
83 (inferior-ess-program . inferior-S+6-program-name)
84 (inferior-ess-help-command . "help(\"%s\",pager=\"slynx -dump\",window=F)\n")
85 (inferior-ess-search-list-command . "searchPaths()\n")
87 (ess-directory-function . S+6-directory-function)
88 (ess-setup-directory-function . S+6-setup-directory-function)
89 (inferior-ess-start-args . inferior-Splus-args)
94 "Variables to customize for S+6.")
97 (defun S+6 (&optional proc-name)
98 "Call 'Splus6', based on S version 4, from Bell Labs.
101 (setq ess-customize-alist S+6-customize-alist)
102 (ess-write-to-dribble-buffer
103 (format "\n(S+6): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer)))
105 (if inferior-ess-language-start
106 (ess-eval-linewise inferior-ess-language-start)))
109 (defun S+6-mode (&optional proc-name)
110 "Major mode for editing S+6 source. See `ess-mode' for more help."
112 (setq ess-customize-alist S+6-customize-alist)
113 (ess-mode S+6-customize-alist proc-name)
114 (if (fboundp 'ess-add-toolbar) (ess-add-toolbar))
115 (if ess-imenu-use-S (ess-imenu-S)))
117 (defun S+6-transcript-mode ()
118 "S-PLUS 6 transcript mode."
120 (ess-transcript-mode S+6-customize-alist))
126 \f ; Local variables section
128 ;;; This file is automatically placed in Outline minor mode.
129 ;;; The file is structured as follows:
132 ;;; Subsections: ;;;*;;;
133 ;;; Components: defuns, defvars, defconsts
134 ;;; Random code beginning with a ;;;;* comment
138 ;;; outline-minor-mode: nil
139 ;;; mode: outline-minor
140 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
143 ;;; essd-sp6.el ends here