365 |
|
|
366 |
;;; CODE |
;;; CODE |
367 |
|
|
368 |
(defvar inferior-sml-mode-map nil) |
(defmap inferior-sml-mode-map |
369 |
|
'(("\C-c\C-s" . run-sml) |
370 |
|
("\t" . comint-dynamic-complete)) |
371 |
|
"Keymap for inferior-sml mode" |
372 |
|
:inherit (list sml-bindings comint-mode-map)) |
373 |
|
|
374 |
|
|
375 |
;; buffer-local |
;; buffer-local |
376 |
|
|
667 |
(sml-send-region (point) (mark))) |
(sml-send-region (point) (mark))) |
668 |
(if and-go (switch-to-sml nil))) |
(if and-go (switch-to-sml nil))) |
669 |
|
|
670 |
|
(defvar sml-source-modes '(sml-mode) |
671 |
|
"*Used to determine if a buffer contains ML source code. |
672 |
|
If it's loaded into a buffer that is in one of these major modes, it's |
673 |
|
considered an ML source file by `sml-load-file'. Used by these commands |
674 |
|
to determine defaults.") |
675 |
|
|
676 |
;;;###autoload |
;;;###autoload |
677 |
(defun sml-send-buffer (&optional and-go) |
(defun sml-send-buffer (&optional and-go) |
678 |
"Send buffer to inferior shell running ML process. |
"Send buffer to inferior shell running ML process. |
706 |
(let ((buffer (sml-proc-buffer))) |
(let ((buffer (sml-proc-buffer))) |
707 |
(window-frame (display-buffer buffer)))) |
(window-frame (display-buffer buffer)))) |
708 |
|
|
|
;;(defun sml-pop-to-buffer (warp) |
|
|
;; "(Towards) handling multiple frames properly. |
|
|
;;Raises the frame, and warps the mouse over there, only if WARP is non-nil." |
|
|
;; (let ((current (window-frame (selected-window))) |
|
|
;; (buffer (sml-proc-buffer))) |
|
|
;; (let ((frame (sml-proc-frame))) |
|
|
;; (if (eq current frame) |
|
|
;; (pop-to-buffer buffer) ; stay on the same frame. |
|
|
;; (select-frame frame) ; XEmacs sometimes moves focus. |
|
|
;; (select-window (get-buffer-window buffer)) ; necc. for XEmacs |
|
|
;; ;; (raise-frame frame) |
|
|
;; (if warp (sml-warp-mouse frame)))))) |
|
|
|
|
|
|
|
709 |
;;; H A C K A T T A C K ! X E M A C S V E R S U S E M A C S |
;;; H A C K A T T A C K ! X E M A C S V E R S U S E M A C S |
710 |
|
|
711 |
;; Only these two functions have to dance around the inane differences |
;; Only these two functions have to dance around the inane differences |
759 |
|
|
760 |
;;; LOADING AND IMPORTING SOURCE FILES: |
;;; LOADING AND IMPORTING SOURCE FILES: |
761 |
|
|
|
(defvar sml-source-modes '(sml-mode) |
|
|
"*Used to determine if a buffer contains ML source code. |
|
|
If it's loaded into a buffer that is in one of these major modes, it's |
|
|
considered an ML source file by `sml-load-file'. Used by these commands |
|
|
to determine defaults.") |
|
|
|
|
762 |
(defvar sml-prev-l/c-dir/file nil |
(defvar sml-prev-l/c-dir/file nil |
763 |
"Caches the (directory . file) pair used in the last `sml-load-file' |
"Caches the (directory . file) pair used in the last `sml-load-file' |
764 |
or `sml-cd' command. Used for determining the default in the next one.") |
or `sml-cd' command. Used for determining the default in the next one.") |
886 |
(error msg)) |
(error msg)) |
887 |
|
|
888 |
(defun sml-do-next-error () |
(defun sml-do-next-error () |
889 |
"The buisiness end of `sml-next-error' (qv)" |
"The business end of `sml-next-error' (qv)" |
890 |
(let ((case-fold-search nil) |
(let ((case-fold-search nil) |
891 |
;; set this variable iff we called sml-next-error in a SML buffer |
;; set this variable iff we called sml-next-error in a SML buffer |
892 |
(sml-window (if (memq major-mode sml-source-modes) (selected-window))) |
(sml-window (if (memq major-mode sml-source-modes) (selected-window))) |
960 |
(sml-update-cursor (sml-proc-buffer)) |
(sml-update-cursor (sml-proc-buffer)) |
961 |
(if (eq major-mode 'sml-inferior-mode) (goto-char (point-max)))) |
(if (eq major-mode 'sml-inferior-mode) (goto-char (point-max)))) |
962 |
|
|
|
;;; Set up the inferior mode keymap, using sml-mode bindings... |
|
|
|
|
|
(cond ((not inferior-sml-mode-map) |
|
|
(setq inferior-sml-mode-map (nconc (make-sparse-keymap) comint-mode-map)) |
|
|
(install-sml-keybindings inferior-sml-mode-map) |
|
|
(define-key inferior-sml-mode-map "\C-c\C-s" 'run-sml) |
|
|
(define-key inferior-sml-mode-map "\t" 'comint-dynamic-complete))) |
|
|
|
|
963 |
;;; H A C K A T T A C K ! X E M A C S / E M A C S K E Y S |
;;; H A C K A T T A C K ! X E M A C S / E M A C S K E Y S |
964 |
|
|
965 |
(if window-system |
(if window-system |