From 395bad96a737965a7250f8176c8d5e3b343f83cd Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Mon, 27 Feb 2023 10:40:59 -0500 Subject: [PATCH] Don't barf if -underlinefg is not available; don't lose whitespace in MOON message. --- scripts/tkremind | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/tkremind b/scripts/tkremind index 4e811454..5470db8a 100755 --- a/scripts/tkremind +++ b/scripts/tkremind @@ -3326,7 +3326,9 @@ proc EditableEnter { w } { set c [$w tag cget $ctag -foreground] } if {"$c" != ""} { - $w tag configure $tag -underline 1 -underlinefg $c + $w tag configure $tag -underline 1 + # underlinefg not supported on older versions of Tk + eval { $w tag configure $tag -underlinefg $c } } else { $w tag configure $tag -underline 1 } @@ -3633,7 +3635,9 @@ proc DoShadeSpecial { n r g b } { #*********************************************************************** proc DoMoonSpecial { n stuff fntag day } { set msg "" - set num [scan $stuff "%d %d %d %s" phase junk1 junk2 msg] + # Yes, this is gross, but the odds of "\" appearing + # in the text associated with a MOON are small. + set num [scan $stuff {%d %d %d %[^\]} phase junk1 junk2 msg] if {$num < 1} { return }