Compare commits

..

82 Commits

Author SHA1 Message Date
Dianne Skoll
51dfd707a2 One more release note 2023-12-14 16:08:46 -05:00
Dianne Skoll
7c3bf8601b Update WHATSNEW. 2023-12-14 16:05:40 -05:00
Dianne Skoll
714195efe5 Bump version to 04.02.08 2023-12-14 15:58:20 -05:00
Dianne Skoll
eaeca2d09b Minor tweak. 2023-12-12 11:52:27 -05:00
Dianne Skoll
ffa3b13437 Better method to detect if compiler supports -ffat-lto-objects
clang does not support this option, but the configure script was
supplying it anyway, causing warnings.
2023-12-12 09:23:26 -05:00
Dianne Skoll
2551e98d11 Use "now = time(NULL)" rather than (void) time(&now)" 2023-12-11 15:56:42 -05:00
Dianne Skoll
1bfd7761bc Use EXIT_FAILURE / EXIT_SUCCESS consistently. 2023-12-10 10:42:26 -05:00
Dianne Skoll
de9cb1d0a3 Use symbols STDIN_FILENO, etc. 2023-12-10 10:38:42 -05:00
Dianne Skoll
b2d32b514a Catch SIGCONT to force it to interrupt the select() system call. 2023-12-09 19:12:27 -05:00
Dianne Skoll
6e53fd6924 Refactor code: Replace SystemTime(x)/60 with MinutesPastMidnight(x) 2023-12-09 10:41:03 -05:00
Dianne Skoll
8296d2b962 Display "(Queue is empty)" if queue is empty. 2023-12-09 10:30:18 -05:00
Dianne Skoll
d6e66ee1e6 Tighten test for removing very old reminders from queue. 2023-12-09 10:25:50 -05:00
Dianne Skoll
a49532b9c5 Remove non-triggered but expired reminders from the queue. 2023-12-08 14:02:29 -05:00
Dianne Skoll
57d87f4caf Better logic for closing stdin/stdout/stderr if we fork. 2023-12-06 16:39:13 -05:00
Dianne Skoll
ec9b30c616 Don't let "REM ... MSG NOTE endreminder" mess with daemon protocol.
Pad with a leading space. :)
2023-12-06 13:28:17 -05:00
Dianne Skoll
27d8a62ab6 Update SERVER MODE documentation. 2023-12-06 13:17:53 -05:00
Dianne Skoll
5077814c4a Clarify when $MaxLateMinutes is read. 2023-12-06 13:11:28 -05:00
Dianne Skoll
ca795a352a Add the $MaxLateMinutes system variable.
Don't trigger a timed reminder if it's more than $MaxLateMinutes past
the trigger time (for example, if the computer has hibernated and then
been awoken.)
2023-12-03 17:16:48 -05:00
Dianne Skoll
e59fc36458 Use <meta charset="UTF-8"> instead of http-equiv. 2023-10-15 11:25:06 -04:00
Dianne Skoll
39e3657539 Add --utf8 flag to rem2html. 2023-10-15 10:10:27 -04:00
Dianne Skoll
6031f70701 Update the balloon help when we toggle between Queue... and Errors... 2023-10-11 17:20:41 -04:00
Dianne Skoll
3567c9e55f If errors occur during printing, set the "Errors..." button rather than popping up a dialog. 2023-10-11 17:16:27 -04:00
Dianne Skoll
26de4e3fd3 Use bold rather than italice. 2023-10-09 10:39:18 -04:00
Dianne Skoll
cd65c6144d Merge branch 'fix_man' into 'master'
Fix manpage formatting

See merge request dskoll/remind!5
2023-10-09 14:38:07 +00:00
Dianne Skoll
d32edbbb1f Fix release date. 2023-10-09 10:21:33 -04:00
Dianne Skoll
eae48a5538 Update release notes. 2023-10-08 18:17:28 -04:00
Dianne Skoll
63eba104d9 Reinstate tests that only work with 64-bit time_t 2023-10-08 18:09:34 -04:00
Dianne Skoll
ae64961735 Try to use 64-bit time_t on 32-bit systems. 2023-10-08 18:07:14 -04:00
Dianne Skoll
f7bb91320c Return an error rather than (DATETIME) -1 if soleq fails 2023-10-08 11:58:28 -04:00
Dianne Skoll
c11071a859 Undo fixes - the problem is with mktime on 32-bit systems.
Remove tests that break on 32-bit systems.
2023-10-08 11:49:44 -04:00
Dianne Skoll
53cbcc22db Fix typo 2023-10-08 11:35:06 -04:00
Dianne Skoll
af9dcec3e9 Use "long long" for 32-bit systems. 2023-10-08 11:34:10 -04:00
Dianne Skoll
d5a4b0d235 Allow specification of terminal-background mode as 't'
This forces Remind to try to guess the terminal background
even if stdout is not a tty.
2023-10-08 11:19:17 -04:00
Dianne Skoll
3b870403d9 Don't use UTF-8 input. 2023-10-08 11:08:58 -04:00
Dianne Skoll
284d822884 Fix a number of typos. 2023-10-08 10:55:48 -04:00
Dianne Skoll
d881a26ad0 Don't attempt to guess terminal background if supplied in an -@,n option. 2023-10-05 09:52:43 -04:00
Dianne Skoll
8519edde29 Fix logic error. 2023-10-04 10:11:49 -04:00
Dianne Skoll
a30c467c48 Revert "Guess terminal background even if stdout is not a tty"
This reverts commit 887cd83ebe.
2023-10-04 09:36:25 -04:00
Dianne Skoll
887cd83ebe Guess terminal background even if stdout is not a tty 2023-10-04 09:33:54 -04:00
Dianne Skoll
242d787ca2 Update release notes 2023-10-04 09:32:44 -04:00
Dianne Skoll
5dd2cf7356 Update version to 04.02.07 2023-10-04 09:32:38 -04:00
Dianne Skoll
5efb70909d Make -w0 obtain width from STDOUT_FILENO 2023-10-04 09:32:06 -04:00
Dianne Skoll
a60d466774 Document that Remind attempts to figure out terminal background lightness. 2023-10-03 18:59:51 -04:00
Dianne Skoll
1c01f36271 Fix typo 2023-10-03 09:25:45 -04:00
Dianne Skoll
3718632551 Let Remind guess if terminal is dark or light. 2023-10-03 00:09:59 -04:00
Dianne Skoll
e8f3d5ff9f Tweak the terminal background-color guessing code. 2023-10-03 00:04:01 -04:00
Dianne Skoll
d77e27942d Try to guess the terminal background color. 2023-10-03 00:00:59 -04:00
Dianne Skoll
734cc61489 Better logic for checking if we should close TTY fd. 2023-10-02 23:07:34 -04:00
Dianne Skoll
44d489d3d2 Make -w0 behave the same as -wt instead of causing an infinite loop. 2023-10-02 23:03:30 -04:00
Dianne Skoll
3e36ffa9ff Rename function. 2023-10-01 13:56:24 -04:00
Dianne Skoll
12104a96b1 Improve icon. 2023-09-29 18:06:18 -04:00
Dianne Skoll
8ab8d65a15 Document $DeltaOverride 2023-09-27 11:01:28 -04:00
Dianne Skoll
f7a8122cef Document --version 2023-09-25 12:41:57 -04:00
Dianne Skoll
77d9bbb7d6 Add FILES section to man page. 2023-09-25 09:43:06 -04:00
Dianne Skoll
623def52fd Add MAILING LIST section. 2023-09-25 09:38:07 -04:00
Dianne Skoll
d088e35142 Add bug-reporting email address. 2023-09-25 09:37:12 -04:00
Dianne Skoll
5821e55eb8 Add (1) to remind(1) in SEE ALSO section. 2023-09-25 08:28:24 -04:00
Dianne Skoll
1ee989c65d Add example for null date specification. 2023-09-25 08:27:22 -04:00
Dianne Skoll
62388fb21f Add "--version" long option. 2023-09-25 08:23:28 -04:00
Dianne Skoll
13571f84af Fix typo in man page source (found by Dan Jacobson) 2023-09-25 08:15:14 -04:00
Dianne Skoll
03fdc06b65 Make AT optional: If we encounter a TIME, then implicitly start an AT clause. 2023-09-18 12:59:00 -04:00
Dianne Skoll
4bce675ae6 Update remind-conf-mode.el per Bill Benedetto 2023-09-13 18:40:13 -04:00
Jochen Sprickerhof
7b64623115 Fix manpage formatting 2023-09-12 21:08:44 +02:00
Dianne Skoll
e268bbf31d Bump version to 04.02.06 2023-09-12 14:38:14 -04:00
Dianne Skoll
5863404de6 Document that MAYBE-UNCOMPUTABLE can be abbreviated to MAYBE. 2023-09-07 16:03:12 -04:00
Dianne Skoll
2de5996f4e Update man page. 2023-08-17 09:35:55 -04:00
Dianne Skoll
695e79602a Add Irish holidays in include/holidays/ie.rem
Courtesy of Amy de Buitléir.
2023-07-26 16:02:21 -04:00
Dianne Skoll
cf0d958da5 Add optional "step" parameter to slide() to match nonomitted(). 2023-07-23 14:43:13 -04:00
Dianne Skoll
85b0348fa7 Add $ParseUntriggered system variable. 2023-07-20 09:21:37 -04:00
Dianne Skoll
15a5d9a876 Simplify since() example. 2023-07-19 10:19:55 -04:00
Dianne Skoll
1baa6dab0c Updates to nomomitted:
o Add optional "step" argument
  o If start > end, swap the first two arguments
  o Update man page and tests
