Initial Commit
[packages] / xemacs-packages / ess / lisp / essd-sp5.el
1 ;;; essd-sp5.el --- S-plus 5  customization
2
3 ;; Copyright (C) 1998 A.J. Rossini
4 ;; Copyright (C) 1999--2004 A.J. Rossini, Rich M. Heiberger, Martin
5 ;;      Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
6
7 ;; Original Author: A.J. Rossini <rossini@biostat.washington.edu>
8 ;; Created: 9 Nov 1998
9 ;; Maintainers: ESS-core <ESS-core@stat.math.ethz.ch>
10
11 ;; Keywords: start up, configuration.
12
13 ;; This file is part of ESS.
14
15 ;; This file is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; any later version.
19
20 ;; This file is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 ;; GNU General Public License for more details.
24
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING.  If not, write to
27 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28
29 ;;; Commentary:
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.
36
37 ;;; Requires and Autoloads:
38
39 (require 'essl-s)
40
41 (autoload 'inferior-ess "ess-inf" "Run an ESS process.")
42 (autoload 'ess-mode     "ess-mode" "Edit an ESS process.")
43
44 ;;; Code:
45
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...
48
49 (defvar S+5-dialect-name "S+5"
50   "Name of 'dialect' for S-PLUS 5.");easily changeable in a user's .emacs
51
52 (defvar S+5-customize-alist
53   (append
54   '((ess-local-customize-alist     . 'S+5-customize-alist)
55     (ess-dialect                   . S+5-dialect-name)
56      (ess-loop-timeout                  . ess-S-loop-timeout);fixme: dialect spec.
57     (ess-object-name-db-file       . "ess-sp5-namedb.el")
58     (inferior-ess-program          . inferior-S+5-program-name)
59      ;;(inferior-ess-objects-pattern    . ".*") ; for new s4 stuff
60     (inferior-ess-help-command     . "help(\"%s\",pager=\"slynx -dump\",window=F)\n")
61      (inferior-ess-search-list-command  . "searchPaths()\n")
62      (inferior-ess-start-args      . inferior-Splus-args)
63     (ess-STERM  . "iESS")
64     )
65    S+common-cust-alist)
66
67   "Variables to customize for S+5.")
68
69
70 ;; For loading up the S code required for the above.
71 ;;(add-hook 'ess-post-run-hook
72 ;;        '(lambda ()
73 ;;           (ess-command
74 ;;            (concat
75 ;;             "if(exists(\"Sversion\")) library(emacs) else source(\""
76 ;;             ess-mode-run-file
77 ;;             "\")\n"))
78 ;;           (if ess-mode-run-file2
79 ;;               (ess-command
80 ;;                (concat "source(\"" ess-mode-run-file2 "\")\n")))))
81
82
83 (defun S+5 (&optional proc-name)
84   "Call 'Splus5', based on S version 4, from Bell Labs.
85 New way to do it."
86   (interactive)
87   (setq ess-customize-alist S+5-customize-alist)
88   (ess-write-to-dribble-buffer
89    (format "\n(S+5): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer)))
90   (inferior-ess)
91   (if inferior-ess-language-start
92       (ess-eval-linewise inferior-ess-language-start)))
93
94 (defun S+5-mode (&optional proc-name)
95   "Major mode for editing S+5 source.  See `ess-mode' for more help."
96   (interactive)
97   (setq ess-customize-alist S+5-customize-alist)
98   (ess-mode S+5-customize-alist proc-name)
99   (if ess-imenu-use-S (ess-imenu-S)))
100
101 (defun S+5-transcript-mode ()
102   "S-PLUS 5 transcript mode."
103   (interactive)
104   (ess-transcript-mode S+5-customize-alist))
105
106 \f ; Provide package
107
108 (provide 'essd-sp5)
109
110 \f ; Local variables section
111
112 ;;; This file is automatically placed in Outline minor mode.
113 ;;; The file is structured as follows:
114 ;;; Chapters:     ^L ;
115 ;;; Sections:    ;;*;;
116 ;;; Subsections: ;;;*;;;
117 ;;; Components:  defuns, defvars, defconsts
118 ;;;              Random code beginning with a ;;;;* comment
119
120 ;;; Local variables:
121 ;;; mode: emacs-lisp
122 ;;; outline-minor-mode: nil
123 ;;; mode: outline-minor
124 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
125 ;;; End:
126
127 ;;; essd-sp5.el ends here