Compare commits

..

6 Commits

Author SHA1 Message Date
Dianne Skoll
ce123d1b41 Bump to version 05.03.06. 2025-04-25 11:02:22 -04:00
Dianne Skoll
4ed8331369 Add a note about $SuppressLRM right under the "-c" option documentation. 2025-04-24 16:11:32 -04:00
Dianne Skoll
44b920e080 Make "remind -s" respect $DefaultColor
https://dianne.skoll.ca/pipermail/remind-fans/2025/005051.html
2025-04-23 10:15:20 -04:00
Dianne Skoll
dc75c8f49b Tweak astro output. 2025-03-25 15:22:49 -04:00
Dianne Skoll
cef6e6717c Convert C++-style comments to C-style comments. 2025-03-24 11:42:54 -04:00
Dianne Skoll
5ec78739cd Add moonrise, moonset, etc. to remind-conf-mode. 2025-03-23 17:03:56 -04:00
10 changed files with 98 additions and 68 deletions

18
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for remind 05.03.05.
# Generated by GNU Autoconf 2.71 for remind 05.03.06.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='remind'
PACKAGE_TARNAME='remind'
PACKAGE_VERSION='05.03.05'
PACKAGE_STRING='remind 05.03.05'
PACKAGE_VERSION='05.03.06'
PACKAGE_STRING='remind 05.03.06'
PACKAGE_BUGREPORT=''
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
@@ -1265,7 +1265,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures remind 05.03.05 to adapt to many kinds of systems.
\`configure' configures remind 05.03.06 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1327,7 +1327,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of remind 05.03.05:";;
short | recursive ) echo "Configuration of remind 05.03.06:";;
esac
cat <<\_ACEOF
@@ -1415,7 +1415,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
remind configure 05.03.05
remind configure 05.03.06
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1865,7 +1865,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by remind $as_me 05.03.05, which was
It was created by remind $as_me 05.03.06, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4710,7 +4710,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by remind $as_me 05.03.05, which was
This file was extended by remind $as_me 05.03.06, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4775,7 +4775,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
remind config.status 05.03.05
remind config.status 05.03.06
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

View File

@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(remind, 05.03.05, , , https://dianne.skoll.ca/projects/remind/)
AC_INIT(remind, 05.03.06, , , https://dianne.skoll.ca/projects/remind/)
AC_CONFIG_SRCDIR([src/queue.c])
cat <<'EOF'

View File

@@ -166,21 +166,23 @@
(list "_" "abs" "access" "adawn" "adusk" "ampm" "ansicolor" "args" "asc"
"baseyr" "char" "choose" "coerce" "columns" "current" "date"
"datepart" "datetime" "dawn" "day" "daysinmon" "defined" "dosubst"
"dusk" "easterdate" "escape" "evaltrig" "filedate" "filedatetime" "filedir"
"filename" "getenv" "hebdate" "hebday" "hebmon" "hebyear" "hour"
"htmlescape" "htmlstriptags" "iif" "index" "isany" "isdst" "isleap"
"isomitted" "language" "localtoutc" "lower" "max" "min" "minsfromutc"
"minute" "mon" "monnum" "moondate" "moondatetime" "moonphase"
"moontime" "multitrig" "ndawn" "ndusk" "nonomitted" "now" "ord"
"orthodoxeaster" "ostype" "pad" "plural" "psmoon" "psshade"
"realcurrent" "realnow" "realtoday" "rows" "sgn" "shell" "shellescape"
"slide" "soleq" "stdout" "strlen" "substr" "sunrise" "sunset" "time"
"timepart" "timezone" "today" "trig" "trigback" "trigdate"
"trigdatetime" "trigdelta" "trigduration" "trigeventduration"
"trigeventstart" "trigfrom" "trigger" "triginfo" "trigpriority" "trigrep"
"dusk" "easterdate" "escape" "evaltrig" "filedate" "filedatetime"
"filedir" "filename" "getenv" "hebdate" "hebday" "hebmon" "hebyear"
"hour" "htmlescape" "htmlstriptags" "iif" "index" "isany" "isdst"
"isleap" "isomitted" "language" "localtoutc" "lower" "max" "min"
"minsfromutc" "minute" "mon" "monnum" "moondate" "moondatetime"
"moonphase" "moonrise" "moonrisedir" "moonset" "moonsetdir" "moontime"
"multitrig" "ndawn" "ndusk" "nonomitted" "now" "ord" "orthodoxeaster"
"ostype" "pad" "plural" "psmoon" "psshade" "realcurrent" "realnow"
"realtoday" "rows" "sgn" "shell" "shellescape" "slide" "soleq"
"stdout" "strlen" "substr" "sunrise" "sunset" "time" "timepart"
"timezone" "today" "trig" "trigback" "trigdate" "trigdatetime"
"trigdelta" "trigduration" "trigeventduration" "trigeventstart"
"trigfrom" "trigger" "triginfo" "trigpriority" "trigrep"
"trigscanfrom" "trigtags" "trigtime" "trigtimedelta" "trigtimerep"
"triguntil" "trigvalid" "typeof" "tzconvert" "upper" "utctolocal"
"value" "version" "weekno" "wkday" "wkdaynum" "year")
"value" "version" "weekno" "wkday" "wkdaynum" "year"
)
#'(lambda (a b) (> (length a) (length b)))))
;;; faces

View File

@@ -1,5 +1,20 @@
CHANGES TO REMIND
* VERSION 5.3 Patch 6 - 2025-04-25
- BUG FIX: remind: Make "remind -s" respect $DefaultColor. Bug found by
Tim Chase.
- DOCUMENTATION IMPROVEMENT: Make documentation of $SuppressLRM a bit more
prominent
- UPDATE: contrib/remind-conf-mode: Add new functions moonrise, moonset, etc.
to Emacs highlighting file
- MINOR IMPROVEMENT: examples/astro: Align output better
- MINOR FIX: src/moon.c: Change C++-style comments to C-style comments
* VERSION 5.3 Patch 5 - 2025-03-23
- NEW FEATURE: remind: Add moonrise, moonset, moonrisedir and moonsetdir

View File

@@ -92,19 +92,14 @@ set ms moonset()
set mr_a moonrisedir()
set ms_a moonsetdir()
IF mr < ms
REM NOQUEUE [mr] MSG The moon rises %3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
REM NOQUEUE [ms] MSG The moon sets %3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
ELSE
REM NOQUEUE [ms] MSG The moon sets %3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
REM NOQUEUE [mr] MSG The moon rises %3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
ENDIF
REM NOQUEUE [mr] MSG Moonrise: %*3 in the [angle_to_direction(mr_a)] ([mr_a] degrees)
REM NOQUEUE [ms] MSG Moonset: %*3 in the [angle_to_direction(ms_a)] ([ms_a] degrees)
IF (datepart(mr) != today())
REM MSG There is no moonrise today
REM MSG Moonrise: No moonrise today
ENDIF
IF (datepart(ms) != today())
REM MSG There is no moonset today
REM MSG Moonset: No moonset today
ENDIF
EOF

View File

@@ -84,8 +84,13 @@ causes \fBRemind\fR to use VT100 escape sequences to approximate
SPECIAL COLOR reminders. Note that this flag is kept for
backwards-compatibility; you should use the \fB\-@\fI[n][,m][,b]\fR
command-line option instead.
.PP
In a UTF-8 locale, \fBRemind\fR will use "left-to-right marks" when
creating a calendar with the \fB\-c\fR option. Some terminals don't
handle this correctly and garble the rendering of the calendar; see
the documentation of \fB$SuppressLRM\fR in the section "SYSTEM
VARIABLES" for a workaround.
.RE
.TP
.B \-@\fR[\fIn\fR][,\fIm\fR][,\fIb\fR]
Tells \fBRemind\fR to approximate SPECIAL COLOR and SHADE reminders

View File

@@ -2055,7 +2055,7 @@ static int DoCalRem(ParsePtr p, int col)
if (trig.typ == MSG_TYPE ||
trig.typ == CAL_TYPE ||
trig.typ == MSF_TYPE) {
if (PsCal && is_color) {
if ((PsCal || DoSimpleCalendar) && is_color) {
char cbuf[24];
snprintf(cbuf, sizeof(cbuf), "%d %d %d ", col_r, col_g, col_b);
DBufPuts(&pre_buf, cbuf);

View File

@@ -720,11 +720,11 @@ void moon_position(double dayOffset, double *ra, double *declination, double *di
double s;
s = w / sqrt(u - v*v);
*ra = l + atan(s / sqrt(1 - s*s)); // Right ascension
*ra = l + atan(s / sqrt(1 - s*s)); /* Right ascension */
s = v / sqrt(u);
*declination = atan(s / sqrt(1 - s*s)); // Declination
*distance = 60.40974 * sqrt(u); // Distance
*declination = atan(s / sqrt(1 - s*s)); /* Declination */
*distance = 60.40974 * sqrt(u); /* Distance */
}
/* Search for moonrise / moonset events during an hour */
@@ -742,21 +742,21 @@ static void test_moon_event(int k, double offset_days, struct MoonInfo *moon_inf
ha[0] = lSideTime - ra[0] + k*K1;
ha[2] = lSideTime - ra[2] + k*K1 + K1;
// Hour Angle and declination at half hour.
/* Hour Angle and declination at half hour. */
ha[1] = (ha[2] + ha[0])/2;
declination[1] = (declination[2] + declination[0])/2;
double s = sin((PI / 180) * latitude);
double c = cos((PI / 180) * latitude);
// refraction + semidiameter at horizon + distance correction
/* refraction + semidiameter at horizon + distance correction */
double z = cos((PI / 180) * (90.567 - 41.685 / distance[0]));
VHz[0] = s * sin(declination[0]) + c * cos(declination[0]) * cos(ha[0]) - z;
VHz[2] = s * sin(declination[2]) + c * cos(declination[2]) * cos(ha[2]) - z;
if (signbit(VHz[0]) == signbit(VHz[2]))
goto noevent; // No event this hour.
goto noevent; /* No event this hour. */
VHz[1] = s * sin(declination[1]) + c * cos(declination[1]) * cos(ha[1]) - z;
@@ -766,21 +766,23 @@ static void test_moon_event(int k, double offset_days, struct MoonInfo *moon_inf
d = b * b - 4 * a * VHz[0];
if (d < 0)
goto noevent; // No event this hour.
goto noevent; /* No event this hour. */
d = sqrt(d);
e = (-b + d) / (2 * a);
if ((e < 0) || (e > 1))
e = (-b - d) / (2 * a);
time = k + e + 1 / 120; // Time since k=0 of event (in hours).
time = k + e + 1 / 120; /* Time since k=0 of event (in hours). */
// The time we started searching + the time from the start of the search to the
// event is the time of the event. Add (time since k=0) - window/2 hours.
/* The time we started searching + the time from the start of the
search to the event is the time of the event. Add (time since
k=0) - window/2 hours. */
time_t eventTime;
eventTime = moon_info->queryTime + (time - MR_WINDOW / 2) *60 *60;
double hz, nz, dz, az;
hz = ha[0] + e * (ha[2] - ha[0]); // Azimuth of the moon at the event.
hz = ha[0] + e * (ha[2] - ha[0]); /* Azimuth of the moon at the event. */
nz = -cos(declination[1]) * sin(hz);
dz = c * sin(declination[1]) - s * cos(declination[1]) * cos(hz);
az = atan2(nz, dz) * (180 / PI);
@@ -788,23 +790,24 @@ static void test_moon_event(int k, double offset_days, struct MoonInfo *moon_inf
az += 360;
}
// If there is no previously recorded event of this type, save this event.
//
// If this event is previous to queryTime, and is the nearest event to queryTime
// of events of its type previous to queryType, save this event, replacing the
// previously recorded event of its type. Events subsequent to queryTime are
// treated similarly, although since events are tested in chronological order
// no replacements will occur as successive events will be further from
// queryTime.
//
// If this event is subsequent to queryTime and there is an event of its type
// previous to queryTime, then there is an event of the other type between the
// two events of this event's type. If the event of the other type is
// previous to queryTime, then it is the nearest event to queryTime that is
// previous to queryTime. In this case save the current event, replacing
// the previously recorded event of its type. Otherwise discard the current
// event.
//
/* If there is no previously recorded event of this type, save this event.
If this event is previous to queryTime, and is the nearest event
to queryTime of events of its type previous to queryType, save
this event, replacing the previously recorded event of its type.
Events subsequent to queryTime are treated similarly, although
since events are tested in chronological order no replacements
will occur as successive events will be further from queryTime.
If this event is subsequent to queryTime and there is an event of
its type previous to queryTime, then there is an event of the
other type between the two events of this event's type. If the
event of the other type is previous to queryTime, then it is the
nearest event to queryTime that is previous to queryTime. In
this case save the current event, replacing the previously
recorded event of its type. Otherwise discard the current
event. */
if ((VHz[0] < 0) && (VHz[2] > 0)) {
if (!moon_info->hasRise ||
((moon_info->riseTime < moon_info->queryTime) == (eventTime < moon_info->queryTime) &&
@@ -831,7 +834,7 @@ static void test_moon_event(int k, double offset_days, struct MoonInfo *moon_inf
}
noevent:
// There are obscure cases in the polar regions that require extra logic.
/* There are obscure cases in the polar regions that require extra logic. */
if (!moon_info->hasRise && !moon_info->hasSet)
moon_info->isVisible = !signbit(VHz[2]);
else if (moon_info->hasRise && !moon_info->hasSet)

View File

@@ -709,6 +709,12 @@ for i in ../include/lang/??.rem ; do
../src/remind -r -q "-ii=\"$i\"" ../tests/tstlang.rem 1 Feb 2024 13:34 >> ../tests/test.out 2>&1
done
# Fix for $DefaultColor bug with remind -s
../src/remind -s - 1 Feb 2024 >> ../tests/test.out 2>&1 <<'EOF'
SET $DefaultColor "255 0 0"
REM Wed MSG Wookie
EOF
# Make sure all the include files are ok
find ../include -type f -name '*.rem' | while read x; do ../src/remind -n $x 1 Jan 2024 2>>../tests/test.out 1>/dev/null; done
cmp -s ../tests/test.out ../tests/test.cmp

View File

@@ -1047,7 +1047,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "05.03.05"
version() => "05.03.06"
set a059 wkday(today())
today() => 1991-02-16
wkday(1991-02-16) => "Saturday"
@@ -2611,7 +2611,7 @@ a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a007 "1991-02-16"
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a008 "11:44"
a058 "05.03.05"
a058 "05.03.06"
a059 "Saturday"
a010 12
a060 6
@@ -5632,8 +5632,8 @@ REM SATISFY ""
REM SATISFY [version() > "01.00.00"]
../tests/test.rem(1050): SATISFY: expression has no reference to trigdate() or $T...
../tests/test.rem(1050): Trig = Saturday, 16 February, 1991
version() => "05.03.05"
"05.03.05" > "01.00.00" => 1
version() => "05.03.06"
"05.03.06" > "01.00.00" => 1
../tests/test.rem(1050): Trig(satisfied) = Saturday, 16 February, 1991
REM SATISFY [max(x, max(x, 1, 2, 3), 4, 5, 6) * 5]
../tests/test.rem(1051): SATISFY: expression has no reference to trigdate() or $T...
@@ -23201,7 +23201,7 @@ SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: Can't open file
SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: No files matching *.rem
05.03.05
05.03.06
Enabling test mode: This is meant for the acceptance test.
Do not use --test in production.
In test mode, the system time is fixed at 2025-01-06@19:00
@@ -38252,3 +38252,7 @@ $Thursday is Joi
$Friday is Vineri
$Saturday is Sâmbătă
$Sunday is Duminică
2024/02/07 COLOR * * * 255 0 0 Wookie
2024/02/14 COLOR * * * 255 0 0 Wookie
2024/02/21 COLOR * * * 255 0 0 Wookie
2024/02/28 COLOR * * * 255 0 0 Wookie