2023-07-15 13:04:47 -04:00
Dianne Skoll
34bb250ba3 Fix documentation accuracy. 2023-06-27 09:46:40 -04:00
Dianne Skoll
598b1b7464 Better documentation of %"...%" interaction with "-ca". 2023-06-11 14:08:22 -04:00
Dianne Skoll
e63d4be4e8 Make "-tn" explicitly set a delta of ++n for *all* REM statements.
Also change the name of $DeltaOffset to $DeltaOverride.
2023-06-03 13:36:58 -04:00
Dianne Skoll
65561e7f34 Add "-tz" option to suppress all deltas. Document -tn better. 2023-05-21 20:14:07 -04:00
Dianne Skoll
da31dadb71 Correct Italian localizatio; patch courtesy of Emanuele Torre 2023-04-18 16:07:10 -04:00
Dianne Skoll
705adbb82a Update release notes for 04.02.05. 2023-04-11 08:25:54 -04:00
Dianne Skoll
269f9788b6 Bump version to 04.02.05. 2023-04-11 08:22:10 -04:00
Dianne Skoll
5e1c5ae384 Diagnose common error. 2023-04-10 08:51:25 -04:00
Dianne Skoll
562eb83bde *SIGH* Fix ADDOMIT/SATISFY bug.
This was fixed for normal mode in commit dedb9766c9
but was not fixed in calendar mode.
2023-04-09 10:44:34 -04:00
Dianne Skoll
a53db00243 Don't bother checking for sys/file.h because nothing includes it. 2023-03-19 09:47:12 -04:00
Dianne Skoll
11375729db Remove unnecessary #include. 2023-03-19 09:43:57 -04:00
32 changed files with 3672 additions and 1658 deletions

