summaryrefslogtreecommitdiff
path: root/lisp/generic-x.el
diff options
context:
space:
mode:
authorPeter Breton <pbreton@attbi.com>1999-10-16 04:11:07 +0000
committerPeter Breton <pbreton@attbi.com>1999-10-16 04:11:07 +0000
commit01fdb1dd7391bdd1c5b9d8fee71bbf537db0ffb6 (patch)
treedec8be056e3c6d18fcbe8ec6893e85950722c9d0 /lisp/generic-x.el
parentffe0c7efca0083b6d680b3cd43683f7297cfc530 (diff)
downloademacs-01fdb1dd7391bdd1c5b9d8fee71bbf537db0ffb6.tar.gz
(bat-generic-mode-keymap): Added thio variable
(bat-generic-mode-compile): Added this function (bat-generic-mode-run-as-comint): Added this function
Diffstat (limited to 'lisp/generic-x.el')
-rw-r--r--lisp/generic-x.el41
1 files changed, 41 insertions, 0 deletions
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 706c985d52a..ebf874b387c 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -400,6 +400,46 @@ you must reload generic-x to enable the specified modes."
(defvar bat-generic-mode-syntax-table nil
"Syntax table in use in bat-generic-mode buffers.")
+ (defvar bat-generic-mode-keymap (make-sparse-keymap)
+ "Keymap for bet-generic-mode.")
+
+ (defun bat-generic-mode-compile ()
+ "Run the current BAT file in a compilation buffer."
+ (interactive)
+ (let ((compilation-buffer-name-function
+ (function
+ (lambda(ign)
+ (concat "*" (buffer-file-name) "*")))
+ )
+ )
+ (compile
+ (concat (w32-shell-name) " -c " (buffer-file-name)))))
+
+ (defun bat-generic-mode-run-as-comint ()
+ "Run the current BAT file in a comint buffer."
+ (interactive)
+ (require 'comint)
+ (let* ((file (buffer-file-name))
+ (buf-name (concat "*" file "*")))
+ (save-excursion
+ (set-buffer
+ (get-buffer-create buf-name))
+ (erase-buffer)
+ (comint-mode)
+ (comint-exec
+ buf-name
+ file
+ (w32-shell-name)
+ nil
+ (list
+ "-c"
+ file
+ )
+ )
+ (display-buffer buf-name))))
+
+ (define-key bat-generic-mode-keymap "\C-c\C-c" 'bat-generic-mode-compile)
+
;; Make underscores count as words
(if bat-generic-mode-syntax-table
nil
@@ -423,6 +463,7 @@ you must reload generic-x to enable the specified modes."
(set-syntax-table bat-generic-mode-syntax-table)
;; Make keywords case-insensitive
(setq font-lock-defaults (list 'generic-font-lock-defaults nil t))
+ (use-local-map bat-generic-mode-keymap)
)
)