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>
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)
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:
37 (autoload 'inferior-ess
"ess-inf" "Run an ESS process.")
38 (autoload 'ess-mode
"ess-mode" "Edit an ESS process.")
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
)
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 (ess-retr-lastvalue-command .
"\n")
58 (ess-save-lastvalue-command .
"\n")
59 (inferior-ess-program . inferior-STA-program-name
)
60 (inferior-ess-objects-command .
"description\n")
61 (inferior-ess-help-command .
"set more off\n help %s\n")
62 (inferior-ess-exit-command .
"exit\n")
63 (inferior-ess-primary-prompt .
"^.") ;; "^. ?")
64 (inferior-ess-secondary-prompt .
"^.") ;; "^. ?")
65 (comint-use-prompt-regexp-instead-of-fields . t
) ;; emacs 21 and up
66 (inferior-ess-start-file . nil
) ;"~/.ess-stata")
67 (inferior-ess-start-args .
"")) ; "-q"
68 "Variables to customize for Stata.")
71 (defun STA-mode (&optional proc-name
)
72 "Major mode for editing Stata source. See `ess-mode' for more help."
74 (setq ess-customize-alist STA-customize-alist
)
75 (ess-mode STA-customize-alist proc-name
))
77 (fset 'stata-mode
'STA-mode
)
78 (fset 'Stata-mode
'STA-mode
)
80 (defun stata (&optional start-args
)
83 (setq ess-customize-alist STA-customize-alist
)
84 (ess-write-to-dribble-buffer
85 (format "(STA): ess-dialect=%s , buf=%s \n"
89 (concat "TERM=emacs stata "
90 inferior-ess-start-args
91 (if start-args
(read-string
92 "Starting Args [possibly -k####] ? ")
94 (inferior-ess sta-start-args
)))
97 (defun STA-transcript-mode ()
98 "Stata transcript mode."
100 (ess-transcript-mode STA-customize-alist
))
108 \f ; Local variables section
110 ;;; This file is automatically placed in Outline minor mode.
111 ;;; The file is structured as follows:
114 ;;; Subsections: ;;;*;;;
115 ;;; Components: defuns, defvars, defconsts
116 ;;; Random code beginning with a ;;;;* comment
120 ;;; outline-minor-mode: nil
121 ;;; mode: outline-minor
122 ;;; outline-regexp: "\^L\\|\\`;\\|;;\\*\\|;;;\\*\\|(def[cvu]\\|(setq\\|;;;;\\*"
125 ;;; essd-sta.el ends here