Check-in [9e3c1d7364]
Not logged in
Overview
Comment:Wed Sep 22 02:07:23 CEST 1999
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9e3c1d736420bdd5cbc5dd0daeb49ad6e0b8c20c
User & Date: johannes@zellner.org on 1999-09-22 00:09:07
Other Links: manifest | tags
Context
1999-09-23
00:56
Thu Sep 23 02:54:34 CEST 1999 check-in: 29f47e8987 user: johannes@zellner.org tags: trunk
1999-09-22
00:09
Wed Sep 22 02:07:23 CEST 1999 check-in: 9e3c1d7364 user: johannes@zellner.org tags: trunk
1999-09-20
16:16
configure.in check-in: dd60975ba5 user: johannes@zellner.org tags: trunk
Changes

Modified README from [cd90809192] to [a78ad2a391].

1
2
3
4
5
6
7
8
9
10

    FILE: "/home/joze/src/tclreadline/README"
    LAST MODIFICATION: "Mon Sep 20 00:59:50 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner



|







1
2
3
4
5
6
7
8
9
10

    FILE: "/home/joze/src/tclreadline/README"
    LAST MODIFICATION: "Tue Sep 21 21:21:36 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

72
73
74
75
76
77
78








79
80
81
82
83
84
85
installed tclreadline properly, you are just ready to start:
start your favorite interpreter. The tclreadlineSetup.tcl script
does the rest.


4. History and Changes.
-----------------------









tclreadline-1.0.0: (Sep 1999)

	note:
	    - the script completer procs are written.
		  this is `sort of a first usable release'.








>
>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
installed tclreadline properly, you are just ready to start:
start your favorite interpreter. The tclreadlineSetup.tcl script
does the rest.


4. History and Changes.
-----------------------

tclreadline-1.0.1: (Sep 1999)

	changes:
	    - tclreadline::readline bell.
          Ring the terminal bell, obeying the setting
		  of bell-style -- audible or visible.


tclreadline-1.0.0: (Sep 1999)

	note:
	    - the script completer procs are written.
		  this is `sort of a first usable release'.

Modified configure.in from [c9637892c0] to [6a186fe216].

1
2
3
4
5
6
7
8
9
10
# -*- autoconf -*-
# FILE: "/disk01/home/joze/src/tclreadline/configure.in"
# LAST MODIFICATION: "Mon Sep 20 18:16:22 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#

|
|







1
2
3
4
5
6
7
8
9
10
# -*- autoconf -*-
# FILE: "/home/joze/src/tclreadline/configure.in"
# LAST MODIFICATION: "Tue Sep 21 21:12:23 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
AC_REVISION($Revision$)

AC_INIT(tclreadline.c)
AC_CONFIG_HEADER(config.h)

TCLREADLINE_MAJOR_VERSION=1
TCLREADLINE_MINOR_VERSION=0
TCLREADLINE_PATCHLEVEL=0
TCLREADLINE_VERSION=$TCLREADLINE_MAJOR_VERSION.$TCLREADLINE_MINOR_VERSION
TCLREADLINE_PATCHLEVEL_STR=${TCLREADLINE_VERSION}.${TCLREADLINE_PATCHLEVEL}
VERSION=$TCLREADLINE_VERSION


AC_PREREQ(2.13)
AC_CONFIG_AUX_DIR(./aux)







|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
AC_REVISION($Revision$)

AC_INIT(tclreadline.c)
AC_CONFIG_HEADER(config.h)

TCLREADLINE_MAJOR_VERSION=1
TCLREADLINE_MINOR_VERSION=0
TCLREADLINE_PATCHLEVEL=1
TCLREADLINE_VERSION=$TCLREADLINE_MAJOR_VERSION.$TCLREADLINE_MINOR_VERSION
TCLREADLINE_PATCHLEVEL_STR=${TCLREADLINE_VERSION}.${TCLREADLINE_PATCHLEVEL}
VERSION=$TCLREADLINE_VERSION


AC_PREREQ(2.13)
AC_CONFIG_AUX_DIR(./aux)

Modified tclreadline.c from [398f5435ff] to [1d8264541a].

