emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/tcl.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/tcl.el
Date: Tue, 18 Apr 2006 21:16:51 +0000

Index: emacs/lisp/progmodes/tcl.el
diff -u emacs/lisp/progmodes/tcl.el:1.87 emacs/lisp/progmodes/tcl.el:1.88
--- emacs/lisp/progmodes/tcl.el:1.87    Tue Jan 10 19:42:43 2006
+++ emacs/lisp/progmodes/tcl.el Tue Apr 18 21:16:49 2006
@@ -1042,7 +1042,7 @@
 (defun tcl-send-string (proc string)
   (with-current-buffer (process-buffer proc)
     (goto-char (process-mark proc))
-    (beginning-of-line)
+    (forward-line 0)             ;Not (beginning-of-line) because of fields.
     (if (looking-at comint-prompt-regexp)
        (set-marker inferior-tcl-delete-prompt-marker (point))))
   (comint-send-string proc string))
@@ -1050,7 +1050,7 @@
 (defun tcl-send-region (proc start end)
   (with-current-buffer (process-buffer proc)
     (goto-char (process-mark proc))
-    (beginning-of-line)
+    (forward-line 0)             ;Not (beginning-of-line) because of fields.
     (if (looking-at comint-prompt-regexp)
        (set-marker inferior-tcl-delete-prompt-marker (point))))
   (comint-send-region proc start end))
@@ -1080,7 +1080,11 @@
 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-region
+     proc
+     ;; Strip leading and trailing whitespace.
+     (save-excursion (goto-char start) (skip-chars-forward " \t\n") (point))
+     (save-excursion (goto-char end) (skip-chars-backward " \t\n") (point)))
     (tcl-send-string proc "\n")
     (if and-go (switch-to-tcl t))))
 
@@ -1149,7 +1153,12 @@
   (unless (comint-check-proc "*inferior-tcl*")
     (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil
                       tcl-command-switches))
-    (inferior-tcl-mode))
+    (inferior-tcl-mode)
+    ;; Make tclsh display a prompt on ms-windows (or under Unix, when a tty
+    ;; wasn't used).  Doesn't affect wish, unfortunately.
+    (unless (process-tty-name (inferior-tcl-proc))
+      (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*"))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]