~ubuntu-branches/ubuntu/trusty/ess/trusty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
;;; ess-sp5-d.el --- S-plus 5  customization

;; Copyright (C) 1998 A.J. Rossini
;; Copyright (C) 1999--2004 A.J. Rossini, Richard M. Heiberger, Martin
;;      Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.

;; Author: A.J. Rossini <rossini@biostat.washington.edu>
;; Created: 9 Nov 1998
;; Maintainer: ESS-core <ESS-core@r-project.org>

;; Keywords: languages

;; This file is part of ESS.

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

;;; Commentary:

;; AJR copied S4 to be S+5.
;; DB contributed the changes from ess-sp3-d.el to
;; ess-s4-d.el. (removed the old ugly approach).
;; This file defines Sp5 customizations for ess-mode.  Lots of thanks
;; to RMH and JMC for code and suggestions
;; Thanks to MM for making this sensible.

;;; Code:

(autoload 'inferior-ess "ess-inf" "Run an ESS process.")
(autoload 'ess-mode     "ess-mode" "Edit an ESS process.")

(require 'ess-s-l)

;; You now need to make sure you've defined if you are running 5.0 or 5.1.
;; Lots of things are broken between them, GRR...

(defvar S+5-dialect-name "S+5"
  "Name of 'dialect' for S-PLUS 5.");easily changeable in a user's .emacs

(defvar S+5-customize-alist
  (append
   '((ess-local-customize-alist         . 'S+5-customize-alist)
     (ess-dialect                       . S+5-dialect-name)
     (ess-loop-timeout                  . ess-S-loop-timeout);fixme: dialect spec.
     (ess-object-name-db-file           . "ess-sp5-namedb.el")
     (inferior-ess-program              . inferior-S+5-program-name)
     ;;(inferior-ess-objects-pattern    . ".*") ; for new s4 stuff
     (inferior-ess-help-command   . "help(\"%s\", pager=\"slynx -dump\", window=FALSE)\n")
     (inferior-ess-help-filetype . nil)
     (inferior-ess-search-list-command  . "searchPaths()\n")
     (inferior-ess-start-args      . inferior-S+-start-args)
     (ess-STERM  . "iESS")
     )
   S+common-cust-alist)

  "Variables to customize for S+5.")


;; For loading up the S code required for the above.
;;(add-hook 'ess-post-run-hook
;;         (lambda ()
;;           (ess-command
;;            (concat
;;             "if(exists(\"Sversion\")) library(emacs) else source(\""
;;             ess-mode-run-file
;;             "\")\n"))
;;           (if ess-mode-run-file2
;;               (ess-command
;;                (concat "source(\"" ess-mode-run-file2 "\")\n")))))


(defun S+5 (&optional proc-name)
  "Call 'Splus5', based on S version 4, from Bell Labs.
New way to do it."
  (interactive)
  (setq ess-customize-alist S+5-customize-alist)
  (ess-write-to-dribble-buffer
   (format "\n(S+5): ess-dialect=%s, buf=%s\n" ess-dialect (current-buffer)))
  (inferior-ess)
  (if inferior-ess-language-start
      (ess-eval-linewise inferior-ess-language-start)))

(defun S+5-mode (&optional proc-name)
  "Major mode for editing S+5 source.  See `ess-mode' for more help."
  (interactive)
  (setq ess-customize-alist S+5-customize-alist)
  (ess-mode S+5-customize-alist proc-name)
  (if ess-imenu-use-S (ess-imenu-S)))

(defun S+5-transcript-mode ()
  "S-PLUS 5 transcript mode."
  (interactive)
  (ess-transcript-mode S+5-customize-alist))

 ; Provide package

(provide 'ess-sp5-d)

 ; Local variables section

;;; This file is automatically placed in Outline minor mode.
;;; The file is structured as follows:
;;; Chapters:     ^L ;
;;; Sections:    ;;*;;
;;; Subsections: ;;;*;;;
;;; Components:  defuns, defvars, defconsts
;;;              Random code beginning with a ;;;;* comment

;;; Local variables:
;;; mode: emacs-lisp
;;; outline-minor-mode: nil
;;; mode: outline-minor
;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
;;; End:

;;; ess-sp5-d.el ends here