diff -c /Users/harder/emacs/lisp/progmodes/tcl.el /Users/harder/tcl.el *** /Users/harder/emacs/lisp/progmodes/tcl.el Tue Jan 17 00:09:02 2006 --- /Users/harder/tcl.el Tue Apr 18 22:23:25 2006 *************** *** 1042,1060 **** (defun tcl-send-string (proc string) (with-current-buffer (process-buffer proc) (goto-char (process-mark proc)) ! (beginning-of-line) (if (looking-at comint-prompt-regexp) (set-marker inferior-tcl-delete-prompt-marker (point)))) (comint-send-string proc string)) - (defun tcl-send-region (proc start end) - (with-current-buffer (process-buffer proc) - (goto-char (process-mark proc)) - (beginning-of-line) - (if (looking-at comint-prompt-regexp) - (set-marker inferior-tcl-delete-prompt-marker (point)))) - (comint-send-region proc start end)) - (defun switch-to-tcl (eob-p) "Switch to inferior Tcl process buffer. With argument, positions cursor at end of buffer." --- 1042,1052 ---- (defun tcl-send-string (proc string) (with-current-buffer (process-buffer proc) (goto-char (process-mark proc)) ! (forward-line 0) (if (looking-at comint-prompt-regexp) (set-marker inferior-tcl-delete-prompt-marker (point)))) (comint-send-string proc string)) (defun switch-to-tcl (eob-p) "Switch to inferior Tcl process buffer. With argument, positions cursor at end of buffer." *************** *** 1079,1088 **** "Send the current region to the inferior Tcl process. Prefix argument means switch to the Tcl buffer afterwards." (interactive "r\nP") ! (let ((proc (inferior-tcl-proc))) ! (tcl-send-region proc start end) ! (tcl-send-string proc "\n") ! (if and-go (switch-to-tcl t)))) (defun tcl-eval-defun (&optional and-go) "Send the current defun to the inferior Tcl process. --- 1071,1080 ---- "Send the current region to the inferior Tcl process. Prefix argument means switch to the Tcl buffer afterwards." (interactive "r\nP") ! (tcl-send-string ! (inferior-tcl-proc) ! (replace-regexp-in-string "\n*$" "\n" (buffer-substring start end))) ! (when and-go (switch-to-tcl t))) (defun tcl-eval-defun (&optional and-go) "Send the current defun to the inferior Tcl process. *************** *** 1149,1155 **** (unless (comint-check-proc "*inferior-tcl*") (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil tcl-command-switches)) ! (inferior-tcl-mode)) (set (make-local-variable 'tcl-application) cmd) (setq inferior-tcl-buffer "*inferior-tcl*") (pop-to-buffer "*inferior-tcl*")) --- 1141,1150 ---- (unless (comint-check-proc "*inferior-tcl*") (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil tcl-command-switches)) ! (inferior-tcl-mode) ! ;; Make tclsh display a prompt on ms-windows. Doesn't affect wish, unfortunately. ! (when (eq system-type 'windows-nt) ! (tcl-send-string (inferior-tcl-proc) "set ::tcl_interactive 1; concat\n"))) (set (make-local-variable 'tcl-application) cmd) (setq inferior-tcl-buffer "*inferior-tcl*") (pop-to-buffer "*inferior-tcl*")) *************** *** 1551,1553 **** --- 1546,1549 ---- ;; arch-tag: 8a032554-c3ef-422e-b84c-acec0522179d ;;; tcl.el ends here + Diff finished. Tue Apr 18 22:23:37 2006