3080
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/queue.c)
AC_INIT
AC_CONFIG_SRCDIR([src/queue.c])
cat <<'EOF'
@@ -12,7 +13,7 @@ cat <<'EOF'
EOF
AC_CONFIG_HEADER(src/config.h)
AC_CONFIG_HEADERS([src/config.h])
AC_ARG_ENABLE(perl-build-artifacts,
[ --disable-perl-build-artifacts
@@ -29,32 +30,32 @@ AC_PATH_PROG([PERL], [perl])
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 sys/file.h glob.h wctype.h locale.h langinfo.h)
AC_CHECK_HEADERS(sys/types.h glob.h wctype.h locale.h langinfo.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_UTIME_NULL
AC_HEADER_TIME
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
# Check for link-time optimization support
f=-flto=auto
AC_MSG_CHECKING([whether $CC supports $f])
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
if $CC -Werror -E $f - < /dev/null > /dev/null 2>&1 ; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS $f"
f=-ffat-lto-objects
AC_MSG_CHECKING([whether $CC supports $f])
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
if $CC -Werror -E $f - < /dev/null > /dev/null 2>&1 ; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS $f"
else
@@ -65,6 +66,12 @@ if test "$GCC" = yes; then
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
@@ -80,10 +87,12 @@ if test "$?" != 0 ; then
exit 1
fi
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
VERSION=04.02.04
VERSION=04.02.08
AC_SUBST(VERSION)
AC_SUBST(PERL)
AC_SUBST(PERLARTIFACTS)
AC_SUBST(RELEASE_DATE)
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1)
AC_CONFIG_FILES([src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1])
AC_OUTPUT
chmod a+x rem2pdf/bin/rem2pdf

View File

@@ -514,6 +514,7 @@ Acts on the region or places point where it needs to be."
(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)

View File

@@ -1,5 +1,106 @@
CHANGES TO REMIND
* VERSION 4.2 Patch 8 - 2023-12-14
- NEW FEATURE: Add the $MaxLateMinutes system variable. This suppresses
a queued time reminder if the current time is more than $MaxLateMinutes
past the trigger time. (This typically only occurs if the computer
has been suspended/hibernated and then resumed.)
- IMPROVEMENT: tkremind: If an error occurs during printing, catch it
and change the Queue... button to Errors... (the same way errors in
reminder files are handled.)
- IMPROVEMENT: rem2html: add the --utf8 flag to set the HTML charset to
UTF-8.
- MINOR IMPROVEMENTS: Refactor some of the C code; use symbolic exit
statuses and file descriptors for stdin/stdout/stderr where possible.
- BUG FIX: configure.in: Use better option detection so we don't use the
unsupported option -ffat-lto-objects if compiling with clang instead of gcc.
- BUG FIXES: Many fixes to man pages, some by Jochen Sprickerhof
- MINOR BUG FIX: If Remind puts itself in the background, only close
stdout/stderr if they are not associated with a terminal. If
we close a descriptor, dup /dev/null onto it.
- MINOR BUG FIX: Catch SIGCONT when running in daemon/background mode.
This forces the select() call to be interrupted so we can update the
sleep time. This really only matters if the computer or the background
Remind process is suspended and then resumed.
* 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
extra INT argument called "step". See man page for details. Also
allows the "start" argument to be greater than the "end" argument,
in which case they are effectively swapped.
- NEW FEATURE: remind: The "slide()" function takes an optional extra
INT argument called "step", similar to "nonomitted()". See man page
for details.
- NEW FEATURE: remind: Added the $ParseUntriggered system variable;
see the man page for details. You almost certainly will never need
to use this.
- NEW FILE: holidays/ie.rem: Added Irish holidays, courtesy of
Amy de Buitléir.
- CHANGE: remind: The "-tn" option sets all REM statement deltas to
++n rather than adding n to any existing REM statement's delta.
Additionally, the corresponding system variable $DeltaOffset has
been renamed to $DeltaOverride.
- NEW OPTION: remind: Add the "-tz" option to explicitly set all
REM statement deltas to zero.
- DOCUMENTATION FIX: remind: various documentation improvements.
- BUG FIX: Correct some errors in Italian localization, courtesy of
Emanuele Torre
* VERSION 4.2 Patch 5 - 2023-04-11
- MINOR IMPROVEMENT: remind: If someone uses OMIT yyyy-mm-dd UNTIL yyyy-mm-dd
give a better error message suggesting THROUGH instead of UNTIL.
- BUG FIX: remind: The fix for the combination of ADDOMIT and SATISFY that
appeared in version 04.02.00 was not complete; the bug has finally been
properly fixed.
- BUG FIX: remind: Remove an unnecessary #include <sys/file.h>.
Nothing needed that and it broke compilation on FreeBSD.
* VERSION 4.2 Patch 4 - 2023-03-15
- NEW FEATURE: Remind: Add "htmlescape" and "htmlstriptags" built-in

View File

@@ -10,7 +10,7 @@ FSET center(x) pad("", " ", (columns() - columns(x))/2) + x
FSET right(x) pad("", " ", columns() - columns(x)) + x
MSG This is left-aligned.
MSG [ansicolor(0,255,0)]This is also left-aligned.[ansicolor("")]
MSG [ansicolor(0,255,0)]🌕 🌕 🌕 🌕 This is also left-aligned.[ansicolor("")]
MSG [center("This is centered.")]
MSG [ansicolor(255,255,0) + center("🌕 🌕 🌕 🌕 This is also centered. ") + ansicolor("")]

View File

@@ -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 @@ INCLUDE [$SysInclude]/ansitext.rem
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 @@ EOF
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 %

42
include/holidays/ie.rem Normal file
View File

@@ -0,0 +1,42 @@
;
; Irish Holidays
;
; The dates for the Public ("bank") holidays are taken from the following site:
; https://www.citizensinformation.ie/en/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays/
;
; This file was derived from:
; https://github.com/mhwombat/dotWombat/blob/master/.config/remind/IrishHolidays.rem
; by Amy de Buitléir.
; fixed dates
OMIT 31 December MSG New Year's Eve (Oíche Chinn Bliana) Public Holiday
OMIT 1 January MSG New Year's Day (Lá Caille, Lá Bliana Nua) Public Holiday
OMIT 17 March MSG Saint Patrick's Day (Lá Fhéile Pádraig) Public Holiday
OMIT 24 December MSG Christmas Eve (Oíche Nollag) Public Holiday
OMIT 25 December MSG Christmas Day (Lá Nollag) Public Holiday
OMIT 26 December MSG Saint Stephen's Day, Wren Day (Lá Fhéile Stiofáin, Lá an Dreoilín) Public Holiday
; moving dates
; First Monday in May
REM Monday 1 May SCANFROM -7 ADDOMIT MSG May Day (Lá Bealtaine) Public Holiday
; First Monday in June
REM Monday 1 June SCANFROM -7 ADDOMIT MSG June Public Holiday
; First Monday in August
REM Monday 1 August SCANFROM -7 ADDOMIT MSG August Public Holiday
; Last Monday in October
REM Monday 1 -7 November SCANFROM -7 ADDOMIT MSG October Public Holiday
; Easter
SET easter easterdate(today())
REM [TRIGGER(easter-2)] MSG Good Friday (Aoine an Chéasta)
REM [TRIGGER(easter)] MSG Easter Sunday (Domhnach Cásca)
OMIT [TRIGGER(easter+1)] MSG Easter Monday (Luan Cásca) Public Holiday
; St. Brigid's Day
REM 1 February MSG Saint Brigid's Day (Lá Fhéile Bríde or Imbolc)
; The public holiday is the first Monday in February, or 1 February if the date falls on a Friday
REM February SCANFROM -7 ADDOMIT SATISFY [($Td==1 && $Tw==5) || ($Td<8 && $Tw==1 && $Td!=4)] MSG Public Holiday

View File

@@ -4,11 +4,11 @@
# This file is derived from a translation by Valerio Aimale
SET $Sunday "Domenica"
SET $Monday "Lunedí"
SET $Tuesday "Martedí"
SET $Wednesday "Mercoledí"
SET $Thursday "Giovedí"
SET $Friday "Venerdí"
SET $Monday "Lunedì"
SET $Tuesday "Martedì"
SET $Wednesday "Mercoledì"
SET $Thursday "Giovedì"
SET $Friday "Venerdì"
SET $Saturday "Sabato"
SET $January "Gennaio"
@@ -40,7 +40,7 @@ SET $Now "ora"
SET $At "alle"
SET $Minute "minuto"
SET $Hour "ora"
SET $Is "é"
SET $Is "è"
SET $Was "era"
SET $And "e"
SET $Hplu "a"

View File

@@ -19,4 +19,4 @@ Remind was written by Dianne Skoll <dianne@skoll.ca>
.SH HOME PAGE
https://dianne.skoll.ca/projects/remind/
.SH SEE ALSO
\fBremind\fR
\fBremind\fR(1)

View File

@@ -327,7 +327,7 @@ calendar.
.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
@@ -458,7 +458,7 @@ JSON object. The keys that may be present in the JSON object are as
follows:
.TP
.B date \fIYYYY-MM-DD\fR
The \fbdate\fR key will \fIalways\fR be present; it is the trigger date
The \fBdate\fR key will \fIalways\fR be present; it is the trigger date
of the reminder expressed as a string in the format \fIYYYY-MM-DD\fR
.TP
.B filename \fIf\fR

View File

@@ -28,6 +28,10 @@ Anything after the __EOF__ marker is completely ignored.
\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
@@ -60,7 +64,9 @@ weeks to be produced.
.B 'a'
causes \fBRemind\fR to display reminders on the calendar on the
day they actually occur \fIas well as\fR on any preceding days
specified by the reminder's \fIdelta\fR.
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 themselves are removed.)
.TP
.B 'l'
causes \fBRemind\fR to use VT100 line-drawing characters to draw
@@ -103,11 +109,18 @@ If the optional \fIm\fR parameter is supplied following a comma, then
\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
@@ -222,8 +235,14 @@ regardless of the \fIdelta\fR supplied for each reminder.
.TP
.B \-t\fR\fIn\fR
If you supply a number \fIn\fR after the \fB\-t\fR option, then
\fBRemind\fR pretends that each non-expired reminder has a \fIdelta\fR
of \fIn\fR days and triggers reminders accordingly.
\fBRemind\fR pretends that echo \fBREM\fR command has a 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
\fBRemind\fR sets all REM statements' deltas to zero, regardless of the
value supplied in the REM statement itself. In effect, this disables
all deltas of the form \fB\+\fIn\fR and \fB\+\+\fIn\fR.
.TP
.B \-tt\fR[\fIn\fR]
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
@@ -602,6 +621,11 @@ The following examples show how date specifications are interpreted.
.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
@@ -1782,7 +1806,7 @@ will begin reading from standard input.
.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
@@ -2390,6 +2414,10 @@ is normally 0, but can be set with the \fB\-tt\fR option or explicitly
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
@@ -2456,7 +2484,8 @@ or a date different from today's true date was supplied. If non-zero,
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
@@ -2533,6 +2562,24 @@ updates \fB$LongDeg\fR, \fB$LongMin\fR and \fB$LongSec\fR. Similar
rules apply to \fB$Latitude\fR, \fB$LatDeg\fR, \fB$LatMin\fR and \fB$LatSec\fR.
.RE
.TP
.B $MaxLateMinutes
This variable controls how \fBRemind\fR reacts to a computer being suspended
and then woken. Normally, if a timed reminder is queued and then the
computer suspended, and then the computer is woken \fIafter\fR the
timed reminder's trigger time, \fBRemind\fR will triger the timer anyway,
despite the fact that the trigger time has already passed.
.RS
.PP
If you set \fB$MaxLateMinutes\fR to a non-zero integer between 1 and 1440,
then \fBRemind\fR will \fInot\fR trigger a timed reminder whose trigger
time is more than \fB$MaxLateMinutes\fR minutes in the past.
.PP
Note that \fBRemind\fR uses the value of \fB$MaxLateMinutes\fR that is in
effect when it has finished reading the reminder file and puts itself in
the background. Generally, you should set \fB$MaxLateMinutes\fR once
near the beginning of the file and not change it after that.
.RE
.TP
.B $MaxSatIter
The maximum number of iterations for the \fBSATISFY\fR clause
(described later.) Must be at least 10.
@@ -2577,6 +2624,28 @@ by \fBREM\fR commands; triggers in \fBIFTRIG\fR commands do
not affect it.
.RE
.TP
.B $ParseUntriggered
A flag indicating whether or not \fBRemind\fR should fully parse \fBREM\fR
statements that are not triggered. 0 means to skip parsing them and 1
(the default) means to parse them.
.PP
.RS
For example, if we have the following \fBREM\fR statement:
.PP
.nf
REM 2020-01-01 MSG ["bad_expression" * 2]
.fi
.PP
Then by default, \fBRemind\fR will fully parse the line and issue
a "Type mismatch" error even if the reminder is not triggered. However,
if \fB$ParseUntriggered\fR is set to 0, then \fBRemind\fR will not
issue the error except on 2020-01-01, when the reminder is triggered.
.PP
Setting \fB$ParseUntriggered\fR to 0 may in some cases slightly
improve performance, at the risk of not catching errors until a
reminder is triggered.
.RE
.TP
.B $PrefixLineNo (read-only)
If non-zero, then the \fB\-l\fR option was supplied on the command line.
.TP
@@ -2678,9 +2747,13 @@ Set to 1 if the \fB\-@1\fR option was used; 0 otherwise.
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,
@@ -3258,14 +3331,31 @@ is supplied, only the date component is used.
Returns the time of "nautical twilight" on the specified \fIdate\fR. If
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
.TP
.B nonomitted(dq_start, dq_end [,s_wkday...])
.B nonomitted(dq_start, dq_end [, i_step] [,s_wkday...])
This function returns the number of \fInon-\fRomitted days between
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
counted. \fIend\fR is never counted.
.RS
.PP
Note that \fIend\fR must be greater than or equal to \fIstart\fR or an
error is reported. In addition to using the global OMIT context, you
Note that if \fIend\fR is less than \fIstart\fR, the arguments
are effectively swapped, so counting always begins from the older
date.
.PP
If the third argument to \fBnonomitted\fR is an \fBINT\fR, then it must
be greater than zero, and is consider to be the \fIstep\fR by which
\fBnonomitted\fR counts. For example the following expression:
.PP
.nf
nonomitted('2023-07-01', '2023-07-29', 7)
.fi
.PP
returns the number of non-omitted Saturdays from 2023-07-01 up to
(but not including) 2023-07-29. (Both 2023-07-01 and 2023-07-29 are
Saturdays.)
.PP
If no \fIstep\fR argument is supplied, then a step of 1 is used.
.PP
In addition to using the global OMIT context, you
can supply additional arguments that are names of weekdays to be
omitted. However, in a \fBREM\fR command, any local \fBOMITFUNC\fR
clause is \fInot\fR taken into account by this function.
@@ -3292,7 +3382,7 @@ reminder will label day numbers in a calendar:
.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
@@ -3486,10 +3576,13 @@ will set \fBa\fR to:
.fi
.TP
.B slide(d_start, i_amt [,s_wkday...])
.B slide(d_start, i_amt [, i_step] [,s_wkday...])
This function is the inverse of \fBnonomitted\fR. It adds \fIamt\fR
days (which can be negative) to \fIstart\fR, \fInot counting omitted days\fR.
The optional \fIwkday\fR arguments are additional weekday names to omit.
(which can be negative) chunks of \fIstep\fR days to \fIstart\fR,
\fInot counting omitted days\fR. If \fIstep\fR is not supplied, then
it is assumed to be 1. Note that only every \fIstep\fRth day is
tested to see if it is omitted. The optional \fIwkday\fR arguments
are additional weekday names to omit.
.RS
.PP
Consider this example:
@@ -3509,6 +3602,26 @@ May 16 and 17. You can go backwards, too, so:
.fi
.PP
takes \fIa\fR back to 2009-05-13.
.PP
Now consider this example:
.PP
.nf
OMIT 14 May 2009
SET a slide('2009-05-07', 2, 7)
.fi
.PP
This sets \fIa\fR to '2009-05-28' because we skip ahead two weeks, not
counting a week where the day we land on happens to be omitted. Contrast with
this:
.PP
.nf
OMIT 13 May 2009
SET a slide('2009-05-07', 2, 7)
.fi
.PP
which sets \fIa\fR to '2009-05-21'. Although 2009-05-13 is omitted, we
don't "land" on it as we step forward in chunks of 7 days, so we never
see that it is omitted.
.RE
.TP
.B soleq(i_which [, dqi_start])
@@ -4216,7 +4329,7 @@ you define a function taking no parameters. Here are some examples:
.nf
FSET double(x) 2*x
FSET yeardiff(date1, date2) year(date1) - year(date2)
FSET since(x) ord(year(trigdate())\-x)
FSET since(x) ord($Ty \- x)
.fi
.PP
The last function is useful in birthday reminders. For example:
@@ -4231,6 +4344,12 @@ Dean was born in 1984. The above example, on 1 November 1992, would print:
Dean's 8th birthday is today.
.fi
.PP
Similarly, the function is useful in anniversary reminders. For example:
.PP
.nf
REM 4 June MSG [since(1989)] anniversary of the Tienanmen Square massacre
.fi
.PP
Notes:
.TP
o
@@ -5449,7 +5568,7 @@ The \fBSPECIAL\fR keyword is used to transmit "out-of-band" information
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
@@ -5538,7 +5657,7 @@ after the WEEK keyword.
.PP
.SH MISCELLANEOUS
.PP
.B COMMAND ABBREVIATIONS
.B COMMAND AND KEYWORD ABBREVIATIONS
.PP
The following tokens can be abbreviated:
.TP
@@ -5565,6 +5684,9 @@ o
\fBINCLUDE\fR --> \fBINC\fR
.TP
o
\fBMAYBE-UNCOMPUTABLE\fR --> \fBMAYBE\fR
.TP
o
\fBSCANFROM\fR --> \fBSCAN\fR
.PP
.B NIFTY EXAMPLES
@@ -5737,6 +5859,25 @@ components, then \fBRemind\fR will correctly compute a trigger date, even
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 <dianne@skoll.ca> wrote \fBRemind\fR. The moon code
@@ -5784,9 +5925,11 @@ Liviu Daia
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: dianne@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.
@@ -5809,6 +5952,8 @@ Richard Siegel and Michael and Sharon Strassfeld, \fIThe First Jewish
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)

