︙ | | |
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package provide app-eskil 2.0
package require Tcl 8.4
# Stop Tk from meddling with the command line by copying it first.
set ::eskil(argv) $::argv
set ::eskil(argc) $::argc
set ::argv {}
set ::argc 0
package require Tk 8.4
catch {package require textSearch}
package require pstools
namespace import -force pstools::*
package require wcb
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set debug 0
set diffver "Version 2.0.7+ 2005-01-27"
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
set diffver "Version 2.0.7+ 2005-02-10"
# Do initalisations for needed packages and globals.
# This is not run until needed to speed up command line error reporting.
proc Init {} {
package require Tk 8.4
catch {package require textSearch}
package require wcb
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set ::thisScript [file join [pwd] [info script]]
set ::thisDir [file dirname $::thisScript]
# Follow any link
set tmplink $thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
set tmplink [file normalize [file join $thisDir $tmplink]]
set thisDir [file dirname $tmplink]
}
# Follow any link
set tmplink $::thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
set tmplink [file normalize [file join $::thisDir $tmplink]]
set ::thisDir [file dirname $tmplink]
}
unset tmplink
set ::util(diffexe) diff
set ::util(diffexe) diff
# Diff functionality is in the DiffUtil package.
package require DiffUtil
# Help DiffUtil to find a diff executable, if needed
catch {DiffUtil::LocateDiffExe $thisScript}
# Diff functionality is in the DiffUtil package.
package require DiffUtil
# Help DiffUtil to find a diff executable, if needed
catch {DiffUtil::LocateDiffExe $::thisScript}
# Figure out a place to store temporary files.
locateTmp ::diff(tmpdir)
# Figure out a place to store temporary files.
locateTmp ::diff(tmpdir)
if {$tcl_platform(platform) eq "windows"} {
# Locate CVS if it is in c:/bin
if {[auto_execok cvs] eq "" && [file exists "c:/bin/cvs.exe"]} {
set env(PATH) "$env(PATH);c:\\bin"
auto_reset
}
if {$::tcl_platform(platform) eq "windows"} {
# Locate CVS if it is in c:/bin
if {[auto_execok cvs] eq "" && [file exists "c:/bin/cvs.exe"]} {
set ::env(PATH) "$::env(PATH);c:\\bin"
auto_reset
}
}
defaultGuiOptions
if {0 && [bind all <Alt-KeyPress>] eq ""} {
bind all <Alt-KeyPress> [bind Menubutton <Alt-KeyPress>]
#after 500 "tk_messageBox -message Miffo"
}
wm withdraw .
}
# Debug function to be able to reread the source even when wrapped in a kit.
proc EskilRereadSource {} {
set this $::thisScript
# Are we in a Starkit?
|
︙ | | |
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
|
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
|
-
+
|
$w.t configure -borderwidth 0
insertTaggedText $w.t $doc
$w.t configure -state disabled
}
proc printUsage {} {
puts {Usage: eskil.tcl [options] [file1] [file2]
puts {Usage: eskil [options] [file1] [file2]
[options] All options but the ones listed below
are passed to diff.
[file1],[file2] Files to be compared
If no files are given, the program is
started anyway and you can select files
from within.
If only one file is given, the program
|
︙ | | |
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
|
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
|
+
|
}
# Go through all command line arguments
proc parseCommandLine {} {
global dirdiff Pref
if {$::eskil(argc) == 0} {
Init
makeDiffWin
return
}
set allOpts {
-w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix
-noparse -line -smallblock -block -char -word -limit -nodiff -dir
|
︙ | | |
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
|
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
|
+
+
+
|
} elseif {$arg eq "-server"} {
if {$::tcl_platform(platform) eq "windows"} {
catch {
package require dde
dde servername Eskil
}
} else {
package require Tk
tk appname Eskil
}
} elseif {$arg eq "-o"} {
set nextArg mergeFile
} elseif {$arg eq "-r"} {
set nextArg revision
} else {
set apa [file normalize [file join [pwd] $arg]]
if {![file exists $apa]} {
puts "Bad argument: $arg"
exit
} else {
lappend files $apa
}
}
}
Init
# Do we start in clip diff mode?
if {$doclip} {
makeClipDiffWin
return
}
|
︙ | | |
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
|
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
|
+
-
+
-
-
+
-
-
-
|
option add *Menubutton.font $ASfont widgetDefault
option add *Message.font $ASfont widgetDefault
option add *Radiobutton.font $ASfont widgetDefault
option add *Spinbox.font $ASfont widgetDefault
}
}
# Global code is only run the first time to be able to reread source
if {![info exists gurkmeja]} {
set gurkmeja 1
defaultGuiOptions
package require pstools
if {0 && [bind all <Alt-KeyPress>] eq ""} {
bind all <Alt-KeyPress> [bind Menubutton <Alt-KeyPress>]
namespace import -force pstools::*
#after 500 "tk_messageBox -message Miffo"
}
wm withdraw .
getOptions
if {![info exists ::eskil_testsuite]} {
parseCommandLine
}
}
|