Index: lisp/cmuscheme.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/cmuscheme.el,v retrieving revision 1.36 diff -u -c -r1.36 cmuscheme.el *** lisp/cmuscheme.el 19 Sep 2004 02:14:14 -0000 1.36 --- lisp/cmuscheme.el 6 Jan 2005 17:58:23 -0000 *************** *** 109,114 **** --- 109,118 ---- :type 'hook :group 'cmuscheme) + (defcustom scheme-display-buffer-on-eval nil + "*Non nil means display the Scheme process buffer when evaluating code." + :group 'scheme :type 'boolean) + (defvar inferior-scheme-mode-map (let ((m (make-sparse-keymap))) (define-key m "\M-\C-x" 'scheme-send-definition) ;gnu convention *************** *** 257,263 **** "Send the current region to the inferior Scheme process." (interactive "r") (comint-send-region (scheme-proc) start end) ! (comint-send-string (scheme-proc) "\n")) (defun scheme-send-definition () "Send the current definition to the inferior Scheme process." --- 261,277 ---- "Send the current region to the inferior Scheme process." (interactive "r") (comint-send-region (scheme-proc) start end) ! (comint-send-string (scheme-proc) "\n") ! (when scheme-display-buffer-on-eval ! (scheme-display-process-buffer))) ! ! (defun scheme-display-process-buffer () ! "Display the Scheme process buffer. ! This function ignores `same-window-buffer-names'." ! (let ((same-window-buffer-names nil)) ! (display-buffer scheme-buffer) ! (set-window-point (get-buffer-window scheme-buffer) ! (process-mark (scheme-proc))))) (defun scheme-send-definition () "Send the current definition to the inferior Scheme process." *************** *** 300,311 **** "Switch to the scheme process buffer. With argument, position cursor at end of buffer." (interactive "P") ! (if (get-buffer scheme-buffer) (pop-to-buffer scheme-buffer) ! (error "No current process buffer. See variable `scheme-buffer'")) ! (cond (eob-p ! (push-mark) ! (goto-char (point-max))))) (defun scheme-send-region-and-go (start end) "Send the current region to the inferior Scheme process. --- 314,326 ---- "Switch to the scheme process buffer. With argument, position cursor at end of buffer." (interactive "P") ! (if (or (get-buffer scheme-buffer) ! (scheme-interactively-start-process)) (pop-to-buffer scheme-buffer) ! (error "No current process buffer. See variable `scheme-buffer'")) ! (when eob-p ! (push-mark) ! (goto-char (point-max)))) (defun scheme-send-region-and-go (start end) "Send the current region to the inferior Scheme process. *************** *** 417,429 **** for a minimal, simple implementation. Feel free to extend it.") (defun scheme-proc () ! "Return the current scheme process. See variable `scheme-buffer'." ! (let ((proc (get-buffer-process (if (eq major-mode 'inferior-scheme-mode) ! (current-buffer) ! scheme-buffer)))) ! (or proc ! (error "No current process. See variable `scheme-buffer'")))) ! ;;; Do the user's customisation... --- 432,456 ---- for a minimal, simple implementation. Feel free to extend it.") (defun scheme-proc () ! "Return the current Scheme process, starting one if necessary. ! See the variable `scheme-buffer' for details." ! (or (scheme-get-process) ! (scheme-interactively-start-process) ! (error "No current process. See variable `scheme-buffer'"))) ! ! (defun scheme-get-process () ! "Return the current Scheme process or nil if none is running." ! (get-buffer-process (if (eq major-mode 'inferior-scheme-mode) ! (current-buffer) ! scheme-buffer))) ! ! (defun scheme-interactively-start-process (&optional cmd) ! "Start an inferior Scheme process. Return the process started. ! Since this command is run implicitly, always ask the user for the ! command to run." ! (save-window-excursion ! (run-scheme (read-string "Run Scheme: " scheme-program-name))) ! (scheme-get-process)) ;;; Do the user's customisation...