View File

@@ -383,6 +383,16 @@ same thing.
STATUS
Return the number of queued reminders.
.TP
QUEUE
Returns the contents of the queue, printed between "NOTE queue" and
"NOTE endqueue" lines.
.TP
JSONQUEUE
Returns the contents of the queue in JSON format, printed between
"NOTE JSONQUEUE" and "NOTE ENDJSONQUEUE" lines.
.TP
REREAD
Re-read the reminder file
@@ -416,6 +426,16 @@ NOTE queued \fIn\fR
This line is emitted in response to a \fBSTATUS\fR command. The number
\fIn\fR is the number of reminders in the queue.
.TP
NOTE queue
Indicates that queue contents are about to follow. The end of the
queue is indicated by a NOTE endqueue line.
.TP
NOTE JSONQUEUE
Indicates that queue contents in JSON format are about to follow. The
end of the queue is indicated by a NOTE ENDJSONQUEUE line.
.SH AUTHOR
TkRemind was written by Dianne Skoll <dianne@skoll.ca>

View File

@@ -6,6 +6,7 @@ use warnings;
use Getopt::Long;
use JSON::MaybeXS;
use Encode;
my %Options;
@@ -44,6 +45,11 @@ Print usage information
Print version
=item --utf8
Assume standard input is encoded in UTF-8; write UTF-8 data to standard
output.
=item --backurl I<url>
When producing the small calendar for the previous month, make the
@@ -154,6 +160,7 @@ Usage: remind -pp ... | rem2html [options]
Options:
--help, -h Print usage information
--utf8 Assume UTF-8 input and write UTF-8 output
--man Show man page (requires "perldoc")
--version Print version
--backurl url Make the title on the previous month's small calendar
@@ -197,6 +204,7 @@ sub parse_options
local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; };
if (!GetOptions(\%Options, "help|h",
"man",
"utf8",
"pngs",
"version",
"stylesheet=s",
@@ -216,13 +224,22 @@ sub parse_options
if ($stylesheet) {
$Options{stylesheet} = smoosh($Options{imgbase}, $stylesheet);
}
if ($Options{utf8}) {
binmode(STDIN, ':encoding(UTF-8)');
binmode(STDOUT, ':encoding(UTF-8)');
}
}
sub start_output
{
return if ($Options{tableonly});
print("<html>\n<head>\n<title>" . $Options{title} . "</title>\n");
print("<html>\n<head>\n");
if ($Options{utf8}) {
print '<meta charset="UTF-8">' . "\n";
}
print("<title>" . $Options{title} . "</title>\n");
if (!$Options{nostyle}) {
if ($Options{stylesheet}) {
print('<link rel="stylesheet" type="text/css" href="' .
@@ -310,7 +327,12 @@ sub parse_input
($y, $m, $d, $special, $tag, $duration, $time, $body) =
($1, $2, $3, $4, $5, $6, $7, $8);
} elsif (/\{/) {
my $obj = decode_json($_);
my $obj;
if ($Options{utf8}) {
$obj = decode_json(encode('UTF-8', $_, Encode::FB_DEFAULT));
} else {
$obj = decode_json($_);
}
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
$y = $1;
$m = $2;

View File

@@ -29,31 +29,62 @@ set Hostname [exec hostname]
# 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= }
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 }
wm iconphoto . -default rpicon
}
@@ -1249,7 +1280,7 @@ proc Status { stuff } {
# None
#---------------------------------------------------------------------------
proc DoPrint {} {
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus RemindErrors
global CurMonth CurYear MonthNames
catch {destroy .p}
@@ -1435,7 +1466,8 @@ proc DoPrint {} {
append cmd " $fname"
Status "Printing..."
if {[catch {eval "exec $cmd"} err]} {
tk_dialog .error Error "Error during printing: $err" error 0 Ok
set RemindErrors [unique_lines $err]
set_button_to_errors
}
DisplayTime
}
@@ -2671,9 +2703,14 @@ proc ShowQueue { file } {
continue;
}
set obj [lsort -command sort_q $obj]
set did 0
foreach q $obj {
$w.t insert end "$q\n"
set did 1
}
if { $did == 0 } {
$w.t insert end "(Queue is empty)\n"
}
}
$w.t configure -state disabled
}
@@ -4017,13 +4054,17 @@ bind Balloon <Destroy> {
catch { unset Balloon(helptext%W) }
}
proc balloon_add_help { w txt } {
proc balloon_set_help { w txt } {
global Balloon
if {"$txt" == ""} {
catch { unset Balloon(helptext$w) }
return
}
set Balloon(helptext$w) $txt
}
proc balloon_add_help { w txt } {
balloon_set_help $w $txt
bindtags $w "Balloon [bindtags $w]"
}
@@ -4175,9 +4216,11 @@ proc update_color_buttons { w } {
}
proc set_button_to_queue {} {
balloon_set_help .b.queue "See the queue of pending reminders (debugging purposes only)"
.b.queue configure -text {Queue...} -command {DoQueue}
}
proc set_button_to_errors {} {
balloon_set_help .b.queue "See the list of errors from the most recent operation"
.b.queue configure -text {Errors...} -command {ShowErrors}
}

View File

@@ -1218,7 +1218,7 @@ static void PrintLeft(char const *s, int width, char pad)
if (!buf) {
/* Uh-oh... cannot recover */
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
exit(1);
exit(EXIT_FAILURE);
}
}
(void) mbstowcs(buf, s, len+1);
@@ -1297,7 +1297,7 @@ static void PrintCentered(char const *s, int width, char *pad)
if (!buf) {
/* Uh-oh... cannot recover */
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
exit(1);
exit(EXIT_FAILURE);
}
}
(void) mbstowcs(buf, s, len+1);
@@ -1603,7 +1603,7 @@ static void GenerateCalEntries(int col)
r=IncludeFile(InitialFile);
if (r) {
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING], InitialFile, ErrMsg[r]);
exit(1);
exit(EXIT_FAILURE);
}
while(1) {
@@ -1611,7 +1611,7 @@ static void GenerateCalEntries(int col)
if (r == E_EOF) return;
if (r) {
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
exit(1);
exit(EXIT_FAILURE);
}
s = FindInitialToken(&tok, CurLine);
@@ -1811,8 +1811,12 @@ static int DoCalRem(ParsePtr p, int col)
FindToken(DBufValue(&buf), &tok);
DBufFree(&buf);
if (tok.type == T_Empty || tok.type == T_Comment) {
r = OK;
if (trig.addomit) {
r = AddGlobalOmit(LastTriggerDate);
}
FreeTrig(&trig);
return OK;
return r;
}
if (tok.type != T_RemType || tok.val == SAT_TYPE) {
FreeTrig(&trig);

View File

@@ -7,9 +7,6 @@
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H

View File

@@ -199,9 +199,11 @@ int DoRem(ParsePtr p)
} else {
/* Parse the rest of the line to catch any potential
expression-pasting errors */
while (ParseChar(p, &r, 0)) {
if (r != 0) {
break;
if (ParseUntriggered) {
while (ParseChar(p, &r, 0)) {
if (r != 0) {
break;
}
}
}
}
@@ -348,6 +350,16 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
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);
@@ -1134,7 +1146,12 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queue
if (msg_command) {
DoMsgCommand(msg_command, DBufValue(&buf));
} else {
printf("%s", DBufValue(&buf));
/* Add a space before "NOTE endreminder" */
if (Daemon < 0 && !strncmp(DBufValue(&buf), "NOTE endreminder", 16)) {
printf(" %s", DBufValue(&buf));
} else {
printf("%s", DBufValue(&buf));
}
}
break;
@@ -1182,7 +1199,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
if (DontIssueAts > 1) {
/* If two or more -a options, then *DO* issue ats that are in the
future */
if (tim->ttime < SystemTime(0) / 60) {
if (tim->ttime < MinutesPastMidnight(0)) {
return 0;
}
} else {
@@ -1190,29 +1207,31 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
}
}
/* Don't trigger "old" timed reminders */
/*** REMOVED...
if (dse == DSEToday &&
tim->ttime != NO_TIME &&
tim->ttime < SystemTime(0) / 60) return 0;
*** ...UNTIL HERE */
/* If "infinite delta" option is chosen, always trigger future reminders */
if (InfiniteDelta || NextMode) return 1;
/* If there's a "warn" function, it overrides any deltas */
/* If there's a "warn" function, it overrides any deltas except
* DeltaOverride*/
if (t->warn[0] != 0) {
if (DeltaOffset) {
if (dse <= DSEToday + DeltaOffset) {
if (DeltaOverride > 0) {
if (dse <= DSEToday + DeltaOverride) {
return 1;
}
}
return ShouldTriggerBasedOnWarn(t, dse, err);
}
/* Zero delta */
if (DeltaOverride < 0) {
return dse == DSEToday;
}
/* Move back by delta days, if any */
if (t->delta != NO_DELTA) {
if (t->delta < 0)
if (DeltaOverride) {
/* A positive DeltaOverride takes precedence over everything */
dse = dse - DeltaOverride;
} else if (t->delta != NO_DELTA) {
if (t->delta < 0)
dse = dse + t->delta;
else {
int iter = 0;
@@ -1237,7 +1256,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
}
/* Should we trigger the reminder? */
return (dse <= DSEToday + DeltaOffset);
return (dse <= DSEToday);
}
/***************************************************************/

View File

@@ -46,7 +46,7 @@
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode)
{
int diff = dse - DSEToday;
int curtime = SystemTime(0) / 60;
int curtime = MinutesPastMidnight(0);
int err, done;
int c;
int d, m, y;
@@ -894,7 +894,7 @@ int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
int r;
if (dse == NO_DATE) dse=DSEToday;
if (tim == NO_TIME) tim=SystemTime(0)/60;
if (tim == NO_TIME) tim=MinutesPastMidnight(0);
CreateParser(source, &tempP);
tempP.allownested = 0;
tempTrig.typ = MSG_TYPE;

View File

@@ -30,10 +30,6 @@
#include <fcntl.h>
#include <unistd.h>
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
@@ -1425,28 +1421,28 @@ static int FRealtoday(func_info *info)
static int FNow(func_info *info)
{
RetVal.type = TIME_TYPE;
RETVAL = (int) ( SystemTime(0) / 60L );
RETVAL = MinutesPastMidnight(0);
return OK;
}
static int FRealnow(func_info *info)
{
RetVal.type = TIME_TYPE;
RETVAL = (int) ( SystemTime(1) / 60L );
RETVAL = MinutesPastMidnight(1);
return OK;
}
static int FCurrent(func_info *info)
{
RetVal.type = DATETIME_TYPE;
RETVAL = DSEToday * MINUTES_PER_DAY + (SystemTime(0) / 60);
RETVAL = DSEToday * MINUTES_PER_DAY + MinutesPastMidnight(0);
return OK;
}
static int FRealCurrent(func_info *info)
{
RetVal.type = DATETIME_TYPE;
RETVAL = RealToday * MINUTES_PER_DAY + (SystemTime(1) / 60);
RETVAL = RealToday * MINUTES_PER_DAY + MinutesPastMidnight(1);
return OK;
}
@@ -2496,7 +2492,7 @@ static int FTimezone(func_info *info)
if (Nargs == 0) {
dse = DSEToday;
now = (SystemTime(0) / 60);
now = MinutesPastMidnight(0);
} else {
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
dse = DATEPART(ARG(0));
@@ -3294,6 +3290,8 @@ FSlide(func_info *info)
{
int r, omit, d, i, localomit, amt;
Token tok;
int step = 1;
int localargs = 2;
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
ASSERT_TYPE(1, INT_TYPE);
@@ -3303,8 +3301,13 @@ FSlide(func_info *info)
if (amt > 1000000) return E_2HIGH;
if (amt < -1000000) return E_2LOW;
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
step = ARGV(2);
if (step < 1) return E_2LOW;
localargs++;
}
localomit = 0;
for (i=2; i<Nargs; i++) {
for (i=localargs; i<Nargs; i++) {
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
FindToken(ARG(i).v.str, &tok);
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
@@ -3315,14 +3318,14 @@ FSlide(func_info *info)
if ((WeekdayOmits | localomit) == 0x7F && amt != 0) return E_2MANY_LOCALOMIT;
if (amt > 0) {
while(amt) {
d++;
d += step;
r = IsOmitted(d, localomit, NULL, &omit);
if (r) return r;
if (!omit) amt--;
}
} else {
while(amt) {
d--;
d -= step;
if (d < 0) return E_DATE_OVER;
r = IsOmitted(d, localomit, NULL, &omit);
if (r) return r;
@@ -3339,6 +3342,8 @@ FNonomitted(func_info *info)
{
int d1, d2, ans, localomit, i;
int omit, r;
int step = 1;
int localargs = 2;
Token tok;
if (!HASDATE(ARG(0)) ||
@@ -3347,10 +3352,20 @@ FNonomitted(func_info *info)
}
d1 = DATEPART(ARG(0));
d2 = DATEPART(ARG(1));
if (d2 < d1) return E_2LOW;
if (d2 < d1) {
i = d1;
d1 = d2;
d2 = i;
}
/* Check for a "step" argument - it's an INT */
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
step = ARGV(2);
if (step < 1) return E_2LOW;
localargs++;
}
localomit = 0;
for (i=2; i<Nargs; i++) {
for (i=localargs; i<Nargs; i++) {
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
FindToken(ARG(i).v.str, &tok);
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
@@ -3359,11 +3374,12 @@ FNonomitted(func_info *info)
ans = 0;
while (d1 < d2) {
r = IsOmitted(d1++, localomit, NULL, &omit);
r = IsOmitted(d1, localomit, NULL, &omit);
if (r) return r;
if (!omit) {
ans++;
}
d1 += step;
}
RetVal.type = INT_TYPE;
RETVAL = ans;
@@ -3558,6 +3574,8 @@ rows_or_cols(func_info *info, int want_rows)
struct winsize w;
int fd = STDOUT_FILENO;
int opened = 0;
RetVal.type = INT_TYPE;
if (!isatty(fd)) {
fd = open("/dev/tty", O_RDONLY);
@@ -3565,6 +3583,7 @@ rows_or_cols(func_info *info, int want_rows)
RETVAL = -1;
return OK;
}
opened = 1;
}
if (ioctl(fd, TIOCGWINSZ, &w) == 0) {
if (want_rows) RETVAL = w.ws_row;
@@ -3572,7 +3591,7 @@ rows_or_cols(func_info *info, int want_rows)
} else {
RETVAL = -1;
}
if (fd != STDOUT_FILENO) {
if (opened) {
close(fd);
}
return OK;
@@ -3741,7 +3760,7 @@ solstice_equinox_for_year(int y, int which)
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 */
@@ -3789,8 +3808,10 @@ FSoleq(func_info *info)
}
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;

View File

@@ -50,6 +50,7 @@ EXTERN int LineNo;
EXTERN int FreshLine;
EXTERN uid_t TrustedUsers[MAX_TRUSTED_USERS];
EXTERN INIT( int MaxLateMinutes, 0);
EXTERN INIT( int NumTrustedUsers, 0);
EXTERN INIT( char const *MsgCommand, NULL);
EXTERN INIT( char const *QueuedMsgCommand, NULL);
@@ -70,7 +71,7 @@ EXTERN INIT( int Hush, 0);
EXTERN INIT( int NextMode, 0);
EXTERN INIT( int InfiniteDelta, 0);
EXTERN INIT( int DefaultTDelta, 0);
EXTERN INIT( int DeltaOffset, 0);
EXTERN INIT( int DeltaOverride, 0);
EXTERN INIT( int RunDisabled, 0);
EXTERN INIT( int IgnoreOnce, 0);
EXTERN INIT( int SortByTime, 0);
@@ -79,6 +80,7 @@ EXTERN INIT( int SortByPrio, 0);
EXTERN INIT( int UntimedBeforeTimed, 0);
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
EXTERN INIT( long SysTime, -1L);
EXTERN INIT( int ParseUntriggered, 1);
EXTERN char const *InitialFile;
EXTERN int FileAccessDate;

View File

@@ -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 @@ void InitRemind(int argc, char const *argv[])
int x;
int dse;
int ttyfd;
int r, g, b;
dse = NO_DATE;
@@ -219,7 +229,7 @@ void InitRemind(int argc, char const *argv[])
}
} else {
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
exit(1);
exit(EXIT_FAILURE);
}
/* Parse the command-line options */
@@ -243,6 +253,11 @@ void InitRemind(int argc, char const *argv[])
while(*arg) arg++;
break;
case '-':
ProcessLongOption(arg);
while(*arg) arg++;
break;
case '@':
UseVTColors = 1;
if (*arg) {
@@ -259,16 +274,24 @@ void InitRemind(int argc, char const *argv[])
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]);
}
}
}
}
@@ -341,10 +364,15 @@ void InitRemind(int argc, char const *argv[])
} else if (!*arg) {
InfiniteDelta = 1;
} else {
PARSENUM(DeltaOffset, arg);
if (DeltaOffset < 0) {
DeltaOffset = 0;
}
if (*arg == 'z') {
DeltaOverride = -1;
arg++;
} else {
PARSENUM(DeltaOverride, arg);
if (DeltaOverride < 0) {
DeltaOverride = 0;
}
}
}
break;
case 'e':
@@ -532,7 +560,7 @@ void InitRemind(int argc, char const *argv[])
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 {
@@ -543,7 +571,12 @@ void InitRemind(int argc, char const *argv[])
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;
@@ -616,6 +649,17 @@ void InitRemind(int argc, char const *argv[])
}
}
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) {
@@ -721,7 +765,7 @@ void InitRemind(int argc, char const *argv[])
/* Figure out the offset from UTC */
if (CalculateUTC)
(void) CalcMinsFromUTC(DSEToday, SystemTime(0)/60,
(void) CalcMinsFromUTC(DSEToday, MinutesPastMidnight(0),
&MinsFromUTC, NULL);
}
@@ -953,3 +997,116 @@ AddTrustedUser(char const *username)
NumTrustedUsers++;
}
static void
ProcessLongOption(char const *arg)
{
if (!strcmp(arg, "version")) {
printf("%s\n", VERSION);
exit(EXIT_SUCCESS);
}
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);
}

View File

@@ -17,11 +17,11 @@
/* Day names */
#define L_SUNDAY "Domenica"
#define L_MONDAY "Lunedí"
#define L_TUESDAY "Martedí"
#define L_WEDNESDAY "Mercoledí"
#define L_THURSDAY "Giovedí"
#define L_FRIDAY "Venerdí"
#define L_MONDAY "Lunedì"
#define L_TUESDAY "Martedì"
#define L_WEDNESDAY "Mercoledì"
#define L_THURSDAY "Giovedì"
#define L_FRIDAY "Venerdì"
#define L_SATURDAY "Sabato"
/* Month names */
@@ -68,7 +68,7 @@
#define L_AT "alle"
#define L_MINUTE "minut"
#define L_HOUR "or"
#define L_IS "é"
#define L_IS "è"
#define L_WAS "era"
#define L_AND "e"
/* What to add to make "hour" plural */

View File

@@ -26,16 +26,10 @@
#endif
#include <ctype.h>
#ifdef TIME_WITH_SYS_TIME
#include <time.h>
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#else
#if defined(HAVE_SYS_TIME_H) || defined (TIME_WITH_SYS_TIME)
#include <sys/time.h>
#else
#endif
#include <time.h>
#endif
#endif
#include <sys/types.h>
#ifdef REM_USE_WCHAR
@@ -187,14 +181,14 @@ static void DoReminders(void)
if (FileAccessDate < 0) {
fprintf(ErrFp, "%s: `%s': %s.\n", ErrMsg[E_CANTACCESS], InitialFile, strerror(errno));
exit(1);
exit(EXIT_FAILURE);
}
r=IncludeFile(InitialFile);
if (r) {
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING],
InitialFile, ErrMsg[r]);
exit(1);
exit(EXIT_FAILURE);
}
while(1) {
@@ -202,7 +196,7 @@ static void DoReminders(void)
if (r == E_EOF) return;
if (r) {
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
exit(1);
exit(EXIT_FAILURE);
}
s = FindInitialToken(&tok, CurLine);
@@ -755,17 +749,30 @@ int PushToken(char const *tok, ParsePtr p)
/***************************************************************/
long SystemTime(int realtime)
{
time_t tloc;
time_t now;
struct tm *t;
if (!realtime && (SysTime != -1L)) return SysTime;
(void) time(&tloc);
t = localtime(&tloc);
now = time(NULL);
t = localtime(&now);
return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
(long) t->tm_sec;
}
/***************************************************************/
/* */
/* MinutesPastMidnight */
/* */
/* Return the system time in minutes past midnight */
/* */
/***************************************************************/
int MinutesPastMidnight(int realtime)
{
return (int) (SystemTime(realtime) / 60);
}
/***************************************************************/
/* */
/* SystemDate */
@@ -777,11 +784,11 @@ long SystemTime(int realtime)
/***************************************************************/
int SystemDate(int *y, int *m, int *d)
{
time_t tloc;
time_t now;
struct tm *t;
(void) time(&tloc);
t = localtime(&tloc);
now = time(NULL);
t = localtime(&now);
*d = t->tm_mday;
*m = t->tm_mon;

View File

@@ -377,8 +377,12 @@ int DoOmit(ParsePtr p)
break;
default:
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
DBufValue(&buf));
if (tok.type == T_Until) {
Eprint("OMIT: UNTIL not allowed; did you mean THROUGH?");
} else {
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
DBufValue(&buf));
}
DBufFree(&buf);
return E_UNKNOWN_TOKEN;
}