1
2
3
4
5
6
7
8
9
10
11
12

 /* ==================================================================

    FILE: "/disk01/home/joze/src/tclreadline/tclreadline.c"
    LAST MODIFICATION: "Mon Sep 20 02:20:33 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner




|
|







1
2
3
4
5
6
7
8
9
10
11
12

 /* ==================================================================

    FILE: "/home/joze/src/tclreadline/tclreadline.c"
    LAST MODIFICATION: "Tue Sep 21 21:19:35 1999 (joze)"
    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
    $Id$
    ---

    tclreadline -- gnu readline for tcl
    Copyright (C) 1999  Johannes Zellner

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
{
    int i, obj_idx, status;
    Tcl_Obj** objv = (Tcl_Obj**) MALLOC((argc + 1) * sizeof(Tcl_Obj *));

    static char *subCmds[] = {
        "read", "initialize", "write", "add", "complete",
        "customcompleter", "builtincompleter", "eofchar",
		"reset-terminal",
        (char *) NULL
    };
    enum SubCmdIdx {
        TCLRL_READ, TCLRL_INITIALIZE, TCLRL_WRITE, TCLRL_ADD, TCLRL_COMPLETE,
        TCLRL_CUSTOMCOMPLETER, TCLRL_BUILTINCOMPLETER, TCLRL_EOFCHAR,
		TCLRL_RESET_TERMINAL
    };


    Tcl_ResetResult(interp); /* clear the result space */

    for (i = 0;  i < argc;  i++) {
        Tcl_Obj* objPtr = Tcl_NewStringObj(argv[i], -1);







|





|







193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
{
    int i, obj_idx, status;
    Tcl_Obj** objv = (Tcl_Obj**) MALLOC((argc + 1) * sizeof(Tcl_Obj *));

    static char *subCmds[] = {
        "read", "initialize", "write", "add", "complete",
        "customcompleter", "builtincompleter", "eofchar",
		"reset-terminal", "bell",
        (char *) NULL
    };
    enum SubCmdIdx {
        TCLRL_READ, TCLRL_INITIALIZE, TCLRL_WRITE, TCLRL_ADD, TCLRL_COMPLETE,
        TCLRL_CUSTOMCOMPLETER, TCLRL_BUILTINCOMPLETER, TCLRL_EOFCHAR,
		TCLRL_RESET_TERMINAL, TCLRL_BELL
    };


    Tcl_ResetResult(interp); /* clear the result space */

    for (i = 0;  i < argc;  i++) {
        Tcl_Obj* objPtr = Tcl_NewStringObj(argv[i], -1);
394
395
396
397
398
399
400








401
402
403
404
405
406
407
				rl_reset_terminal(Tcl_GetStringFromObj(objv[2], (int*) NULL));
#ifdef CLEANUP_AFER_SIGNAL
            } else {
				rl_cleanup_after_signal();
#endif
			}
            break;









        default:
            goto BAD_COMMAND;
            /* NOTREACHED */
            break;
    }








>
>
>
>
>
>
>
>







394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
				rl_reset_terminal(Tcl_GetStringFromObj(objv[2], (int*) NULL));
#ifdef CLEANUP_AFER_SIGNAL
            } else {
				rl_cleanup_after_signal();
#endif
			}
            break;

        case TCLRL_BELL:
			/*
			 * ring the terminal bell obeying the current
			 * settings -- audible or visible.
			 */
			ding();
			break;

        default:
            goto BAD_COMMAND;
            /* NOTREACHED */
            break;
    }

Modified tclreadline.n.in from [d2e40c4100] to [2f89485eaa].

1
2
3
4
5
6
7
8
9
10
11
12
.TH tclreadline n "@TCLREADLINE_VERSION@.@TCLREADLINE_PATCHLEVEL@" "Johannes Zellner"

.\" (C) 1999 by Johannes Zellner
.\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
.\" LAST MODIFICATION: "Sun Sep 19 21:24:19 1999 (joze)"
.\" (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
.\" $Id$
.\" ---
.\"
.\" tclreadline -- gnu readline for the tcl scripting language
.\" Copyright (C) 1999  Johannes Zellner
.\"




