This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] Multi-line tcl expressions
- To: insight at sources dot redhat dot com
- Subject: [PATCH] Multi-line tcl expressions
- From: Syd Polk <spolk at redhat dot com>
- Date: Thu, 07 Dec 2000 11:57:23 -0800
I committed the following today:
This patch allows the user to enter multi-line tcl expressions
when using the "tk" command. It uses [info complete $cmd] to
determine if the command is complete, and if it is not, inserts
the continuation character "\" and allows the user to continue
on the next line, until the expression is finally complete and
ready to be evaluated.
2000-12-01 Larry Smith <lsmith@redhat.com>
* console.itb (invoke): Added logic to allow user to build
up multiline "tk" commands based on results from checking
command with [info complete $cmd]s.
Index: console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.4
diff -u -r1.4 console.itb
--- console.itb 2000/11/01 22:15:37 1.4
+++ console.itb 2000/12/01 21:27:04
@@ -379,8 +379,18 @@
body Console::invoke {} {
global gdbtk_state
+ set text [$_twin get {cmdmark + 1 char} end ]
+
+ if { "[string range $text 0 1]" == "tk" } {
+ if {! [info complete $text] } {
+ $_twin insert {insert lineend} " \\\n"
+ $_twin see insert
+ return
+ }
+ }
+
incr _invoking
- set text [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
+
if {$text == ""} {
set text [lindex $_history 0]
$_twin insert {insert lineend} $text
Syd Polk spolk@redhat.com
Engineering Manager +1 415 777 9810 x 241
Red Hat, Inc.