(ess-r-args-get): Do not use zap-to-char within defun,
[ess.git] / lisp / essl-bug.el
blob279dff5b354c61da91e25051ea2c215184490a4c
1 ;;; essl-bug.el -- ESS[BUGS]
2 ;;;WARNING! deprecated; see essl-bugs.el, essd-bugs.el, essd-jags.el
4 ;; Copyright (C) 2001 Rodney Sparapani
5 ;; Copyright (C) 2002--2004 Free Software Foundation, Inc.
6 ;; Copyright (C) 2002--2004 A.J. Rossini, Rich M. Heiberger, Martin
7 ;; Maechler, Kurt Hornik, Rodney Sparapani, and Stephen Eglen.
9 ;; Original Author: Rodney Sparapani <rsparapa@mcw.edu>
10 ;; Created: 27 February 2001
11 ;; Maintainers: ESS-core <ESS-core@stat.math.ethz.ch>
13 ;; Keywords: BUGS, bugs, BACKBUGS, backbugs.
15 ;; This file is part of ESS
17 ;; This file is free software; you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by
19 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; any later version.
22 ;; This file is distributed in the hope that it will be useful,
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;; GNU General Public License for more details.
27 ;; You should have received a copy of the GNU General Public License
28 ;; along with GNU Emacs; see the file COPYING. If not, write to
29 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
31 ;; In short: you may use this code any way you like, as long as you
32 ;; don't charge money for it, remove this notice, or hold anyone liable
33 ;; for its results.
35 ;; Code:
37 (require 'font-lock)
38 (require 'comint)
39 (require 'ess-emcs)
41 (if (assoc "\\.[bB][uUoO][gG]\\'" auto-mode-alist) nil
42 (setq auto-mode-alist
43 (append
44 '(("\\.[bB][uUoO][gG]\\'" . ess-bugs-mode)
45 ("\\.[bB][mM][dD]\\'" . ess-bugs-mode))
46 auto-mode-alist)
50 (defgroup ess-bugs nil
51 "ESS: BUGS."
52 :group 'ess
53 :prefix "ess-")
55 (defcustom ess-bugs-batch-method
56 (if ess-microsoft-p
57 (if (w32-shell-dos-semantics) 'ms-dos 'sh)
58 (if (equal system-type 'Apple-Macintosh) 'apple-script 'sh))
59 "Method used by `ess-bugs-batch'.
60 The default is based on the value of the emacs variable `system-type'
61 and, on Windows machines, the function `w32-shell-dos-semantics'.
62 'ms-dos if *shell* follows MS-DOS semantics
63 'sh if *shell* runs sh, ksh, csh, tcsh or bash
64 'apple-script *shell* unavailable, use AppleScript
66 Windows users running MS-DOS in *shell* will get 'ms-dos by default.
68 Windows users running bash in *shell* will get 'sh by default.
70 Unix users will get 'sh by default.
72 Users whose default is not 'sh, but are accessing a remote machine with
73 `telnet', `rlogin', or `ssh', should have the following in ~/.emacs
74 (setq-default ess-bugs-batch-method 'sh)"
75 :group 'ess-bugs
78 (defcustom ess-bugs-batch-version "0.6"
79 "*ESS[BUGS]: The batch BUGS version to use."
80 :group 'ess-bugs
81 :type 'string
84 ;; SJE Thu 13 May 2004
85 ;; The "backbugs" scripts can be found in ess-etc-directory, so maybe we
86 ;; can use ess-etc-directory here too.
87 (defcustom ess-bugs-batch-command
88 (if (equal ess-bugs-batch-version "0.6") "backbugs"
89 (if (equal ess-bugs-batch-version "0.5") "backbug5"
90 (if (equal ess-bugs-batch-version "jags") "jags" "backbugs")))
91 "*ESS[BUGS]: The name of the command to run BUGS in batch mode.
93 Set to the name of the batch BUGS script that comes with ESS or
94 to the name of BUGS command. Make sure it is in your PATH or
95 add path to the command name."
96 :group 'ess-bugs
97 :type 'string
100 (defcustom ess-bugs-batch-post-command
101 (if (equal ess-bugs-batch-method 'sh) "&" " ")
102 "*ESS[BUGS]: Modifiers at the end of the batch BUGS command line."
103 :group 'ess-bugs
104 :type 'string
107 (defcustom ess-bugs-batch-pre-command
108 (if (equal ess-bugs-batch-method 'sh) "test -f nohup.out && rm -f nohup.out || true; nohup"
109 (if ess-microsoft-p "start"))
110 "*ESS[BUGS]: Modifiers at the beginning of the batch BUGS command line."
111 :group 'ess-bugs
112 :type 'string
115 (defcustom ess-bugs-default-bins (if (equal ess-bugs-batch-version "0.6") "32" " ")
116 "ESS[BUGS]: Number of bins to use in the Griddy algorithm (Metropolis sampling)."
117 :group 'ess-bugs
118 :type 'string
121 (defcustom ess-bugs-default-burn-in "500"
122 "ESS[BUGS]: Burn-in iterations to discard."
123 :group 'ess-bugs
124 :type 'string
127 (defcustom ess-bugs-default-update "1000"
128 "ESS[BUGS]: Iterations to store."
129 :group 'ess-bugs
130 :type 'string
133 (defcustom ess-bugs-default-checkpoint "100"
134 "ESS[BUGS]: Make a snapshot every this many iterations."
135 :group 'ess-bugs
136 :type 'string
139 (defvar ess-bugs-file "."
140 "ESS[BUGS]: BUGS file with PATH.")
142 (defvar ess-bugs-file-root "."
143 "ESS[BUGS]: Root of BUGS file.")
145 (defvar ess-bugs-file-suffix "."
146 "ESS[BUGS]: Suffix of BUGS file.")
148 (defvar ess-bugs-file-dir "."
149 "ESS[BUGS]: Directory of BUGS file.")
151 (defvar ess-bugs-file-data "..."
152 "ESS[BUGS]: BUGS data file.")
154 (defcustom ess-bugs-inits-suffix ".in"
155 "ESS[BUGS]: BUGS init file suffix."
156 :group 'ess-bugs
157 :type 'string
160 (defcustom ess-bugs-data-suffix ".dat"
161 "ESS[BUGS]: BUGS data file suffix."
162 :group 'ess-bugs
163 :type 'string
166 (defcustom ess-bugs-suffix-regexp
167 (concat "[.]\\([bB][oOuU][gG]\\|[bB][mM][dD]\\|"
168 (if ess-bugs-inits-suffix (concat
169 "\\|" (downcase ess-bugs-inits-suffix) "\\|" (upcase ess-bugs-inits-suffix)))
170 (if ess-bugs-data-suffix (concat
171 "\\|" (downcase ess-bugs-data-suffix) "\\|" (upcase ess-bugs-data-suffix)))
172 "\\)")
173 "*ESS[BUGS]: Regular expression for BUGS suffixes."
174 :group 'ess-bugs
175 :type 'string
178 (defcustom ess-bugs-mode-hook nil
179 "*ESS[BUGS]: List of functions to call upon entering mode."
180 :group 'ess-bugs
181 :type 'hook)
183 (defvar ess-bugs-monitor-vars " "
184 "ESS[BUGS]: List of BUGS variables to be written out to a file.")
186 (defvar ess-bugs-stats-vars " "
187 "ESS[BUGS]: List of BUGS variables to be summarized with statistics.")
189 (defvar ess-bugs-mode-map nil
190 "ESS[BUGS]: Keymap for mode.")
192 (if ess-bugs-mode-map nil
193 (setq ess-bugs-mode-map (make-keymap))
194 (define-key ess-bugs-mode-map (quote [f2]) 'ess-revert-wisely)
195 (define-key ess-bugs-mode-map (quote [f12]) 'ess-bugs-next-action)
199 (defvar ess-bugs-syntax-table nil
200 "ESS[BUGS]: Syntax table for mode.")
202 (if ess-bugs-syntax-table nil
203 (setq ess-bugs-syntax-table (make-syntax-table))
204 (modify-syntax-entry ?\\ "." ess-bugs-syntax-table)
205 (modify-syntax-entry ?# "<" ess-bugs-syntax-table)
206 (modify-syntax-entry ?\n ">" ess-bugs-syntax-table)
207 (modify-syntax-entry ?( "()" ess-bugs-syntax-table)
208 (modify-syntax-entry ?) ")(" ess-bugs-syntax-table)
209 (modify-syntax-entry ?. "w" ess-bugs-syntax-table)
213 (defvar ess-bugs-font-lock-keywords
214 (list
215 ;; .bug files
216 (cons "#.*\n" font-lock-comment-face)
218 (cons "^[ \t]*\\(const\\|data\\|in\\(it\\(ialize\\|s\\)\\)?\\|model\\|var\\)\\>"
219 font-lock-keyword-face)
221 ;;(cons "\\<in[ \t]+[1-9]\\>" font-lock-keyword-face)
223 (cons (concat "\\<d\\(bern\\|beta\\|bin\\|cat\\|chisqr\\|"
224 "dexp\\|dirch\\|exp\\|gamma\\|interval\\|lnorm\\|logis\\|"
225 "mnorm\\|multi\\|negbin\\|norm\\|par\\|pois\\|sum\\|"
226 "t\\|unif\\|weib\\|wish\\)[ \t\n]*(")
227 font-lock-reference-face)
229 (cons (concat "\\<\\(for\\|cloglog\\|equals\\|exp\\|inprod\\|"
230 "inverse\\|log\\(det\\|fact\\|gam\\|it\\)?\\|max\\|"
231 "mean\\|min\\|phi\\|pow\\|probit\\|sd\\|sort\\|sqrt\\|"
232 "step\\|sum\\|I\\|T\\)[ \t\n]*(")
233 font-lock-function-name-face)
235 ;; .bmd files
236 (cons (concat "\\<\\(by\\|clear\\|chain\\|checkpoint\\|compile\\|data\\|"
237 "diag\\|help\\|inits\\|iter\\|model\\|monitor\\|"
238 "out\\|q\\|save\\|stats\\|stem\\|thin\\|update\\)[ \t\n]*(")
239 font-lock-function-name-face)
241 (cons "^[ \t]*\\(clear\\|coda\\|exit\\|monitor\\|parameters\\|seed\\|set\\|to\\)\\>"
242 font-lock-keyword-face)
244 ;; .dat files
245 ;;(cons (concat "\\<\\(c\\|list\\)[ \t\n]*(")
246 ;; font-lock-function-name-face)
248 "ESS[BUGS]: Font lock keywords."
252 (defun ess-bugs-file ()
253 "ESS[BUGS]: Set internal variables dealing with BUGS files.
254 Set `ess-bugs-file', `ess-bugs-file-root', `ess-bugs-file-suffix'
255 and `ess-bugs-file-dir'."
256 (let ((ess-bugs-temp-string (buffer-name)))
257 (setq ess-bugs-file (expand-file-name ess-bugs-temp-string))
258 (setq ess-bugs-file-dir
259 (convert-standard-filename (file-name-directory ess-bugs-file)))
260 (setq ess-bugs-file-root
261 (file-name-nondirectory (file-name-sans-extension ess-bugs-file)))
263 (if (fboundp 'file-name-extension)
264 (setq ess-bugs-file-suffix (file-name-extension ess-bugs-temp-string))
265 ;;else
266 (setq ess-bugs-file-suffix (car (last (split-string ess-bugs-temp-string "[.]")))))
268 (setq ess-bugs-file-suffix
269 (downcase (car (split-string (concat "." ess-bugs-file-suffix) "[<]"))))
271 (setq ess-bugs-file (concat ess-bugs-file-dir ess-bugs-file-root ess-bugs-file-suffix))
276 (defun ess-switch-to-suffix (suffix)
277 "ESS: Switch to file with suffix."
278 (find-file (concat ess-bugs-file-dir ess-bugs-file-root suffix))
280 (if (equal 0 (buffer-size)) (progn
281 (if (equal ".bug" suffix) (progn
282 (insert (concat "model %MODEL;\n"))
283 (insert (concat "const N = 0;#%N\n"))
284 (insert "var ;\n")
285 (insert "#%MONITOR;\n")
286 (insert "#%STATS;\n")
287 (insert (concat "data in \"%DATA\";\n"))
288 (insert (concat "inits in \"%INITS\";\n"))
289 (insert "{\n")
290 (insert " for (i in 1:N) {\n \n")
291 (insert " }\n")
292 (insert "}\n")
295 (if (equal ".bmd" suffix) (let
296 ((tmp-bugs-file-dir (if (equal ess-bugs-batch-version "0.6") ess-bugs-file-dir)))
297 (insert (concat "compile(\"" tmp-bugs-file-dir ess-bugs-file-root ".bug\")\n"))
298 (insert (concat "save(\"" tmp-bugs-file-dir ess-bugs-file-root ".in0\")\n"))
299 (insert (concat "update(" ess-bugs-default-burn-in ")\n"))
300 (insert (concat "save(\"" tmp-bugs-file-dir ess-bugs-file-root ".in1\")\n"))
301 (insert "#%MONITOR\n\n#%MONITOR\n")
302 (if (equal ess-bugs-batch-version "0.6")
303 (insert (concat "checkpoint(" ess-bugs-default-checkpoint ")\n")))
304 (insert (concat "update(" ess-bugs-default-update ")\n"))
305 (insert (concat "save(\"" tmp-bugs-file-dir ess-bugs-file-root ".in2\")\n"))
306 (insert "#%STATS\n\n#%STATS\n")
307 (insert "q()\n")
308 ;;(insert "q(\"" ess-bugs-file-dir ess-bugs-file-root ".bog\")\n")
313 (defun ess-exit-notify-sh (string)
314 "Detect completion or failure of submitted job and notify the user."
315 (let* ((exit-done "\\[[0-9]+\\]\\ *\\+*\\ *\\(Exit\\|Done\\).*$")
316 (beg (string-match exit-done string)))
317 (if beg (message (substring string beg (match-end 0))))))
319 (defun ess-bugs-next-action ()
320 "ESS[BUGS]: Perform the appropriate next action."
321 (interactive)
322 (ess-bugs-file)
324 (if (equal ".bug" ess-bugs-file-suffix) (ess-bugs-na-bug))
325 ;;else
326 (if (equal ".bmd" ess-bugs-file-suffix) (ess-bugs-na-bmd))
329 (defun ess-bugs-na-bmd ()
330 "ESS[BUGS]: Perform the Next-Action for .bmd."
332 (save-buffer)
333 (shell)
335 (if (w32-shell-dos-semantics)
336 (if (string-equal ":" (substring ess-bugs-file 1 2))
337 (progn
338 (insert (substring ess-bugs-file 0 2))
339 (comint-send-input)
344 (insert (concat "cd \"" ess-bugs-file-dir "\""))
345 (comint-send-input)
347 (insert (concat ess-bugs-batch-pre-command " " ess-bugs-batch-command " "
348 (if (equal ess-bugs-batch-version "0.6") ess-bugs-default-bins)
349 " " ess-bugs-file-root " "
350 (if (equal ess-bugs-batch-version "0.6")
351 ess-bugs-file (concat ess-bugs-file-root ".bmd"))
352 " " ess-bugs-batch-post-command))
354 (comint-send-input)
358 (defun ess-bugs-na-bug ()
359 "ESS[BUGS]: Perform Next-Action for .bug"
361 (if (equal 0 (buffer-size)) (ess-switch-to-suffix ".bug")
362 (save-excursion (let
363 ((tmp-bugs-file-dir (if (equal ess-bugs-batch-version "0.6") ess-bugs-file-dir)))
364 (goto-char (point-min))
366 (if (search-forward "%MODEL" nil t)
367 (replace-match ess-bugs-file-root t t))
369 (if (search-forward "%DATA" nil t) (progn
370 (setq ess-bugs-file-data
371 (concat tmp-bugs-file-dir ess-bugs-file-root ess-bugs-data-suffix))
372 (replace-match ess-bugs-file-data t t))
373 ;;else
374 (if (search-forward-regexp "data.+in[ \t\n]+\"\\(.*\\)\"" nil t)
375 (setq ess-bugs-file-data (match-string 1))
376 ;;else
377 (setq ess-bugs-file-data "...")
380 (if (search-forward "%INITS" nil t)
381 (replace-match
382 (concat tmp-bugs-file-dir ess-bugs-file-root ess-bugs-inits-suffix) t t))
384 (let ((ess-bugs-temp-string " ")
385 (ess-bugs-buffer-ptr nil))
386 (goto-char (point-min))
388 (if (search-forward-regexp
389 "N[ \t]*=[ \t]*[0-9]+[ \t]*;[ \t]*#[ \t]*%N" nil t) (progn
391 (save-excursion (save-match-data
392 (setq ess-bugs-buffer-ptr (find-buffer-visiting ess-bugs-file-data))
394 (if ess-bugs-buffer-ptr (set-buffer ess-bugs-buffer-ptr)
395 (set-buffer (create-file-buffer ess-bugs-file-data))
396 (insert-file-contents ess-bugs-file-data t))
398 (setq ess-bugs-temp-string
399 (concat "N = "
400 (int-to-string (count-lines (point-min) (point-max))) ";#%N"))
403 (replace-match ess-bugs-temp-string t t)
407 (let (
408 (ess-bugs-search-min nil)
409 (ess-bugs-search-max nil)
410 (ess-bugs-search-vars
411 "\\([a-zA-Z0-9.]+\\)\\(\\(\\[\\)[a-zA-Z0-9]*\\(,\\)?[a-zA-Z0-9]*\\(\\]\\)\\)?[ \t]*[,]?[ \t]*\\(#.*\\)?[\n]?"
414 (goto-char (point-min))
416 (if (search-forward-regexp "%MONITOR[ \t]+" nil t)
417 (setq ess-bugs-search-min (point))
418 ;;else
419 (setq ess-bugs-search-min (search-forward "var"))
422 (setq ess-bugs-search-max (search-forward-regexp ";"))
424 (goto-char ess-bugs-search-min)
425 (setq ess-bugs-monitor-vars "")
427 (while (search-forward-regexp ess-bugs-search-vars ess-bugs-search-max t)
429 (setq ess-bugs-monitor-vars
430 (concat ess-bugs-monitor-vars "monitor("
431 (match-string 1) (match-string 3) (match-string 4) (match-string 5) ")\n"))
434 (setq ess-bugs-monitor-vars
435 (concat "#%MONITOR\n" ess-bugs-monitor-vars "#%MONITOR\n"))
437 (goto-char (point-min))
439 (if (search-forward-regexp "%STATS[ \t]+" nil t) (progn
440 (setq ess-bugs-search-min (point))
441 (setq ess-bugs-search-max (search-forward-regexp ";"))
443 (goto-char ess-bugs-search-min)
444 (setq ess-bugs-stats-vars "")
446 (while (search-forward-regexp ess-bugs-search-vars ess-bugs-search-max t)
448 (setq ess-bugs-stats-vars
449 (concat ess-bugs-stats-vars "stats("
450 (match-string 1) (match-string 3) (match-string 4) (match-string 5) ")\n"))
453 (setq ess-bugs-stats-vars (concat "#%STATS\n" ess-bugs-stats-vars "#%STATS\n"))
456 ;; replace-in-string may not be available, work-around necessary; see below
457 ;; (setq ess-bugs-stats-vars
458 ;; (replace-in-string ess-bugs-monitor-vars "#%MONITOR" "#%STATS"))
459 ;; (setq ess-bugs-stats-vars
460 ;; (replace-in-string ess-bugs-stats-vars "monitor" "stats" t))
462 ;;else
463 (setq ess-bugs-stats-vars ess-bugs-monitor-vars)
465 (while (string-match "#%MONITOR" ess-bugs-stats-vars)
466 (setq ess-bugs-stats-vars
467 (replace-match "#%STATS" t t ess-bugs-stats-vars)))
469 (while (string-match "monitor" ess-bugs-stats-vars)
470 (setq ess-bugs-stats-vars
471 (replace-match "stats" t t ess-bugs-stats-vars)))
478 (save-buffer)
479 (ess-switch-to-suffix ".bmd")
481 (save-excursion
482 (goto-char (point-min))
484 (if (search-forward-regexp "#%MONITOR\\(.\\|\n\\)*#%MONITOR\n" nil t)
485 (replace-match ess-bugs-monitor-vars t))
487 (if (search-forward-regexp "#%STATS\\(.\\|\n\\)*#%STATS\n" nil t)
488 (replace-match ess-bugs-stats-vars t))
495 (defun ess-bugs-mode ()
496 "ESS[BUGS]: Major mode for Classic BUGS."
497 (interactive)
498 (kill-all-local-variables)
499 (setq major-mode 'ess-bugs-mode)
500 (setq mode-name "ESS[BUGS]")
501 (use-local-map ess-bugs-mode-map)
502 (setq font-lock-auto-fontify t)
503 (make-local-variable 'font-lock-defaults)
504 (setq font-lock-defaults '(ess-bugs-font-lock-keywords nil t))
505 (run-hooks 'ess-bugs-mode-hook)
507 (if (not (w32-shell-dos-semantics))
508 (add-hook 'comint-output-filter-functions 'ess-exit-notify-sh))
511 (defun ess-bugs-sci-to-round-4-dp ()
512 "ESS[BUGS]: round output from +/-0.000E+/-0 to 4 decimal places."
513 (interactive)
514 (setq buffer-read-only nil)
515 (save-excursion (goto-char 0)
516 (save-match-data (let ((ess-bugs-replacement-string nil)
517 (ess-bugs-replacement-9 0)
518 (ess-bugs-replacement-diff 0))
519 (while (search-forward-regexp "-?[0-9][.][0-9][0-9][0-9]E[+-][0-9]" nil t)
520 (setq ess-bugs-replacement-string
521 (int-to-string (string-to-number (match-string 0))))
522 (setq ess-bugs-replacement-diff (- (match-end 0) (match-beginning 0)))
523 (save-match-data
524 (setq ess-bugs-replacement-9
525 (string-match "99999999999$" ess-bugs-replacement-string))
527 (if (not ess-bugs-replacement-9)
528 (setq ess-bugs-replacement-9
529 (string-match "000000000001$" ess-bugs-replacement-string))))
531 (if ess-bugs-replacement-9
532 (setq ess-bugs-replacement-string
533 (substring ess-bugs-replacement-string 0 ess-bugs-replacement-9)))
535 (setq ess-bugs-replacement-diff
536 (- ess-bugs-replacement-diff (string-width ess-bugs-replacement-string)))
538 (while (> ess-bugs-replacement-diff 0)
539 (setq ess-bugs-replacement-string (concat ess-bugs-replacement-string " "))
540 (setq ess-bugs-replacement-diff (- ess-bugs-replacement-diff 1)))
542 (replace-match ess-bugs-replacement-string))))))
544 ;;; ESS[BUGS-Shell] for running BUGS interactively
545 (defgroup ess-bugs-shell nil
546 "ESS: BUGS-Shell."
547 :group 'ess-bugs
548 :prefix "ess-")
550 (defcustom ess-bugs-shell-buffer-name "BUGS"
551 "*ESS[BUGS-Shell]: The name of the BUGS-Shell buffer."
552 :group 'ess-bugs-shell
553 :type 'string)
555 (defcustom ess-bugs-shell-command "bugs"
556 "*ESS[BUGS-Shell]: The name of the command to run BUGS interactively.
558 Set to the name of the batch BUGS script that comes with ESS or
559 to the name of BUGS command. Make sure it is in your PATH or
560 add path to the command name."
561 :group 'ess-bugs-shell
562 :type 'string)
564 (defcustom ess-bugs-shell-default-output-file-root "bugs"
565 "*ESS[BUGS-Shell]: Default value for the root of output files."
566 :group 'ess-bugs-shell
567 :type 'string)
569 (defcustom ess-bugs-shell-mode-hook nil
570 "*ESS[BUGS-Shell]: List of functions to call upon entering mode."
571 :group 'ess-bugs-shell
572 :type 'hook)
574 (defun ess-bugs-shell ()
575 "Create a buffer with BUGS running as a subprocess."
576 (interactive)
577 (require 'shell)
578 (switch-to-buffer (concat "*" ess-bugs-shell-buffer-name "*"))
579 (make-comint ess-bugs-shell-buffer-name ess-bugs-shell-command nil
580 ess-bugs-default-bins ess-bugs-shell-default-output-file-root)
581 (comint-mode)
582 (setq shell-dirtrackp t
583 major-mode 'bugs-shell-mode
584 mode-name "ESS[BUGS-Shell]"
585 comint-prompt-regexp "^Bugs> *")
586 (make-local-variable 'font-lock-defaults)
587 (setq font-lock-defaults '(ess-bugs-font-lock-keywords nil t))
588 (run-hooks 'ess-bugs-shell-mode-hook)
591 (provide 'essl-bug)