;;; essl-bug.el -- ESS BUGS customization ;; Copyright (C) 2001 Rodney Sparapani ;; Author: Rodney Sparapani ;; Maintainer: A.J. Rossini ;; Created: 27 February 2001 ;; Modified: $Date: 2002/01/24 15:00:44 $ ;; Version: $Revision: 1.20 $ ;; RCS: $Id: essl-bug.el,v 1.20 2002/01/24 15:00:44 rsparapa Exp $/ini ;; Keywords: BUGS, bugs, BACKBUGS, backbugs. ;; 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. ;; ;; In short: you may use this code any way you like, as long as you ;; don't charge money for it, remove this notice, or hold anyone liable ;; for its results. ;; Code: (require 'font-lock) (require 'comint) (require 'ess-emcs) (if (assoc "\\.[bB][uUoO][gG]\\'" auto-mode-alist) nil (setq auto-mode-alist (append '(("\\.[bB][uUoO][gG]\\'" . ess-bugs-mode) ("\\.[bB][mM][dD]\\'" . ess-bugs-mode)) auto-mode-alist) ) ) (defcustom ess-bugs-batch-method (if ess-microsoft-p (if (w32-shell-dos-semantics) 'ms-dos 'sh) (if (equal system-type 'Apple-Macintosh) 'apple-script 'sh)) "Method used by `ess-bugs-batch'. The default is based on the value of the emacs variable `system-type' and, on Windows machines, the function `w32-shell-dos-semantics'. 'ms-dos if *shell* follows MS-DOS semantics 'sh if *shell* runs sh, ksh, csh, tcsh or bash 'apple-script *shell* unavailable, use AppleScript Windows users running MS-DOS in *shell* will get 'ms-dos by default. Windows users running bash in *shell* will get 'sh by default. Unix users will get 'sh by default. Users whose default is not 'sh, but are accessing a remote machine with `telnet', `rlogin', or `ssh', should have the following in ~/.emacs (setq-default ess-bugs-batch-method 'sh)" :group 'ess-bugs ) (defcustom ess-bugs-batch-command "backbugs" ;; (convert-standard-filename ;; (concat ess-lisp-directory "/../etc/" ;; (if (w32-shell-dos-semantics) "backbugs.bat" "backbugs"))) "*ESS[BUGS]: Set to the name of the batch BUGS script that comes with ESS. It allows the user to modify settings in a cross-platform manner. Make sure it is in your PATH." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-batch-post-command (if (equal ess-bugs-batch-method 'sh) "&" " ") "*ESS[BUGS]: Modifiers at the end of the batch BUGS command line." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-batch-pre-command (if (equal ess-bugs-batch-method 'sh) "nohup" (if ess-microsoft-p "start")) "*ESS[BUGS]: Modifiers at the beginning of the batch BUGS command line." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-default-bins "32" "ESS[BUGS]: number of bins to use in the Griddy algorithm (Metropolis sampling)." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-default-burn-in "500" "ESS[BUGS]: burn-in iterations to discard." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-default-update "1000" "ESS[BUGS]: iterations to store." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-default-checkpoint "100" "ESS[BUGS]: make a snapshot every this many iterations." :group 'ess-bugs :type 'string ) (defvar ess-bugs-file "." "ESS[BUGS]: BUGS file with PATH.") (defvar ess-bugs-file-root "." "ESS[BUGS]: Root of BUGS file.") (defvar ess-bugs-file-suffix "." "ESS[BUGS]: Suffix of BUGS file.") (defvar ess-bugs-file-dir "." "ESS[BUGS]: Directory of BUGS file.") (defvar ess-bugs-file-data "..." "ESS[BUGS]: BUGS data file.") (defcustom ess-bugs-inits-suffix ".in" "ESS[BUGS]: BUGS init file suffix." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-data-suffix ".dat" "ESS[BUGS]: BUGS data file suffix." :group 'ess-bugs :type 'string ) (defcustom ess-bugs-suffix-regexp (concat "[.]\\([bB][oOuU][gG]\\|[bB][mM][dD]\\|" (if ess-bugs-inits-suffix (concat "\\|" (downcase ess-bugs-inits-suffix) "\\|" (upcase ess-bugs-inits-suffix))) (if ess-bugs-data-suffix (concat "\\|" (downcase ess-bugs-data-suffix) "\\|" (upcase ess-bugs-data-suffix))) "\\)") "*Regular expression for BUGS suffixes." :group 'ess-bugs :type 'string ) (defvar ess-bugs-monitor-vars " " "ESS[BUGS]: List of BUGS variables to be written out to a file.") (defvar ess-bugs-stats-vars " " "ESS[BUGS]: List of BUGS variables to be summarized with statistics.") (defvar ess-bugs-mode-hook nil "ESS[BUGS]: List of functions to call upon entering mode.") (defvar ess-bugs-mode-map nil "ESS[BUGS]: Keymap for mode.") (if ess-bugs-mode-map nil (setq ess-bugs-mode-map (make-keymap)) (define-key ess-bugs-mode-map (quote [f2]) 'ess-revert-wisely) (define-key ess-bugs-mode-map (quote [f12]) 'ess-bugs-next-action) ) (defvar ess-bugs-syntax-table nil "ESS[BUGS]: Syntax table for mode.") (if ess-bugs-syntax-table nil (setq ess-bugs-syntax-table (make-syntax-table)) (modify-syntax-entry ?\\ "." ess-bugs-syntax-table) (modify-syntax-entry ?# "<" ess-bugs-syntax-table) (modify-syntax-entry ?\n ">" ess-bugs-syntax-table) (modify-syntax-entry ?( "()" ess-bugs-syntax-table) (modify-syntax-entry ?) ")(" ess-bugs-syntax-table) (modify-syntax-entry ?. "w" ess-bugs-syntax-table) ) (defvar ess-bugs-font-lock-keywords (list ;; .bug files (cons "#.*\n" font-lock-comment-face) (cons "^[ \t]*\\(model\\|const\\|data\\|inits\\|var\\)\\>" font-lock-keyword-face) (cons "\\" font-lock-keyword-face) (cons (concat "\\