Initial Commit
[packages] / xemacs-packages / ess / lisp / essd-omg.el
1 ;;; essd-omg.el --- Omega customization
2
3 ;; Copyright (C) 1999 A. J. Rossini
4 ;; Copyright (C) 2000--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: 15 August 1999
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 ;;; This file defines all the S-PLUS 3.x customizations for ess-mode.
31
32 ;;; Requires and Autoloads:
33
34 (require 'essl-omg)
35
36 (autoload 'inferior-ess "ess-inf" "Run an ESS process.")
37 (autoload 'ess-mode     "ess-mode" "Edit an ESS process.")
38
39 ; Code:
40
41 (defvar OMG-dialect-name "OMG"
42   "Name of 'dialect' for Omega.") ;easily changeable in a user's .emacs
43
44 (defvar OMG-customize-alist
45   '((ess-local-customize-alist     . 'OMG-customize-alist)
46     (ess-language                  . "OMG")
47     (ess-dialect                   . "omegahat")
48     (ess-suffix                    . "omg")
49     (ess-loop-timeout              . 5000)
50     (ess-dump-filename-template    . (ess-replace-regexp-in-string
51                                       "S$" ess-suffix ; in the one from custom:
52                                       ess-dump-filename-template-proto))
53     (ess-mode-editing-alist        . OMG-editing-alist)
54     (ess-mode-syntax-table         . OMG-syntax-table)
55     (ess-change-sp-regexp          . "");fixme (if omegahat ever ..)
56     (ess-help-sec-regex            . ess-help-S+-sec-regex)
57     (ess-help-sec-keys-alist       . ess-help-S+sec-keys-alist)
58     (ess-object-name-db-file       . "ess-omg-namedb.el" )
59     (ess-retr-lastvalue-command
60      . ".Last.value = get(\".ess.lvsave\",frame=0)\n")
61     (ess-save-lastvalue-command
62      . "assign(\".ess.lvsave\",.Last.value,frame=0)\n")
63     (inferior-ess-program          . inferior-OMG-program-name)
64     (inferior-ess-objects-command  . "objects(%d)\n")
65     (inferior-ess-help-command     . "help(\"%s\",pager=\"cat\",window=F)\n")
66     (inferior-ess-exit-command     . "q()\n")
67     (inferior-ess-primary-prompt   . "\\[[0-9]*\\]")
68     (inferior-ess-secondary-prompt . ".. ?")
69     (comint-use-prompt-regexp-instead-of-fields . t) ;; emacs 21 and up
70     (inferior-ess-start-file       . nil) ;"~/.ess-omg")
71     (inferior-ess-start-args       . ""))
72  "Variables to customize for OMG (Omegahat)")
73
74
75 (defun OMG (&optional start-args) ; proc-name)
76   "Call Omegahat, from the Omega Group for Statistical Computing."
77   (interactive "P")
78   (setq ess-customize-alist OMG-customize-alist)
79   (ess-write-to-dribble-buffer
80    (format "\n(OMG): ess-dialect=%s, buf=%s\n"
81            ess-dialect
82            (current-buffer)))
83   (let ((omg-start-args
84          (concat inferior-ess-start-args
85                  (if start-args (read-string
86                                  "Starting Args [possibly -CORBA] ? ")
87                    nil))))
88     (inferior-ess omg-start-args)))
89
90
91
92 (fset 'omegahat 'OMG)
93
94 (defun OMG-mode (&optional proc-name)
95   "Major mode for editing Omegahat source.  NOT EVEN STARTED."
96   (interactive)
97   (setq ess-customize-alist OMG-customize-alist)
98   (ess-mode OMG-customize-alist proc-name)
99   ;;(java-mode)
100   (setq major-mode 'OMG-mode))
101
102 (fset 'omegahat-mode 'OMG-mode)
103
104 (defun OMG-transcript-mode ()
105   "Omegahat transcript mode."
106   (interactive)
107   (ess-transcript-mode OMG-customize-alist))
108
109 \f ; Provide package
110
111 (provide 'essd-omg)
112
113 \f ; Local variables section
114
115 ;;; This file is automatically placed in Outline minor mode.
116 ;;; The file is structured as follows:
117 ;;; Chapters:     ^L ;
118 ;;; Sections:    ;;*;;
119 ;;; Subsections: ;;;*;;;
120 ;;; Components:  defuns, defvars, defconsts
121 ;;;              Random code beginning with a ;;;;* comment
122
123 ;;; Local variables:
124 ;;; mode: emacs-lisp
125 ;;; outline-minor-mode: nil
126 ;;; mode: outline-minor
127 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
128 ;;; End:
129
130 ;;; essd-omg.el ends here