Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package remind for openSUSE:Factory checked in at 2023-10-17 20:24:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/remind (Old) and /work/SRC/openSUSE:Factory/.remind.new.20540 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "remind" Tue Oct 17 20:24:40 2023 rev:36 rq:1118094 version:4.2.7 Changes: -------- --- /work/SRC/openSUSE:Factory/remind/remind.changes 2023-09-20 13:34:52.946882374 +0200 +++ /work/SRC/openSUSE:Factory/.remind.new.20540/remind.changes 2023-10-17 20:24:47.670853889 +0200 @@ -1,0 +2,30 @@ +Mon Oct 9 18:39:05 UTC 2023 - Detlef Steuer <detlef.ste...@gmx.de> + +- VERSION 4.2 Patch 7 - 2023-10-09 + +- IMPROVEMENT: remind: On 32-bit systems, attempt to use a 64-bit time_t + if the C library supports that. This lets Remind work properly with + dates after 2038 in the few cases it has to call mktime() internally. + +- MINOR NEW FEATURE: remind: Attempt to obtain the terminal background + color using an OSC sequence. This normally only happens if standard + output is a terminal, but can be forced with the '-@..,t' option. + +- MINOR NEW FEATURE: remind: Add "--version" long option to print out + Remind's version and exit. + +- MINOR IMPROVEMENT: tkremind: Use a higher-resolution PNG image for + the icon. + +- MINOR IMPROVEMENT: remind-conf-mode.el: Update highlighting rules + courtesy of Bill Benedetto + +- MINOR CHANGE: Make AT optional. If we encounter a TIME in a REM + command, implicitly begin an AT clause. + +- DOCUMENTATION: Many minor fixes and improvements courtesy of Dan Jacobson. + +- BUG FIX: Make "-w0" set the calendar width based on standard output + rather than setting it to zero and causing an infinite loop. + +------------------------------------------------------------------- Old: ---- remind-04.02.06.tar.gz New: ---- remind-04.02.07.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ remind.spec ++++++ --- /var/tmp/diff_new_pack.8uztnB/_old 2023-10-17 20:24:48.346877554 +0200 +++ /var/tmp/diff_new_pack.8uztnB/_new 2023-10-17 20:24:48.346877554 +0200 @@ -17,9 +17,9 @@ Name: remind -Version: 4.2.6 +Version: 4.2.7 Release: 0 -%define tar_version 04.02.06 +%define tar_version 04.02.07 Summary: A sophisticated calendar and alarm program License: GPL-2.0-only Group: Productivity/Office/Organizers ++++++ remind-04.02.06.tar.gz -> remind-04.02.07.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/configure new/remind-04.02.07/configure --- old/remind-04.02.06/configure 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/configure 2023-10-09 16:21:33.000000000 +0200 @@ -1511,6 +1511,39 @@ } # ac_fn_c_try_link +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that @@ -1743,39 +1776,6 @@ } # ac_fn_c_compute_int -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2449,8 +2449,8 @@ as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -as_fn_append ac_header_c_list " utime.h utime_h HAVE_UTIME_H" as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" +as_fn_append ac_header_c_list " utime.h utime_h HAVE_UTIME_H" # Auxiliary files required by this configure script. ac_aux_files="install-sh" @@ -3872,7 +3872,6 @@ fi - ac_header= ac_cache= for ac_item in $ac_header_c_list do @@ -3902,6 +3901,9 @@ printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi + + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. @@ -3968,6 +3970,39 @@ printf "%s\n" "#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long" >>confdefs.h +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +printf %s "checking size of time_t... " >&6; } +if test ${ac_cv_sizeof_time_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_time_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (time_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_time_t=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 +printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h + + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes @@ -4093,9 +4128,6 @@ fi rm -f conftest.data - - - if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support @@ -4123,6 +4155,12 @@ fi fi +if test "$ac_cv_sizeof_time_t" = "4" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: time_t is 32-bits on this system; attempting to use 64-bit time_t" >&5 +printf "%s\n" "$as_me: time_t is 32-bits on this system; attempting to use 64-bit time_t" >&6;} + CFLAGS="$CFLAGS -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" +fi + if test "$ac_cv_perlartifacts" = "yes" ; then PERLARTIFACTS= else @@ -4174,7 +4212,8 @@ fi -VERSION=04.02.06 + +VERSION=04.02.07 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/configure.in new/remind-04.02.07/configure.in --- old/remind-04.02.06/configure.in 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/configure.in 2023-10-09 16:21:33.000000000 +0200 @@ -30,10 +30,12 @@ dnl Checks for libraries. AC_CHECK_LIB(m, sqrt) +AC_CHECK_HEADERS_ONCE([sys/time.h]) dnl Integer sizes AC_CHECK_SIZEOF(unsigned int) AC_CHECK_SIZEOF(unsigned long) +AC_CHECK_SIZEOF(time_t) dnl Checks for header files. AC_CHECK_HEADERS(sys/types.h glob.h wctype.h locale.h langinfo.h) @@ -43,8 +45,6 @@ dnl Checks for library functions. AC_FUNC_UTIME_NULL -AC_CHECK_HEADERS_ONCE([sys/time.h]) - if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support @@ -66,6 +66,12 @@ fi fi +dnl If sizeof(time_t) is 4, try to get 64-bit time_t +if test "$ac_cv_sizeof_time_t" = "4" ; then + AC_MSG_NOTICE([time_t is 32-bits on this system; attempting to use 64-bit time_t]) + CFLAGS="$CFLAGS -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" +fi + if test "$ac_cv_perlartifacts" = "yes" ; then PERLARTIFACTS= else @@ -81,7 +87,8 @@ exit 1 fi AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups) -VERSION=04.02.06 + +VERSION=04.02.07 AC_SUBST(VERSION) AC_SUBST(PERL) AC_SUBST(PERLARTIFACTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/contrib/remind-conf-mode/remind-conf-mode.el new/remind-04.02.07/contrib/remind-conf-mode/remind-conf-mode.el --- old/remind-04.02.06/contrib/remind-conf-mode/remind-conf-mode.el 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/contrib/remind-conf-mode/remind-conf-mode.el 2023-10-09 16:21:33.000000000 +0200 @@ -514,6 +514,7 @@ (set (make-local-variable 'comment-start) ";") (set (make-local-variable 'comment-start) "#") (set (make-local-variable 'comment-end) "\n") + (set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\||#\\)") (set (make-local-variable 'skeleton-end-hook) nil) ; so the skeletons will not automatically go to a new line. (set (make-local-variable 'fill-column) '100);cause I was having problems with autofill. (set (make-local-variable 'indent-line-function) 'remind-indent-line) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/docs/WHATSNEW new/remind-04.02.07/docs/WHATSNEW --- old/remind-04.02.06/docs/WHATSNEW 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/docs/WHATSNEW 2023-10-09 16:21:33.000000000 +0200 @@ -1,5 +1,32 @@ CHANGES TO REMIND +* VERSION 4.2 Patch 7 - 2023-10-09 + +- IMPROVEMENT: remind: On 32-bit systems, attempt to use a 64-bit time_t + if the C library supports that. This lets Remind work properly with + dates after 2038 in the few cases it has to call mktime() internally. + +- MINOR NEW FEATURE: remind: Attempt to obtain the terminal background + color using an OSC sequence. This normally only happens if standard + output is a terminal, but can be forced with the '-@..,t' option. + +- MINOR NEW FEATURE: remind: Add "--version" long option to print out + Remind's version and exit. + +- MINOR IMPROVEMENT: tkremind: Use a higher-resolution PNG image for + the icon. + +- MINOR IMPROVEMENT: remind-conf-mode.el: Update highlighting rules + courtesy of Bill Benedetto + +- MINOR CHANGE: Make AT optional. If we encounter a TIME in a REM + command, implicitly begin an AT clause. + +- DOCUMENTATION: Many minor fixes and improvements courtesy of Dan Jacobson. + +- BUG FIX: Make "-w0" set the calendar width based on standard output + rather than setting it to zero and causing an infinite loop. + * VERSION 4.2 Patch 6 - 2023-09-12 - NEW FEATURE: remind: The "nonomitted()" function takes an optional diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/examples/astro new/remind-04.02.07/examples/astro --- old/remind-04.02.06/examples/astro 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/examples/astro 2023-10-09 16:21:33.000000000 +0200 @@ -8,15 +8,13 @@ # Set this variable to 1 if your terminal has a dark background or 0 if # it: light. -bg_dark=1 - # Set your latitude and longitude correctly for Sunrise/Sunset/Equinox/Solstice # # The values below are for Ottawa, Ontario, Canada latitude="45.420556" longitude="-75.689722" -remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' +remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' SET $AddBlankLines 0 BANNER % @@ -24,24 +22,25 @@ MSG Today is [ansi_bold][$T][ansi_normal], being the [ord($T-date(year($T),1,1)+1)] day of [year($T)].%_ -IF bg_dark +IF $TerminalBackground == 0 SPECIAL COLOR 255 255 0 Sunrise: ð [sunrise()] today and [sunrise($T+1)] tomorrow SPECIAL COLOR 255 128 0 Sunset: ð [sunset()] today and [sunset($T+1)] tomorrow%_ +ELSE + SPECIAL COLOR 128 128 0 Sunrise: ð [sunrise()] today and [sunrise($T+1)] tomorrow + SPECIAL COLOR 128 32 0 Sunset: ð [sunset()] today and [sunset($T+1)] tomorrow%_ + ENDIF EOF -remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' +remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' SET $AddBlankLines 0 BANNER % -IF bg_dark +IF $TerminalBackground == 0 REM [moondatetime(0)] +60 SPECIAL COLOR 255 255 0 New moon: ð [$T] %3 (%b) REM [moondatetime(1)] +60 SPECIAL COLOR 255 255 128 First Quarter: ð [$T] %3 (%b) REM [moondatetime(2)] +60 SPECIAL COLOR 255 255 255 Full moon: ð [$T] %3 (%b) REM [moondatetime(3)] +60 SPECIAL COLOR 255 255 128 Last Quarter: ð [$T] %3 (%b) ELSE - SPECIAL COLOR 128 128 0 Sunrise: ð [sunrise()] today and [sunrise($T+1)] tomorrow - SPECIAL COLOR 128 32 0 Sunset: ð [sunset()] today and [sunset($T+1)] tomorrow%_ - REM [moondatetime(0)] +60 SPECIAL COLOR 128 128 0 New moon: ð [$T] %3 (%b) REM [moondatetime(1)] +60 SPECIAL COLOR 128 128 64 First Quarter: ð [$T] %3 (%b) REM [moondatetime(2)] +60 SPECIAL COLOR 0 0 0 Full moon: ð [$T] %3 (%b) @@ -51,7 +50,7 @@ echo "" -remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' +remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF' SET $AddBlankLines 0 BANNER % diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/man/rem.1.in new/remind-04.02.07/man/rem.1.in --- old/remind-04.02.06/man/rem.1.in 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/man/rem.1.in 2023-10-09 16:21:33.000000000 +0200 @@ -19,4 +19,4 @@ .SH HOME PAGE https://dianne.skoll.ca/projects/remind/ .SH SEE ALSO -\fBremind\fR +\fBremind\fR(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/man/rem2ps.1.in new/remind-04.02.07/man/rem2ps.1.in --- old/remind-04.02.06/man/rem2ps.1.in 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/man/rem2ps.1.in 2023-10-09 16:21:33.000000000 +0200 @@ -327,7 +327,7 @@ .SH REM2PS INPUT FORMAT (-P OPTION) The \fB\-p\fR option is an older, simpler interchange format used by \fBRemind\fR to communicate with back-ends. New back-ends are -encoraged to support the new \fB\-pp\fR format preferably, though they +encouraged to support the new \fB\-pp\fR format preferably, though they are encouraged to support the older \fB\-p\fR format as well if the older format contains enough information for them to work properly. .PP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/man/remind.1.in new/remind-04.02.07/man/remind.1.in --- old/remind-04.02.06/man/remind.1.in 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/man/remind.1.in 2023-10-09 16:21:33.000000000 +0200 @@ -28,6 +28,10 @@ \fBRemind\fR has a slew of options. If you're new to the program, ignore them for now and skip to the section "REMINDER FILES". .TP +.B \-\-version +The \fB\-\-version\fR option causes \fBRemind\fR to print its version number +to standard output and then exit. +.TP .B \-n The \fB\-n\fR option causes \fBRemind\fR to print the \fBnext\fR occurrence of each reminder in a simple calendar format. You can sort this by @@ -62,7 +66,7 @@ day they actually occur \fIas well as\fR on any preceding days specified by the reminder's \fIdelta\fR. This \fIalso\fR causes \fBRemind\fR to include text outside %"...%" sequences that would -otherwise be removed (though the actual %" markers themseves are removed.) +otherwise be removed (though the actual %" markers themselves are removed.) .TP .B 'l' causes \fBRemind\fR to use VT100 line-drawing characters to draw @@ -105,11 +109,18 @@ \fIm\fR=0 tells \fBRemind\fR that the terminal background is dark, and \fBRemind\fR will brighten up dark colors to make them visible. If \fIm\fR=1, then \fBRemind\fR assumes the terminal background is light -and it will darken bright colors to make them visible. If no \fIm\fR -is supplied, or it is supplied as \fIm\fR=2, then \fBRemind\fR does -not perform any adjustments, and some reminders may be hard or -impossible to see if the color is too close to the terminal background -color. +and it will darken bright colors to make them visible. If \fIm\fR is +specified as 2, then \fBRemind\fR does not perform any adjustments, +and some reminders may be hard or impossible to see if the color is +too close to the terminal background color. If you supply the letter +\fBt\fR rather than a number, then Remind attempts to guess the background +color of the terminal, \fIeven if\fR stdout is not a terminal. +.PP +On startup, if the standard output is a terminal, \fBRemind\fR +attempts to determine if the terminal background is dark or light by +sending a special escape sequence to determine the background color. +The \fIm\fR parameter can override this check (or force it if +\fIm\fR is given as \fBt\fR.) .PP If the optional \fIb\fR parameter is supplied following a comma, then \fIb=0\fR tells \fBRemind\fR to ignore SPECIAL SHADE reminders (the @@ -225,7 +236,7 @@ .B \-t\fR\fIn\fR If you supply a number \fIn\fR after the \fB\-t\fR option, then \fBRemind\fR pretends that echo \fBREM\fR command has a delta -of \+\+\fIn\fR, regardles of any existing delta. +of \+\+\fIn\fR, regardless of any existing delta. .TP .B \-tz\fR If you supply the letter \fBz\fR after the \fB\-t\fR option, then @@ -610,6 +621,11 @@ .PP 1. Null date specification - the reminder is triggered every day. The trigger date for a specific run is simply the current system date. +For example: +.PP +.nf + REM MSG This is triggered every time Remind runs +.fi .PP 2. Only .I day @@ -1790,7 +1806,7 @@ .PP If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then \fBRemind\fR will process all files in that directory that match the shell -patterm "*.rem". The files are processed in sorted order; the sort order +pattern "*.rem". The files are processed in sorted order; the sort order matches that used by the shell when it expands "*.rem". .PP Note that the file specified by an \fBINCLUDE\fR command is interpreted @@ -2398,6 +2414,10 @@ set in your script. If \fB$DefaultDelta\fR is non-zero, you can use an explicit delta of +0 in an AT clause to countermand the default delta. .TP +.B $DeltaOverride (read-only) +If non-zero, corresponds to the \fIn\fR argument given to a +\fB\-t\fR\fIn\fR command-line option. +.TP .B $DontFork (read-only) If non-zero, then the \fB\-c\fR option was supplied on the command line. .TP @@ -2464,7 +2484,8 @@ then \fBONCE\fR directives will be ignored. .TP .B $InfDelta (read-only) -If non-zero, then the \fB\-t\fR option was supplied on the command line. +If non-zero, then the \fB\-t\fR option was supplied on the command line, +with no \fIn\fR argument. .TP .B $IntMax (read-only) The largest representable \fBINT\fR. On a machine with 32-bit signed integers @@ -2708,9 +2729,13 @@ Set to 1 if the \fB\-@2\fR option was used; 0 otherwise. .TP .B $TerminalBackground (read-only) -Returns -1 if the terminal background color was not specified, -0 if it was specified as dark with the \fB\-@,0\fR option or -1 if it was specified as light with the \fB\-@,1\fR option. +Returns -1 if the terminal background color could not be determined, 0 +if it was found to be dark (or was specified as dark with the +\fB\-@,0\fR option) or 1 if it was found to be light (or specified as +light with the \fB\-@,1\fR option.) The terminal background is considered +to be "dark" if the average of the red, green and blue components is +at most 85 out of 255, and if the maximum of any component is at most +128 out of 255. .PP Note: If any of the calendar modes are in effect, then the values of $Daemon, $DontFork, $DontTrigAts, $DontQueue, $HushMode, @@ -3294,7 +3319,7 @@ counted. \fIend\fR is never counted. .RS .PP -Note that if \fIend\fR is less than \ffIstart\fR, the arguments +Note that if \fIend\fR is less than \fIstart\fR, the arguments are effectively swapped, so counting always begins from the older date. .PP @@ -3339,7 +3364,7 @@ .fi .PP Obviously, the answer you get from \fBnonomitted\fR depends on the global -OMIT context. If you use moveable OMITs, you may get inconsistent results. +OMIT context. If you use movable OMITs, you may get inconsistent results. .PP Here is a more complex use for \fBnonomitted\fR. My garbage collection follows two interleaved 14-day cycles: One Friday, garbage and paper @@ -4304,7 +4329,7 @@ Similarly, the function is useful in anniversary reminders. For example: .PP .nf - REM 4 June MSG [since(1989)] anniversary of the Tiananmen Square massacre + REM 4 June MSG [since(1989)] anniversary of the Tienanmen Square massacre .fi .PP Notes: @@ -5525,7 +5550,7 @@ to \fBRemind\fR backends, such as \fBtkremind\fR or \fBRem2PS\fR. They are used only when piping data from a \fBremind \-p\fR line. (Note that the COLOR special is an exception; it downgrades to the -equivalent of MSG in \fBremind's\fR normal mode of operation.) +equivalent of MSG in \fBRemind's\fR normal mode of operation.) .PP The various \fBSPECIAL\fRs recognized are particular for each backend; however, there are four \fBSPECIAL\fRs that all backends @@ -5816,6 +5841,25 @@ if it happens to be before the start of scanning. Note that this behaviour is not true for versions of \fBRemind\fR prior to 03.00.01. +.SH FILES +.PP +The traditional location of your reminders file or directory is: +.PP +.nf + $HOME/.reminders +.fi +.PP +where \fB$HOME\fR is your home directory. +.PP +Remind ships with some preinstalled files for holidays and language +packs. These are located in the following directory: +.PP +.nf + @prefix@/share/remind/ +.fi +.PP +Do not hard-code the above directory in your reminder files. Instead, +use the value of the $SysInclude system variable. .SH AUTHOR .PP Dianne Skoll <dia...@skoll.ca> wrote \fBRemind\fR. The moon code @@ -5863,9 +5907,11 @@ Rafa Couto .PP \fBIcelandic\fR -- -Bj\(:orn Dav\('i\[Sd]sson +Bj\[:o]rn DavÃ\[Sd]sson .SH BUGS .PP +If you find a bug in Remind, please report it to: dia...@skoll.ca +.PP There's no good reason why read-only system variables are not implemented as functions, or why functions like \fBversion()\fR, etc. are not implemented as read-only system variables. @@ -5888,6 +5934,8 @@ Catalog\fR, Jewish Publication Society of America. .SH HOME PAGE https://dianne.skoll.ca/projects/remind/ +.SH MAILING LIST +https://dianne.skoll.ca/mailman/listinfo/remind-fans .SH SEE ALSO .PP \fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1), \fBrem2html\fR(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/scripts/tkremind new/remind-04.02.07/scripts/tkremind --- old/remind-04.02.06/scripts/tkremind 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/scripts/tkremind 2023-10-09 16:21:33.000000000 +0200 @@ -29,31 +29,62 @@ # Our icon photo catch { image create photo rpicon -data { -R0lGODlhFwAgAOecABUTERYTERYUERcVEhgWExkXFBkXFRoXFRsZFhwZFxwa -GB0bGR4cGR4cGh8dGiAeHCEfHCEfHSIgHSIgHiQiHyYkISknJCooJispJywq -Jy4sKTIwLjUzMDUzMTo4Njs5Nzs5ODw7ODw7OT07OT48OkE/PUJAPkNBP0RC -QEVDQUVEQkdFQ0lIRkpJR01LSU5MSlBPTVFQTlNSUFRSUFRSUVVTUlVUUllY -VltZV1xaWF1cWmBfXmJgX2RiYGZlY2dmZGppZ2tqaG1ram9tbHFwb3Jwb3Rz -cXV0c3Z0c3Z1c3Z1dHd1dHh2dXh3dnt5eHx7eXx7en18en59e4B/foGAf4KB -f4SDgYWEgoWEg4eGhIiHhouKiI2Mio6Ni46NjJCQj5KRkJSTkZeWlpiXlpmY -l5qZmJybmp6dnKCfnqGgoKKhoKOioaSjoqinp6qpqKurqq+urbCvrrCwr7Gw -r7OysbW1tLi3tri3t7u6ur28vMTDw8TEw8XFxMbFxcfGxsfHxsrJycrKyczM -y83My83MzM3NzdDQz9LR0dPS0tPT09fX19jY19ra2dvb29zc29zc3Ojn5+jo -6Orq6uzs7O/v7/T09PX19fb29vf39/r6+vv7+/7+/v////////////////// -//////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////// -/////////////////////yH5BAEKAP8ALAAAAAAXACAAAAj+AP8JHEiwoMGD -CAcusRAAQEKDBQIcEBAAwUODAQJAsBGAwsWCBzJuUBLgI0ENGVM2dACg5UWV -KU+Y/JfRQBknPoq8ATQz4wxOQIFa6vMx5ZSgQetczJDSClKgcF6mFDEnE9I2 -D0fADOChUdA1D7dmTBEUTditDQRQAnomIQaxICpoAmomoUoAGS2YIBIUDEIu -YndI8FAJaBaEMlIuSEkloxugUBBOSLkh44AvGfkAPYJQpYqMLIQEILB205DO -KW9kJHMhQAmgkaKgzsgjggM5GbEAxaNmdoAPOoz8CCAgEVAtg3wPEPMnQQAU -QWsg5AAzDZSMbIBeaoHwAUwSDAI2XMAENA8ThAPEBvAStEkc3yonrOW0aUMk -+BkBVAlaKATC8Fsp8Igid5ABgxMHtaTgggy6ZFBAADs= } +iVBORw0KGgoAAAANSUhEUgAAAEAAAABbCAYAAADDeIOGAAAACXBIWXMAA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r1zlxovsw2Nl4/IzV+k/hwn6furo6qa2tlRs3boiIyOLFi011Fi5cqNX61dXV +YZ2baJ4cjRnpMQj4SbwEAPLWW291O338+HFJS0szla+pqdEiYN26dWGdA/FU3oyAF9wgoKKiotvp +JUuWmMpOmTJFgsGgFgFFRUVhvd8mioBfuUFAcnKynDx5Ug4fPiwpKSmmslu2bNGqfH19vSQlJYX1 +VsZLQKy1fsdHUCLR0dHBRx99xNmzZ6PO+4cxcuRIVq/W23D+6aef0tXVBXAf41RqXIhFQLRfYnKE +6upqy93hK1asoG/fvlrlHT16NPyxXkT8cTkHMbvATlzoAjpXv379xO/3a4V/V1dXOP8X4I/xhr+Y +ZIKuRYAVli9frrX4AcYEit/vD/970g37sQiwveHQCdLT03nppZe05ffs2RP+KMA/XHEiRheIKw3W +vZYvX64V+mEUFhaGdS8ROvof7xWLgOZEVz4pKUk+++wz7cofPHgwfGRegB1uVD7qGKCUSuUhdIG5 +c+dSVlamLb9nz55w44Bb4U/0McBHgrbCRmLt2rW25CNmkIPAQdcciQj7EmATxs9RJDT8S0tLtdNe +EZFTp05FTqHVuxX+IoJHKTUIeBtYgsuHqWNh7dq1GAfO9LBr167IKbTYc+kO8WceUtIDSEFBga3T +ICIi06dPjyzjBVcjANiKsQBiex+AE6xZsybmydG2tja++uorrly5QlNTE4FAgEAgwLFjx8IiHRg/ +xOYalIiEDz+vBVZgbIdNSFfIyclh9+7dNDU1dVcw8q/f76etrc2siBMiMtlNn3r9jpBSqhSYjTEo +5mNMjztaIHkQKSkpdHZ2Wp0RvI2x2NkS+tsc+nsNqBMRV8cA0x9SCh2NHYtxRnA0MBwYgJEnhC+z + 17h2jP27d0Kf2zH2893G2NNzM3S1YvzAYgDj9Ffsd2eX8V/DpporbFKohAAAAABJRU5ErkJggg== } wm iconphoto . -default rpicon } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/src/dorem.c new/remind-04.02.07/src/dorem.c --- old/remind-04.02.06/src/dorem.c 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/src/dorem.c 2023-10-09 16:21:33.000000000 +0200 @@ -350,6 +350,16 @@ if (r) return r; break; + /* A time implicitly introduces an AT if AT is not explicit */ + case T_Time: + DBufFree(&buf); + if (tim->ttime != NO_TIME) return E_TIME_TWICE; + tim->ttime = tok.val; + r = ParseTimeTrig(s, tim, save_in_globals); + if (r) return r; + trig->duration_days = ComputeTrigDuration(tim); + break; + case T_At: DBufFree(&buf); r=ParseTimeTrig(s, tim, save_in_globals); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/src/funcs.c new/remind-04.02.07/src/funcs.c --- old/remind-04.02.06/src/funcs.c 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/src/funcs.c 2023-10-09 16:21:33.000000000 +0200 @@ -3574,6 +3574,8 @@ struct winsize w; int fd = STDOUT_FILENO; + int opened = 0; + RetVal.type = INT_TYPE; if (!isatty(fd)) { fd = open("/dev/tty", O_RDONLY); @@ -3581,6 +3583,7 @@ RETVAL = -1; return OK; } + opened = 1; } if (ioctl(fd, TIOCGWINSZ, &w) == 0) { if (want_rows) RETVAL = w.ws_row; @@ -3588,7 +3591,7 @@ } else { RETVAL = -1; } - if (fd != STDOUT_FILENO) { + if (opened) { close(fd); } return OK; @@ -3757,7 +3760,7 @@ j -= 2447892.50000; /* This is the Julian date of midnight, 1 Jan 1990 UTC */ int dse = (int) j; - int min = floor((j - (double) dse) * MINUTES_PER_DAY); + int min = (int) floor((j - (double) dse) * MINUTES_PER_DAY); int ret; /* Convert from UTC to local time */ @@ -3805,8 +3808,10 @@ } ret = solstice_equinox_for_year(y, which); + if (ret < 0) return E_MKTIME_PROBLEM; if (dse != NO_DATE && (ret / MINUTES_PER_DAY) < dse) { ret = solstice_equinox_for_year(y+1, which); + if (ret < 0) return E_MKTIME_PROBLEM; } RetVal.type = DATETIME_TYPE; RETVAL = ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/src/init.c new/remind-04.02.07/src/init.c --- old/remind-04.02.06/src/init.c 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/src/init.c 2023-10-09 16:21:33.000000000 +0200 @@ -25,10 +25,11 @@ #include <sys/stat.h> #include <fcntl.h> #include <errno.h> - +#include <poll.h> #include <pwd.h> #include <unistd.h> #include <sys/ioctl.h> +#include <termios.h> #ifdef HAVE_INITGROUPS #include <grp.h> @@ -40,6 +41,14 @@ #include "expr.h" #include "err.h" +static int should_guess_terminal_background = 1; + +static void guess_terminal_background(int *r, int *g, int *b); +static int tty_init(int fd); +static void tty_raw(int fd); +static void tty_reset(int fd); + +static void ProcessLongOption(char const *arg); /*************************************************************** * * Command line options recognized: @@ -167,6 +176,7 @@ int x; int dse; int ttyfd; + int r, g, b; dse = NO_DATE; @@ -243,6 +253,11 @@ while(*arg) arg++; break; + case '-': + ProcessLongOption(arg); + while(*arg) arg++; + break; + case '@': UseVTColors = 1; if (*arg) { @@ -259,16 +274,24 @@ if (*arg == ',') { arg++; if (*arg != ',') { - PARSENUM(x, arg); - if (x == 0) { - TerminalBackground = TERMINAL_BACKGROUND_DARK; - } else if (x == 1) { - TerminalBackground = TERMINAL_BACKGROUND_LIGHT; - } else if (x == 2) { - TerminalBackground = TERMINAL_BACKGROUND_UNKNOWN; + if (*arg == 't') { + arg++; + should_guess_terminal_background = 2; } else { - fprintf(ErrFp, "%s: -@n,m,b: m must be 0, 1 or 2 (assuming 2)\n", - argv[0]); + PARSENUM(x, arg); + if (x == 0) { + should_guess_terminal_background = 0; + TerminalBackground = TERMINAL_BACKGROUND_DARK; + } else if (x == 1) { + should_guess_terminal_background = 0; + TerminalBackground = TERMINAL_BACKGROUND_LIGHT; + } else if (x == 2) { + should_guess_terminal_background = 0; + TerminalBackground = TERMINAL_BACKGROUND_UNKNOWN; + } else { + fprintf(ErrFp, "%s: -@n,m,b: m must be t, 0, 1 or 2 (assuming 2)\n", + argv[0]); + } } } } @@ -537,7 +560,7 @@ arg++; /* -wt means get width from /dev/tty */ ttyfd = open("/dev/tty", O_RDONLY); - if (!ttyfd) { + if (ttyfd < 0) { fprintf(stderr, "%s: `-wt': Cannot open /dev/tty: %s\n", argv[0], strerror(errno)); } else { @@ -548,7 +571,12 @@ PARSENUM(CalWidth, arg); if (CalWidth != 0 && CalWidth < 71) CalWidth = 71; if (CalWidth == 0) { - CalWidth = -1; + /* Cal width of 0 means obtain from stdout */ + if (isatty(STDOUT_FILENO)) { + InitCalWidthAndFormWidth(STDOUT_FILENO); + } else { + CalWidth = 80; + } } FormWidth = CalWidth - 8; if (FormWidth < 20) FormWidth = 20; @@ -621,6 +649,17 @@ } } + if (should_guess_terminal_background) { + guess_terminal_background(&r, &g, &b); + if (r >= 0 && g >= 0 && b >= 0) { + if (r+g+b <= 85*3 && r <= 128 && g <= 128 && b <= 128) { + TerminalBackground = TERMINAL_BACKGROUND_DARK; + } else { + TerminalBackground = TERMINAL_BACKGROUND_LIGHT; + } + } + } + /* Get the filename. */ if (!InvokedAsRem) { if (i >= argc) { @@ -958,3 +997,116 @@ NumTrustedUsers++; } +static void +ProcessLongOption(char const *arg) +{ + if (!strcmp(arg, "version")) { + printf("%s\n", VERSION); + exit(0); + } + fprintf(ErrFp, "%s: Unknown long option --%s\n", ArgV[0], arg); +} + +static void +guess_terminal_background(int *r, int *g, int *b) +{ + int ttyfd; + struct pollfd p; + int rr, gg, bb; + char buf[128]; + int n; + + *r = -1; + *g = -1; + *b = -1; + + /* Don't guess if stdout not a terminal unless asked to by @,t */ + if (should_guess_terminal_background != 2) { + if (!isatty(STDOUT_FILENO)) { + return; + } + } + + ttyfd = open("/dev/tty", O_RDWR); + if (ttyfd < 0) { + return; + } + + if (!isatty(ttyfd)) { + /* Not a TTY: Can't guess the color */ + close(ttyfd); + return; + } + + if (!tty_init(ttyfd)) { + return; + } + tty_raw(ttyfd); + write(ttyfd, "\033]11;?\033\\", 8); + + /* Wait up to 0.1s for terminal to respond */ + p.fd = ttyfd; + p.events = POLLIN; + if (poll(&p, 1, 100) < 0) { + tty_reset(ttyfd); + close(ttyfd); + return; + } + if (!(p.revents & POLLIN)) { + tty_reset(ttyfd); + close(ttyfd); + return; + } + n = read(ttyfd, buf, 127); + if (n <= 0) { + tty_reset(ttyfd); + close(ttyfd); + return; + } + tty_reset(ttyfd); + buf[n+1] = 0; + if (n < 25) { + /* Too short */ + return; + } + if (sscanf(buf+5, "rgb:%x/%x/%x", &rr, &gg, &bb) != 3) { + /* Couldn't scan color codes */ + return; + } + *r = (rr >> 8) & 255; + *g = (gg >> 8) & 255; + *b = (bb >> 8) & 255; +} + +static struct termios orig_termios; + +static int +tty_init(int fd) +{ + if (tcgetattr(fd, &orig_termios) < 0) { + return 0; + } + return 1; +} + +static void +tty_raw(int fd) +{ + struct termios raw; + + raw = orig_termios; + + raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); + raw.c_oflag &= ~(OPOST); + raw.c_cflag |= (CS8); + raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); + + /* put terminal in raw mode after flushing */ + tcsetattr(fd,TCSAFLUSH,&raw); +} + +static void +tty_reset(int fd) +{ + tcsetattr(fd, TCSAFLUSH, &orig_termios); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/tests/test-rem new/remind-04.02.07/tests/test-rem --- old/remind-04.02.06/tests/test-rem 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/tests/test-rem 2023-10-09 16:21:33.000000000 +0200 @@ -437,6 +437,9 @@ # This segfaulted in 04.02.03 ../src/remind -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1 +# Test --version long option +../src/remind --version >> ../tests/test.out 2>&1 + # Remove references to SysInclude, which is build-specific grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out cmp -s ../tests/test.out ../tests/test.cmp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-04.02.06/tests/test.cmp new/remind-04.02.07/tests/test.cmp --- old/remind-04.02.06/tests/test.cmp 2023-09-12 20:38:14.000000000 +0200 +++ new/remind-04.02.07/tests/test.cmp 2023-10-09 16:21:33.000000000 +0200 @@ -1060,7 +1060,7 @@ "a05" + "6" => "a056" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" set a058 version() -version() => "04.02.06" +version() => "04.02.07" set a059 wkday(today()) today() => 1991-02-16 wkday(1991-02-16) => "Saturday" @@ -2644,7 +2644,7 @@ a109 2012-01-01 a128 2018-02-03@16:45 a039 "February" -a058 "04.02.06" +a058 "04.02.07" a077 "1992 92\n" a096 -4 a119 -1 @@ -11695,3 +11695,4 @@ 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 +04.02.07