Slava Pestov 2008-07-05 18:47:30 -05:00
commit 1e3cac9a86
1 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,12 @@
(defvar factor-mode-syntax-table nil
"Syntax table used while in Factor mode.")
(defcustom factor-display-compilation-output t
"Display the REPL buffer before compiling files."
:type '(choice (const :tag "Enable" t) (const :tag "Disable" nil))
:group 'factor)
(if factor-mode-syntax-table
()
(let ((i 0))
@ -139,9 +145,20 @@
(defun factor-run-file ()
(interactive)
(when (and (buffer-modified-p)
(y-or-n-p (format "Save file %s? " (buffer-file-name))))
(save-buffer))
(when factor-display-compilation-output
(factor-display-output-buffer))
(comint-send-string "*factor*" (format "\"%s\"" (buffer-file-name)))
(comint-send-string "*factor*" " run-file\n"))
(defun factor-display-output-buffer ()
(with-current-buffer "*factor*"
(goto-char (point-max))
(unless (get-buffer-window (current-buffer) t)
(display-buffer (current-buffer) t))))
;; (defun factor-send-region (start end)
;; (interactive "r")
;; (comint-send-region "*factor*" start end)