comparison lisp/progmodes/tcl.el @ 83510:2d2f6f096f6e

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-216 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-217 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-218 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-219 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-220 Improve tq.el. * emacs@sv.gnu.org/emacs--devo--0--patch-221 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-222 Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6. * emacs@sv.gnu.org/emacs--devo--0--patch-223 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-224 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-225 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-226 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-227 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-228 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-229 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-230 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-231 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-232 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-233 Update from CVS: lisp/progmodes/python.el (python-mode): Fix typo. * emacs@sv.gnu.org/gnus--rel--5.10--patch-84 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-85 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-86 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-550
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 19 Apr 2006 16:23:46 +0000
parents 8438f5473d99 da16308f67d1
children b8d9a391daf3
comparison
equal deleted inserted replaced
83509:24cf4bf418dc 83510:2d2f6f096f6e
1040 (comint-output-filter proc string)) 1040 (comint-output-filter proc string))
1041 1041
1042 (defun tcl-send-string (proc string) 1042 (defun tcl-send-string (proc string)
1043 (with-current-buffer (process-buffer proc) 1043 (with-current-buffer (process-buffer proc)
1044 (goto-char (process-mark proc)) 1044 (goto-char (process-mark proc))
1045 (beginning-of-line) 1045 (forward-line 0) ;Not (beginning-of-line) because of fields.
1046 (if (looking-at comint-prompt-regexp) 1046 (if (looking-at comint-prompt-regexp)
1047 (set-marker inferior-tcl-delete-prompt-marker (point)))) 1047 (set-marker inferior-tcl-delete-prompt-marker (point))))
1048 (comint-send-string proc string)) 1048 (comint-send-string proc string))
1049 1049
1050 (defun tcl-send-region (proc start end) 1050 (defun tcl-send-region (proc start end)
1051 (with-current-buffer (process-buffer proc) 1051 (with-current-buffer (process-buffer proc)
1052 (goto-char (process-mark proc)) 1052 (goto-char (process-mark proc))
1053 (beginning-of-line) 1053 (forward-line 0) ;Not (beginning-of-line) because of fields.
1054 (if (looking-at comint-prompt-regexp) 1054 (if (looking-at comint-prompt-regexp)
1055 (set-marker inferior-tcl-delete-prompt-marker (point)))) 1055 (set-marker inferior-tcl-delete-prompt-marker (point))))
1056 (comint-send-region proc start end)) 1056 (comint-send-region proc start end))
1057 1057
1058 (defun switch-to-tcl (eob-p) 1058 (defun switch-to-tcl (eob-p)
1078 (defun tcl-eval-region (start end &optional and-go) 1078 (defun tcl-eval-region (start end &optional and-go)
1079 "Send the current region to the inferior Tcl process. 1079 "Send the current region to the inferior Tcl process.
1080 Prefix argument means switch to the Tcl buffer afterwards." 1080 Prefix argument means switch to the Tcl buffer afterwards."
1081 (interactive "r\nP") 1081 (interactive "r\nP")
1082 (let ((proc (inferior-tcl-proc))) 1082 (let ((proc (inferior-tcl-proc)))
1083 (tcl-send-region proc start end) 1083 (tcl-send-region
1084 proc
1085 ;; Strip leading and trailing whitespace.
1086 (save-excursion (goto-char start) (skip-chars-forward " \t\n") (point))
1087 (save-excursion (goto-char end) (skip-chars-backward " \t\n") (point)))
1084 (tcl-send-string proc "\n") 1088 (tcl-send-string proc "\n")
1085 (if and-go (switch-to-tcl t)))) 1089 (if and-go (switch-to-tcl t))))
1086 1090
1087 (defun tcl-eval-defun (&optional and-go) 1091 (defun tcl-eval-defun (&optional and-go)
1088 "Send the current defun to the inferior Tcl process. 1092 "Send the current defun to the inferior Tcl process.
1147 (read-string "Run Tcl: " tcl-application) 1151 (read-string "Run Tcl: " tcl-application)
1148 tcl-application))) 1152 tcl-application)))
1149 (unless (comint-check-proc "*inferior-tcl*") 1153 (unless (comint-check-proc "*inferior-tcl*")
1150 (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil 1154 (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil
1151 tcl-command-switches)) 1155 tcl-command-switches))
1152 (inferior-tcl-mode)) 1156 (inferior-tcl-mode)
1157 ;; Make tclsh display a prompt on ms-windows (or under Unix, when a tty
1158 ;; wasn't used). Doesn't affect wish, unfortunately.
1159 (unless (process-tty-name (inferior-tcl-proc))
1160 (tcl-send-string (inferior-tcl-proc)
1161 "set ::tcl_interactive 1; concat\n")))
1153 (set (make-local-variable 'tcl-application) cmd) 1162 (set (make-local-variable 'tcl-application) cmd)
1154 (setq inferior-tcl-buffer "*inferior-tcl*") 1163 (setq inferior-tcl-buffer "*inferior-tcl*")
1155 (pop-to-buffer "*inferior-tcl*")) 1164 (pop-to-buffer "*inferior-tcl*"))
1156 1165
1157 (defalias 'run-tcl 'inferior-tcl) 1166 (defalias 'run-tcl 'inferior-tcl)