View File

@@ -72,6 +72,7 @@ void CreateParser (char const *s, ParsePtr p);
void DestroyParser (ParsePtr p);
int PushToken (char const *tok, ParsePtr p);
long SystemTime (int realtime);
int MinutesPastMidnight (int realtime);
int SystemDate (int *y, int *m, int *d);
int DoIf (ParsePtr p);
int DoElse (ParsePtr p);

View File

@@ -27,6 +27,7 @@
#include <sys/select.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include "types.h"
#include "globals.h"
@@ -79,7 +80,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
trig->noqueue ||
tim->ttime == NO_TIME ||
trig->typ == CAL_TYPE ||
tim->ttime < SystemTime(0) / 60 ||
tim->ttime < MinutesPastMidnight(0) ||
((trig->typ == RUN_TYPE) && RunDisabled)) return OK;
qelem = NEW(QueuedRem);
@@ -110,6 +111,36 @@ int QueueReminder(ParsePtr p, Trigger *trig,
return OK;
}
static void
maybe_close(int fd)
{
int new_fd;
/* Don't close descriptors connected to a TTY, except for stdin */
if (fd && isatty(fd)) return;
(void) close(fd);
if (fd != STDIN_FILENO) {
new_fd = open("/dev/null", O_WRONLY);
} else {
new_fd = open("/dev/null", O_RDONLY);
}
/* If the open failed... well... not much we can do */
if (new_fd < 0) return;
/* If we got back the same fd as what we just closed, aces! */
if (fd == new_fd) return;
(void) dup2(new_fd, fd);
(void) close(new_fd);
}
void
SigContHandler(int d)
{
UNUSED(d);
}
/***************************************************************/
/* */
/* HandleQueuedReminders */
@@ -143,9 +174,10 @@ void HandleQueuedReminders(void)
* processed correctly are RUN commands, provided they mail
* the result back or use their own resource (as a window).
*/
if (!DontFork && (!isatty(1) || !isatty(2))) {
close(1);
close(2);
if (!DontFork) {
maybe_close(STDIN_FILENO);
maybe_close(STDOUT_FILENO);
maybe_close(STDERR_FILENO);
}
/* If we're a daemon, get the mod time of initial file */
@@ -160,7 +192,7 @@ void HandleQueuedReminders(void)
/* Initialize the queue - initialize all the entries time of issue */
while (q) {
q->tt.nexttime = (int) (SystemTime(1)/60 - 1);
q->tt.nexttime = MinutesPastMidnight(1) - 1;
q->tt.nexttime = CalculateNextTime(q);
q = q->next;
}
@@ -169,6 +201,8 @@ void HandleQueuedReminders(void)
sa.sa_handler = SigIntHandler;
sa.sa_flags = 0;
(void) sigaction(SIGINT, &sa, NULL);
sa.sa_handler = SigContHandler;
(void) sigaction(SIGCONT, &sa, NULL);
}
/* Sit in a loop, issuing reminders when necessary */
@@ -222,7 +256,7 @@ void HandleQueuedReminders(void)
if (!Daemon) {
int y, m, d;
if (RealToday != SystemDate(&y, &m, &d)) {
exit(0);
exit(EXIT_SUCCESS);
}
}
@@ -244,10 +278,12 @@ void HandleQueuedReminders(void)
/* Do NOT trigger the reminder if tt.nexttime is more than a
minute in the past. This can happen if the clock is
changed or a laptop awakes from hibernation.
However, DO trigger if tt.nexttime == tt.ttime so all
However, DO trigger if tt.nexttime == tt.ttime and we're
within MaxLateTrigger minutes so all
queued reminders are triggered at least once. */
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
(q->tt.nexttime == q->tt.ttime)) {
(q->tt.nexttime == q->tt.ttime &&
(MaxLateMinutes == 0 || SystemTime(1) - (q->tt.nexttime * 60) <= 60 * MaxLateMinutes))) {
/* Trigger the reminder */
CreateParser(q->text, &p);
trig.typ = q->typ;
@@ -256,7 +292,7 @@ void HandleQueuedReminders(void)
if (Daemon < 0) {
printf("NOTE reminder %s",
SimpleTime(q->tt.ttime));
printf("%s", SimpleTime(SystemTime(1)/60));
printf("%s", SimpleTime(MinutesPastMidnight(1)));
if (!*DBufValue(&q->tags)) {
printf("*\n");
} else {
@@ -277,8 +313,17 @@ void HandleQueuedReminders(void)
/* Calculate the next trigger time */
q->tt.nexttime = CalculateNextTime(q);
/* If trigger time is way in the past because computer has been
suspended or hibernated, remove from queue */
if (q->tt.nexttime != NO_TIME) {
if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes &&
q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) {
q->tt.nexttime = NO_TIME;
}
}
}
exit(0);
exit(EXIT_SUCCESS);
}
@@ -566,16 +611,16 @@ static void DaemonWait(struct timeval *sleep_tv)
/* If EOF on stdin, exit */
if (feof(stdin)) {
exit(0);
exit(EXIT_SUCCESS);
}
/* Read a line from stdin and interpret it */
if (!fgets(cmdLine, sizeof(cmdLine), stdin)) {
exit(0);
exit(EXIT_SUCCESS);
}
if (!strcmp(cmdLine, "EXIT\n")) {
exit(0);
exit(EXIT_SUCCESS);
} else if (!strcmp(cmdLine, "STATUS\n")) {
int nqueued = 0;
QueuedRem *q = QueueHead;

View File

@@ -186,19 +186,19 @@ JSONToCalEntry(DynamicBuffer *buf)
val = json_parse(DBufValue(buf), DBufLen(buf));
if (!val) {
fprintf(stderr, "Unable to parse JSON line `%s'\n", DBufValue(buf));
exit(1);
exit(EXIT_FAILURE);
}
if (val->type != json_object) {
fprintf(stderr, "Expecting JSON object; found `%s'\n",
DBufValue(buf));
exit(1);
exit(EXIT_FAILURE);
}
c = NEW(CalEntry);
if (!c) {
fprintf(stderr, "malloc failed - aborting.\n");
exit(1);
exit(EXIT_FAILURE);
}
c->next = NULL;
c->special = SPECIAL_NORMAL;
@@ -221,7 +221,7 @@ JSONToCalEntry(DynamicBuffer *buf)
c->entry = malloc(strlen(s)+1);
if (!c->entry) {
fprintf(stderr, "malloc failed - aborting.\n");
exit(1);
exit(EXIT_FAILURE);
}
strcpy(c->entry, s);
got_body = 1;
@@ -253,7 +253,7 @@ JSONToCalEntry(DynamicBuffer *buf)
if (!got_body || !got_date) {
fprintf(stderr, "Could not parse line `%s'\n", DBufValue(buf));
exit(1);
exit(EXIT_FAILURE);
}
return c;
}
@@ -272,7 +272,7 @@ TextToCalEntry(DynamicBuffer *buf)
CalEntry *c = NEW(CalEntry);
if (!c) {
fprintf(stderr, "malloc failed - aborting.\n");
exit(1);
exit(EXIT_FAILURE);
}
c->next = NULL;
c->special = SPECIAL_NORMAL;
@@ -296,7 +296,7 @@ TextToCalEntry(DynamicBuffer *buf)
c->entry = malloc(strlen(startOfBody) + 1);
if (!c->entry) {
fprintf(stderr, "malloc failed - aborting.\n");
exit(1);
exit(EXIT_FAILURE);
}
strcpy(c->entry, startOfBody);
@@ -343,7 +343,7 @@ int main(int argc, char *argv[])
DBufGets(&buf, stdin);
if (first_line && (!strcmp(DBufValue(&buf), "["))) {
fprintf(stderr, "Rem2PS: It appears that you have invoked Remind with the -ppp option.\n Please use either -p or -pp, but not -ppp.\n");
exit(1);
exit(EXIT_FAILURE);
}
first_line = 0;
if (!strcmp(DBufValue(&buf), PSBEGIN) ||
@@ -361,7 +361,7 @@ int main(int argc, char *argv[])
if (!validfile) {
fprintf(stderr, "Rem2PS: Couldn't find any calendar data - are you\n");
fprintf(stderr, " sure you fed me input produced by remind -p ...?\n");
exit(1);
exit(EXIT_FAILURE);
}
printf("%%%%Trailer\n");
printf("%%%%Pages: %d\n", validfile);
@@ -486,7 +486,7 @@ void DoPsCal(void)
while(1) {
if (feof(stdin)) {
fprintf(stderr, "Input from REMIND is corrupt!\n");
exit(1);
exit(EXIT_FAILURE);
}
DBufGets(&buf, stdin);
@@ -952,7 +952,7 @@ void Init(int argc, char *argv[])
fprintf(stderr, " WxHin Specify size in inches (W and H are decimal numbers)\n");
fprintf(stderr, " WxHcm Specify size in centimetres (W and H are decimal numbers)\n");
fprintf(stderr, "Default media type is %s\n", DefaultPage[0].name);
exit(1);
exit(EXIT_FAILURE);
}
break;
@@ -1033,7 +1033,7 @@ void Usage(char const *s)
fprintf(stderr, "-e Make calendar fill entire page\n");
fprintf(stderr, "-x Put day numbers on left instead of right\n");
fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
exit(1);
exit(EXIT_FAILURE);
}
/***************************************************************/