|







1
2
3
4
5
6
7
8
9
10
11
12
.TH tclreadline n "@TCLREADLINE_VERSION@.@TCLREADLINE_PATCHLEVEL@" "Johannes Zellner"

.\" (C) 1999 by Johannes Zellner
.\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
.\" LAST MODIFICATION: "Tue Sep 21 21:18:31 1999 (joze)"
.\" (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
.\" $Id$
.\" ---
.\"
.\" tclreadline -- gnu readline for the tcl scripting language
.\" Copyright (C) 1999  Johannes Zellner
.\"
180
181
182
183
184
185
186







187
188
189
190
191
192
193
the historyfile will be truncated to hold only this number lines.

.TP 5
\fB::tclreadline::readline reset-terminal\fP [\fIterminalName\fP]
w/o argument: reset the state of the terminal to what it was
before tclreadline was used. With argument: reinitialize readline's
idea of the terminal settings using terminalName as the terminal type.








.TP 5
\fB::tclreadline::Print\fP [\fIyes / no\fP]
turns on or off the default behavior of tclsh to print the result of
every command. This is turned on by default, so it will just behave
as the tclsh w/o tclreadline. Turning off might be useful, when reading
binary data for example. If \fB::tclreadline::Print\fP is called w/o







>
>
>
>
>
>
>







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
the historyfile will be truncated to hold only this number lines.

.TP 5
\fB::tclreadline::readline reset-terminal\fP [\fIterminalName\fP]
w/o argument: reset the state of the terminal to what it was
before tclreadline was used. With argument: reinitialize readline's
idea of the terminal settings using terminalName as the terminal type.
The form w/o argument might not work if tclreadline was compiled
with an older version of libreadline.

.TP 5
\fB::tclreadline::readline bell\fP
Ring the terminal bell, obeying the setting of bell-style
-- audible or visible.

.TP 5
\fB::tclreadline::Print\fP [\fIyes / no\fP]
turns on or off the default behavior of tclsh to print the result of
every command. This is turned on by default, so it will just behave
as the tclsh w/o tclreadline. Turning off might be useful, when reading
binary data for example. If \fB::tclreadline::Print\fP is called w/o

Modified tclreadlineCompleter.tcl from [577a853e5f] to [a0a878b98b].

1
2
3
4
5
6
7
8
9
10
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Sun Sep 19 22:09:08 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#


|







1
2
3
4
5
6
7
8
9
10
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Tue Sep 21 21:19:07 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
		}
	}

	return [string trim ${new}]
}

proc Alert {} {
	puts -nonewline \a
	flush stdout
}

#**
# get the longest common completion
# e.g. str == {tcl_version tclreadline_version tclreadline_library}
# --> [CompleteLongest ${str}] == "tcl"
#







|
<







764
765
766
767
768
769
770
771

772
773
774
775
776
777
778
		}
	}

	return [string trim ${new}]
}

proc Alert {} {
	::tclreadline::readline bell

}

#**
# get the longest common completion
# e.g. str == {tcl_version tclreadline_version tclreadline_library}
# --> [CompleteLongest ${str}] == "tcl"
#
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
	}
}

proc tclreadline::complete(readline) {text start end line pos mod} {
	set cmd [Lindex ${line} 1]
	switch -- ${pos} {
		1 { return [CompleteFromList ${text} {
			read initialize write add complete
			customcompleter builtincompleter eofchar reset-terminal}]
		}
		2 {
			switch -- ${cmd} {
				read {}
				initialize {}
				write {}
				add { return [DisplayHints <completerLine>] }







|
|







3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
	}
}

proc tclreadline::complete(readline) {text start end line pos mod} {
	set cmd [Lindex ${line} 1]
	switch -- ${pos} {
		1 { return [CompleteFromList ${text} {
			read initialize write add complete customcompleter
			builtincompleter eofchar reset-terminal bell}]
		}
		2 {
			switch -- ${cmd} {
				read {}
				initialize {}
				write {}
				add { return [DisplayHints <completerLine>] }