]>
cvs.zerfleddert.de Git - micropolis/blob - src/tclx/tclsrc/edprocs.tcl
4 # Tools for Tcl developers. Procedures to save procs to a file and to edit
6 #------------------------------------------------------------------------------
7 # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
9 # Permission to use, copy, modify, and distribute this software and its
10 # documentation for any purpose and without fee is hereby granted, provided
11 # that the above copyright notice appear in all copies. Karl Lehenbauer and
12 # Mark Diekhans make no representations about the suitability of this
13 # software for any purpose. It is provided "as is" without express or
15 #------------------------------------------------------------------------------
16 # $Id: edprocs.tcl,v 2.0 1992/10/16 04:51:57 markd Rel $
17 #------------------------------------------------------------------------------
20 #@package: TclX-developer_utils saveprocs edprocs
22 proc saveprocs
{fileName args
} {
23 set fp
[open $fileName w
]
24 puts $fp "# tcl procs saved on [fmtclock [getclock]]\n"
25 puts $fp [eval "showprocs $args"]
32 set tmpFilename
/tmp
/tcldev.
[id process
]
34 set fp
[open $tmpFilename w
]
35 puts $fp "\n# TEMP EDIT BUFFER -- YOUR CHANGES ARE FOR THIS SESSION ONLY\n"
36 puts $fp [eval "showprocs $args"]
39 if [info exists env
(EDITOR
)] {
40 set editor
$env(EDITOR
)
45 set startMtime
[file mtime
$tmpFilename]
46 system
"$editor $tmpFilename"
48 if {[file mtime
$tmpFilename] != $startMtime} {
50 echo
"Procedures were reloaded."
52 echo
"No changes were made."