View File

@@ -792,7 +792,7 @@ static SysVar SysVarArr[] = {
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440 },
{"DeltaOffset", 0, INT_TYPE, &DeltaOffset, 0, 0 },
{"DeltaOverride", 0, INT_TYPE, &DeltaOverride, 0, 0 },
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
@@ -825,6 +825,7 @@ static SysVar SysVarArr[] = {
{"LongMin", 1, SPECIAL_TYPE, longmin_func, 0, 0 },
{"LongSec", 1, SPECIAL_TYPE, longsec_func, 0, 0 },
{"March", 1, STR_TYPE, &DynamicMonthName[2], 0, 0 },
{"MaxLateMinutes", 1, INT_TYPE, &MaxLateMinutes, 0, 1440 },
{"MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY },
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY },
{"May", 1, STR_TYPE, &DynamicMonthName[4], 0, 0 },
@@ -839,6 +840,7 @@ static SysVar SysVarArr[] = {
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
{"ParseUntriggered", 1, INT_TYPE, &ParseUntriggered, 0, 1 },
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },

View File

@@ -408,6 +408,18 @@ TZ=Europe/Berlin ../src/remind -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
# Test that banner is printed on every iteration
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
# Test the -tn option
echo "REM May 23 +10 MSG Orange %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 23 +10 MSG Quux %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 23 +10 MSG Cabbage %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 23 MSG Banana %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 23 MSG Carrot %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 23 MSG Apple %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
# Test the -tz option
echo "REM May 22 +10 MSG Foo %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
echo "REM May 22 +10 MSG Bar %b" | ../src/remind -tz - 2023-05-21 >> ../tests/test.out 2>&1
# World-writable file
rm -rf include_dir/ww
touch include_dir/ww
@@ -425,6 +437,9 @@ rm -rf include_dir/ww
# 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

File diff suppressed because it is too large Load Diff

View File

@@ -482,7 +482,7 @@ msg [$December]%
msg [$DefaultColor]%
msg [$DefaultPrio]%
msg [$DefaultTDelta]%
msg [$DeltaOffset]%
msg [$DeltaOverride]%
msg [$DontFork]%
msg [$DontQueue]%
msg [$DontTrigAts]%
@@ -881,6 +881,12 @@ set a htmlstriptags("This is <unclosed whut?")
set a htmlstriptags("this is > whut <b>foo</b>")
set a htmlstriptags("<img src=\"foo\">")
# $ParseUntriggered
REM 2 Jan 1990 MSG ["bad_expr" * 2]
SET $ParseUntriggered 0
REM 2 Jan 1990 MSG ["bad_expr" * 2]
SET $ParseUntriggered 1
# Don't want Remind to queue reminders
EXIT

View File

@@ -26,6 +26,25 @@ REM 12 AUG SPECIAL MOON 0
# Test nonomitted
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
REM MSG [nonomitted('2007-08-28', '2007-08-01', 7)]
PUSH-OMIT-CONTEXT
OMIT 2007-08-15
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
REM MSG [nonomitted('2007-08-01', '2007-08-28', 7)]
POP-OMIT-CONTEXT
# Test slide
REM MSG [slide('2007-08-03', 4)]
REM MSG [slide('2007-08-03', 4, 7)]
PUSH-OMIT-CONTEXT
OMIT 2007-08-17
REM MSG [slide('2007-08-03', 4, 7)]
POP-OMIT-CONTEXT
# Test SPECIAL COLOR with an AT clause
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!