1
2
3
4
5
6
7
8
9
10
11
12
13
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-
+
|
#!/bin/sh
#---------------------------------------------------------- -*- tcl -*-
#
# Eskil, a Graphical frontend to diff
#
# Copyright (c) 1998-2011, Peter Spjuth (peter.spjuth@gmail.com)
# Copyright (c) 1998-2012, Peter Spjuth (peter.spjuth@gmail.com)
#
# Usage
# Do 'eskil' for interactive mode
# Do 'eskil --help' for command line usage
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
|
︙ | | |
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
-
+
|
# 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
set ::eskil(debug) 0
set ::eskil(diffver) "Version 2.6.1 2011-11-01"
set ::eskil(diffver) "Version 2.6.1+ 2012-02-12"
set ::eskil(thisScript) [file join [pwd] [info script]]
namespace import tcl::mathop::+
namespace import tcl::mathop::-
namespace import tcl::mathop::*
namespace import tcl::mathop::/
|
︙ | | |
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
|
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
wm deiconify $top
raise $top
update
doDiff $top
}
# A thing to easily get to debug mode
proc backDoor {a} {
proc backDoor {top a} {
append ::eskil(backdoor) $a
set ::eskil(backdoor) [string range $::eskil(backdoor) end-9 end]
if {$::eskil(backdoor) eq "PeterDebug"} {
set ::eskil(debug) 1
catch {console show}
set ::eskil(backdoor) ""
AddDebugMenu $top
}
}
# Add a debug menu to a toplevel window
proc AddDebugMenu {top} {
set dMenu [DebugMenu $top.m]
$dMenu add checkbutton -label "Wrap" -variable wrapstate \
-onvalue char -offvalue none -command \
"$top.ft1.tt configure -wrap \$wrapstate ;\
$top.ft2.tt configure -wrap \$wrapstate"
$dMenu add command -label "Date Filter" \
-command {set ::eskil(filter) {^Date}}
$dMenu add separator
$dMenu add command -label "Reread Source" -underline 0 \
-command {EskilRereadSource}
$dMenu add separator
$dMenu add command -label "Redraw Window" \
-command [list makeDiffWin $top]
$dMenu add separator
$dMenu add command -label "Normal Cursor" \
-command [list normalCursor $top]
$dMenu add separator
# Runtime disable of C version of DiffUtil
$dMenu add command -label "Tcl DiffUtil" -command \
[list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]
$dMenu add command -label "Evalstats" -command {evalstats}
$dMenu add command -label "_stats" -command {parray _stats}
$dMenu add command -label "Nuisance" -command [list makeNuisance \
$top "It looks like you are trying out the debug menu."]
}
# Build the main window
proc makeDiffWin {{top {}}} {
global Pref tcl_platform
if {$top != "" && [winfo exists $top] && [winfo toplevel $top] eq $top} {
# Reuse the old window
|
︙ | | |
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
|
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
|
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
bind $top <Key-Up> [list scrollText $top -1 u]
bind $top <Key-Down> [list scrollText $top 1 u]
bind $top <Key-Prior> [list scrollText $top -1 pa]
bind $top <Key-Next> [list scrollText $top 1 pa]
bind $top <Key-Escape> [list focus $top]
if {$::eskil(debug) == 0} {
bind $top <Key> "backDoor %A"
bind $top <Key> "backDoor $top %A"
}
pack $top.bfn -in $top.f -side right -padx {3 6}
pack $top.bfp $top.bcm $top.blg \
$top.er2 $top.lr2 $top.er1 $top.lr1 \
-in $top.f -side right -padx 3
pack $top.bfn $top.bfp $top.bcm -ipadx 15
if {$::eskil(debug) == 1} {
set dMenu [DebugMenu $top.m]
AddDebugMenu $top
$dMenu add checkbutton -label "Wrap" -variable wrapstate \
-onvalue char -offvalue none -command \
"$top.ft1.tt configure -wrap \$wrapstate ;\
$top.ft2.tt configure -wrap \$wrapstate"
$dMenu add command -label "Date Filter" \
-command {set ::eskil(filter) {^Date}}
$dMenu add separator
$dMenu add command -label "Reread Source" -underline 0 \
-command {EskilRereadSource}
$dMenu add separator
$dMenu add command -label "Redraw Window" \
-command [list makeDiffWin $top]
$dMenu add separator
$dMenu add command -label "Normal Cursor" \
-command [list normalCursor $top]
$dMenu add separator
$dMenu add command -label "Evalstats" -command {evalstats}
$dMenu add command -label "_stats" -command {parray _stats}
$dMenu add command -label "Nuisance" -command [list makeNuisance \
$top "It looks like you are trying out the debug menu."]
}
initDiffData $top
return $top
}
proc ValidateNewColors {} {
|
︙ | | |