*** empty log message ***
[ess.git] / lisp / essd-sta.el
blobdb028956f66f4b545d1ba3e818457c6739bb025d
1 ;;; essd-sta.el --- Stata customization
3 ;; Copyright (C) 1997--1999 A. J. Rossini, Thomas Lumley
4 ;; Copyright (C) 1997--2004 A.J. Rossini, Rich M. Heiberger, Martin
5 ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
7 ;; Original Author: A.J. Rossini <rossini@biostat.washington.edu>
8 ;; Created: 9 Sep 1998
9 ;; Maintainers: ESS-core <ESS-core@stat.math.ethz.ch>
11 ;; Keywords: start up, configuration.
13 ;; This file is part of ESS
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.
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.
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.
29 ;;; Commentary: This file defines all the Stata customizations for
30 ;;; ess-mode. It is somewhat based on Stata-mode by Thomas Lumley
31 ;;; <thomas@biostat.washington.edu>.
33 ;;; Requires and Autoloads:
35 (require 'essl-sta)
37 (autoload 'inferior-ess "ess-inf" "Run an ESS process.")
38 (autoload 'ess-mode "ess-mode" "Edit an ESS process.")
40 ; Code:
42 (defvar STA-dialect-name "Stata"
43 "Name of 'dialect' for Stata.");easily changeable in a user's .emacs
45 (defvar STA-customize-alist
46 '((ess-local-customize-alist . 'STA-customize-alist)
47 (ess-language . "STA")
48 (ess-dialect . STA-dialect-name)
49 (ess-suffix . "ado")
50 (ess-mode-editing-alist . STA-editing-alist)
51 (ess-mode-syntax-table . STA-syntax-table)
52 (ess-mode-edit . 'STA-mode)
53 (ess-help-sec-regex . ess-help-STA-sec-regex)
54 (ess-help-sec-keys-alist . ess-help-STA-sec-keys-alist)
55 (ess-loop-timeout . 500000 )
56 (ess-object-name-db-file . "ess-sta-namedb.el" )
57 (inferior-ess-font-lock-keywords . ess-STA-mode-font-lock-keywords)
58 (inferior-ess-program . inferior-STA-program-name)
59 (inferior-ess-objects-command . "description\n")
60 (inferior-ess-help-command . "set more off\n help %s\n")
61 (inferior-ess-exit-command . "exit\n")
62 (inferior-ess-primary-prompt . "^.") ;; "^. ?")
63 (inferior-ess-secondary-prompt . "^.") ;; "^. ?")
64 (comint-use-prompt-regexp-instead-of-fields . t) ;; emacs 21 and up
65 (inferior-ess-start-file . nil) ;"~/.ess-stata")
66 (inferior-ess-start-args . "")) ; "-q"
67 "Variables to customize for Stata.")
70 (defun STA-mode (&optional proc-name)
71 "Major mode for editing Stata source. See `ess-mode' for more help."
72 (interactive)
73 (setq ess-customize-alist STA-customize-alist)
74 (ess-mode STA-customize-alist proc-name))
76 (fset 'stata-mode 'STA-mode)
77 (fset 'Stata-mode 'STA-mode)
79 (defun stata (&optional start-args)
80 "Call Stata."
81 (interactive "P")
82 (setq ess-customize-alist STA-customize-alist)
83 (ess-write-to-dribble-buffer
84 (format "(STA): ess-dialect=%s , buf=%s \n"
85 ess-dialect
86 (current-buffer)))
87 (let ((sta-start-args
88 (concat "TERM=emacs stata "
89 inferior-ess-start-args
90 (if start-args (read-string
91 "Starting Args [possibly -k####] ? ")
92 nil))))
93 (inferior-ess sta-start-args)))
96 (defun STA-transcript-mode ()
97 "Stata transcript mode."
98 (interactive)
99 (ess-transcript-mode STA-customize-alist))
103 \f ; Provide package
105 (provide 'essd-sta)
107 \f ; Local variables section
109 ;;; This file is automatically placed in Outline minor mode.
110 ;;; The file is structured as follows:
111 ;;; Chapters: ^L ;
112 ;;; Sections: ;;*;;
113 ;;; Subsections: ;;;*;;;
114 ;;; Components: defuns, defvars, defconsts
115 ;;; Random code beginning with a ;;;;* comment
117 ;;; Local variables:
118 ;;; mode: emacs-lisp
119 ;;; outline-minor-mode: nil
120 ;;; mode: outline-minor
121 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
122 ;;; End:
124 ;;; essd-sta.el ends here