mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
861d268448 | ||
|
|
02cf32c739 | ||
|
|
1f960039a1 | ||
|
|
dcf55e0fba | ||
|
|
aa8f5a9731 | ||
|
|
de03d0c02a | ||
|
|
3e6e3b6a34 | ||
|
|
bf48e31335 | ||
|
|
77c0beffb3 | ||
|
|
9a724d7618 | ||
|
|
1c20f54edb | ||
|
|
52b36d4503 | ||
|
|
0a82eadea6 | ||
|
|
0cd4fe67d1 | ||
|
|
9c31004b62 | ||
|
|
3431833be2 | ||
|
|
a98a4b9f72 | ||
|
|
4aaba4da88 | ||
|
|
98e37d8c54 | ||
|
|
4335aac7b2 |
19
README.md
19
README.md
@@ -95,16 +95,9 @@ though I suspect it's entirely or almost entirely human-written.
|
||||
2. No AI-generated patches or other sorts of contributions to Remind
|
||||
will be accepted.
|
||||
|
||||
3. Remind's source code may not be used to train an AI model,
|
||||
including an LLM model, unless all of the output of said model is
|
||||
released under the GNU General Public License, version 2. If you use
|
||||
any of Remind's source code to train your model, then anything that
|
||||
the model produces is a derived product of Remind and must be licensed
|
||||
under the same terms as Remind.
|
||||
|
||||
---
|
||||
|
||||
Contact info: dianne@skoll.ca
|
||||
|
||||
Home page: [https://dianne.skoll.ca/projects/remind/](https://dianne.skoll.ca/projects/remind/)
|
||||
|
||||
3. It is not yet settled whether, if you train an AI model on this
|
||||
source code, the resulting model, and/or any outputs it produces, are
|
||||
derivative works of the code. But if they are, and do not fall under
|
||||
"fair use" or equivalent in your jurisdiction, then as with any other
|
||||
derivative work you may only distribute them under the terms of the
|
||||
GNU General Public License, version 2.
|
||||
40
april-fools-announcements/2026-april-fool-announcement.txt
Normal file
40
april-fools-announcements/2026-april-fool-announcement.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
Hi, all,
|
||||
|
||||
As you know, Remind has been around for a long time---over 36 years.
|
||||
It's written in C, and I think it's high time to rewrite it in a
|
||||
memory-safe language. After all, one CVE in 36 years is simply
|
||||
unacceptable.
|
||||
|
||||
I was looking at writing it in Rust, but decided that Rust isn't quite
|
||||
mature enough yet. So I decided to do it in FORTAN-77. I chose
|
||||
FORTRAN-77 over the more obvious choice of COBOL because I studied
|
||||
engineering and not business.
|
||||
|
||||
The rewrite will have the following implications:
|
||||
|
||||
o Remind will henceforth be known as REMIND.
|
||||
|
||||
o Sadly, I have to drop UTF-8 support. Your choices are ASCII or
|
||||
EBCDIC.
|
||||
|
||||
o All statements must begin in column 7. That means you might need to
|
||||
edit your existing scripts to add 6 spaces at the beginning of the
|
||||
line.
|
||||
|
||||
o Variables whose names begin with "I" through "N" can only hold INTs.
|
||||
|
||||
o I will be setting up a store on my web site to sell punched cards.
|
||||
(Yes; those will be needed to run REMIND.)
|
||||
|
||||
Now, I confess I haven't programmed in FORTRAN-77 in several decades,
|
||||
so I plan on using AI to assist me. After all, it has been trained on
|
||||
the mountains of open-source FORTRAN-77 code on the Internet.
|
||||
|
||||
I anticipate the rewrite will take about 9 years. You can use this
|
||||
reminder to alert yourself to when it's ready:
|
||||
|
||||
REM 1 APRIL 2035 MSG REMIND IN FORTRAN-77 READY. STOP.
|
||||
|
||||
Regards,
|
||||
|
||||
Dianne.
|
||||
18
configure
vendored
18
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.72 for remind 06.02.04.
|
||||
# Generated by GNU Autoconf 2.72 for remind 06.02.05.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
|
||||
@@ -601,8 +601,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='remind'
|
||||
PACKAGE_TARNAME='remind'
|
||||
PACKAGE_VERSION='06.02.04'
|
||||
PACKAGE_STRING='remind 06.02.04'
|
||||
PACKAGE_VERSION='06.02.05'
|
||||
PACKAGE_STRING='remind 06.02.05'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
|
||||
|
||||
@@ -1258,7 +1258,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
'configure' configures remind 06.02.04 to adapt to many kinds of systems.
|
||||
'configure' configures remind 06.02.05 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1320,7 +1320,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of remind 06.02.04:";;
|
||||
short | recursive ) echo "Configuration of remind 06.02.05:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1408,7 +1408,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
remind configure 06.02.04
|
||||
remind configure 06.02.05
|
||||
generated by GNU Autoconf 2.72
|
||||
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
@@ -1871,7 +1871,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by remind $as_me 06.02.04, which was
|
||||
It was created by remind $as_me 06.02.05, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
@@ -4892,7 +4892,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by remind $as_me 06.02.04, which was
|
||||
This file was extended by remind $as_me 06.02.05, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -4957,7 +4957,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
remind config.status 06.02.04
|
||||
remind config.status 06.02.05
|
||||
configured by $0, generated by GNU Autoconf 2.72,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(remind, 06.02.04, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_INIT(remind, 06.02.05, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_CONFIG_SRCDIR([src/queue.c])
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* VERSION 06.02.05 - 2026-03-02
|
||||
|
||||
- NEW FEATURE: rem2pdf: Add --avoid-overfull option. This makes the
|
||||
font size in a calendar box with many reminders smaller in an effort
|
||||
to fit everything neatly into the box.
|
||||
|
||||
- NEW FEATURE: rem2pdf: Add --entry-spacing option. This lets you
|
||||
adjust the spacing between entries in a calendar box. It defaults
|
||||
to one-half of the --border-size option. NOTE: In previous
|
||||
releases, --entry-spacing defaulted to the SAME size as
|
||||
--border-size, so unless you supply an --entry-spacing value to set
|
||||
it back, the PDF calendars produced by this version of rem2pdf will
|
||||
be slightly more compact than previous versions.
|
||||
|
||||
- DOCUMENTATION UPDATE: Clarify rules around use of Remind source code
|
||||
for training AI models.
|
||||
|
||||
- FIX: include/holidays/nz.rem: Fix spelling of "Auckland" and add
|
||||
Matariki. Fixes courtesy of Bart Joy.
|
||||
|
||||
* VERSION 06.02.04 - 2026-02-15
|
||||
|
||||
- IMPROVEMENT: remind: Add the mblower and mbupper functions, which are
|
||||
|
||||
@@ -34,3 +34,36 @@ REM 27 December ADDOMIT SCANFROM -28 SATISFY [wkdaynum($T-2) == 0] MSG %"Christm
|
||||
REM 27 December ADDOMIT SCANFROM -28 SATISFY [wkdaynum($T-2) == 6] MSG %"Christmas Day (observed)%" %! %b.
|
||||
REM 28 December ADDOMIT SCANFROM -28 SATISFY [wkdaynum($T-2) == 0] MSG %"Boxing Day (observed)%" %! %b.
|
||||
REM 28 December ADDOMIT SCANFROM -28 SATISFY [wkdaynum($T-2) == 6] MSG %"Boxing Day (observed)%" %! %b.
|
||||
|
||||
# Matariki. Source:
|
||||
# https://www.legislation.govt.nz/act/public/2022/0014/23.0/LMS557893.html#LMS557893
|
||||
OMIT 2022-06-24 MSG Matariki
|
||||
OMIT 2023-07-14 MSG Matariki
|
||||
OMIT 2024-06-28 MSG Matariki
|
||||
OMIT 2025-06-20 MSG Matariki
|
||||
OMIT 2026-07-10 MSG Matariki
|
||||
OMIT 2027-06-25 MSG Matariki
|
||||
OMIT 2028-07-14 MSG Matariki
|
||||
OMIT 2029-07-06 MSG Matariki
|
||||
OMIT 2030-06-21 MSG Matariki
|
||||
OMIT 2031-07-11 MSG Matariki
|
||||
OMIT 2032-07-02 MSG Matariki
|
||||
OMIT 2033-06-24 MSG Matariki
|
||||
OMIT 2034-07-07 MSG Matariki
|
||||
OMIT 2035-06-29 MSG Matariki
|
||||
OMIT 2036-07-18 MSG Matariki
|
||||
OMIT 2037-07-10 MSG Matariki
|
||||
OMIT 2038-06-25 MSG Matariki
|
||||
OMIT 2039-07-15 MSG Matariki
|
||||
OMIT 2040-07-06 MSG Matariki
|
||||
OMIT 2041-07-19 MSG Matariki
|
||||
OMIT 2042-07-11 MSG Matariki
|
||||
OMIT 2043-07-03 MSG Matariki
|
||||
OMIT 2044-06-24 MSG Matariki
|
||||
OMIT 2045-07-07 MSG Matariki
|
||||
OMIT 2046-06-29 MSG Matariki
|
||||
OMIT 2047-07-19 MSG Matariki
|
||||
OMIT 2048-07-03 MSG Matariki
|
||||
OMIT 2049-06-25 MSG Matariki
|
||||
OMIT 2050-07-15 MSG Matariki
|
||||
OMIT 2051-06-30 MSG Matariki
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
# If you want the national holidays as well, you must
|
||||
# also SYSINCLUDE holidays/nz.rem
|
||||
|
||||
REM Monday 26 January ADDOMIT SCANFROM -28 MSG %"Aukland Anniversary Day%" %! %b.
|
||||
REM Monday 26 January ADDOMIT SCANFROM -28 MSG %"Auckland Anniversary Day%" %! %b.
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
# If you want the national holidays as well, you must
|
||||
# also SYSINCLUDE holidays/nz.rem
|
||||
|
||||
REM Monday 26 January ADDOMIT SCANFROM -28 MSG %"Aukland Anniversary Day%" %! %b.
|
||||
REM Monday 26 January ADDOMIT SCANFROM -28 MSG %"Auckland Anniversary Day%" %! %b.
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
.TH REMIND 1 "@RELEASE_DATE@" "Remind" "VERSION @VERSION@"
|
||||
.SH NAME
|
||||
remind \- a sophisticated reminder service
|
||||
.SH THE BOOK OF REMIND
|
||||
This man page is a good \fIreference\fR for Remind. However, if you
|
||||
are a novice wishing to \fIlearn\fR Remind, I suggest downloading
|
||||
"The Book of Remind" from the Remind home page at https://dianne.skoll.ca/projects/remind/
|
||||
.SH SYNOPSIS
|
||||
.B remind [\fIoptions\fR] \fIfilename\fR [\fIdate\fR] [\fI*rep\fR] [\fItime\fR]
|
||||
.SH DESCRIPTION
|
||||
@@ -511,10 +515,12 @@ In other words, \fB\-i\fIvar\fR is exactly the same as \fB\-i\fIvar\fR\fB=\fR0.
|
||||
Allows you to define a function on the command line.
|
||||
.PP
|
||||
If you supply a \fIdate\fR on the command line, it must consist of
|
||||
\fIday month year\fR, where \fIday\fR is the day of the month,
|
||||
[\fIday\fR] \fImonth\fR [\fIyear\fR], where \fIday\fR is the day of the month,
|
||||
\fImonth\fR is at least the first three letters of the English name
|
||||
of the month, and \fIyear\fR is a year (all 4 digits) from 1990 to
|
||||
about 2075. You can leave out the \fIday\fR, which then defaults to 1.
|
||||
If you leave out the year, then it defaults to the current year. You
|
||||
cannot leave out the \fImonth\fR.
|
||||
.PP
|
||||
If you do supply a \fIdate\fR on the command line, then \fBRemind\fR
|
||||
uses it, rather than the actual system date, as its notion of "today."
|
||||
|
||||
@@ -195,6 +195,12 @@ Select the appropriate paper size and orientation. Activate
|
||||
be the normal case unless you have many reminders in a particular
|
||||
day. (See the \fBrem2pdf\fR documentation.)
|
||||
|
||||
If you activate \fBAvoid over-full boxes\fR, then \fBTkRemind\fR
|
||||
will pass the \fB\-\-avoid\-overfull\fR option to \fBrem2pdf\fR. This
|
||||
will make it try to fit many reminders into a calendar box by shrinking
|
||||
the font. This option, if activated, also automatically activates
|
||||
\fBFill page\fR.
|
||||
|
||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel. Note
|
||||
that during printing, \fBRemind\fR is called with the
|
||||
\fB-itkremind=1\fR option and also an additional \fB-itkprint=1\fR
|
||||
|
||||
@@ -42,7 +42,7 @@ my $settings = {
|
||||
media => 'Letter',
|
||||
width => 0,
|
||||
height => 0,
|
||||
|
||||
avoid_overfull_boxes => 0,
|
||||
title_font => 'Sans',
|
||||
header_font => 'Sans',
|
||||
daynum_font => 'Sans Bold Oblique',
|
||||
@@ -56,6 +56,7 @@ my $settings = {
|
||||
entry_size => 8,
|
||||
|
||||
border_size => 4,
|
||||
entry_spacing => -1,
|
||||
line_thickness => 1,
|
||||
|
||||
margin_top => 36,
|
||||
@@ -96,6 +97,7 @@ Options:
|
||||
--ps Output PostScript instead of PDF
|
||||
--eps Output encapsulated PostScript instead of PDF
|
||||
-cN Synonym for --small-calendars=N
|
||||
--avoid-overfull Shrink font size to avoid over-full boxes. Implies -e
|
||||
--left-numbers, -x Print day numbers on the left (monthly calendars only)
|
||||
--fill-page, -e Fill the entire page (monthly calendars only)
|
||||
--media=MEDIA, -mMEDIA Size for specified media
|
||||
@@ -112,6 +114,7 @@ Options:
|
||||
--header-size=S Specify size of font for weekday names
|
||||
--daynum-size=S Specify size of font for day numbers
|
||||
--entry-size=S Specify size of font for calendar entries
|
||||
--entry-spacing=S Specify extra spacing between calendar entries
|
||||
--border-size=S Specify size of gaps between items in 1/72nds of an inch
|
||||
--line-thickness=S Specify line thickness in 1/72nds of an inch
|
||||
--margin-top=S Specify top margin size in 1/72nds of an inch
|
||||
@@ -139,6 +142,7 @@ my $ret = GetOptions('landscape|l' => \$settings->{landscape},
|
||||
'svg' => \$settings->{svg},
|
||||
'ps' => \$settings->{ps},
|
||||
'eps' => \$settings->{eps},
|
||||
'avoid-overfull' => \$settings->{avoid_overfull_boxes},
|
||||
'fill-page|e' => \$settings->{fill_entire_page},
|
||||
'weeks-per-page|p=i' => \$settings->{weeks_per_page},
|
||||
'media|m=s' => \$settings->{media},
|
||||
@@ -155,6 +159,7 @@ my $ret = GetOptions('landscape|l' => \$settings->{landscape},
|
||||
'header-size=f' => \$settings->{header_size},
|
||||
'daynum-size=f' => \$settings->{daynum_size},
|
||||
'entry-size=f' => \$settings->{entry_size},
|
||||
'entry-spacing=f' => \$settings->{entry_spacing},
|
||||
'border-size=f' => \$settings->{border_size},
|
||||
'line-thickness=f' => \$settings->{line_thickness},
|
||||
'margin-top=f' => \$settings->{margin_top},
|
||||
@@ -186,6 +191,15 @@ if ($version) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($settings->{entry_spacing} < 0) {
|
||||
$settings->{entry_spacing} = 0.5 * $settings->{border_size};
|
||||
}
|
||||
|
||||
|
||||
if ($settings->{avoid_overfull_boxes}) {
|
||||
$settings->{fill_entire_page} = 1;
|
||||
}
|
||||
|
||||
my $bad = 0;
|
||||
foreach my $setting (qw(bg_color line_color title_color header_color daynum_color smallcal_color)) {
|
||||
my $c = $settings->{$setting};
|
||||
@@ -288,6 +302,9 @@ if ($settings->{svg}) {
|
||||
$settings->{width}, $settings->{height});
|
||||
}
|
||||
|
||||
# Save original entry size
|
||||
$settings->{original_entry_size} = $settings->{entry_size};
|
||||
|
||||
# set_metadata not available in older versions of Cairo
|
||||
eval { $surface->set_metadata('title', 'Calendar'); };
|
||||
eval { $surface->set_metadata('author', 'Remind (https://dianne.skoll.ca/projects/remind/)'); };
|
||||
@@ -481,6 +498,12 @@ the default top-right.
|
||||
|
||||
Make the calendar fill the available space on the page.
|
||||
|
||||
=item --avoid-overfull
|
||||
|
||||
If a calendar box is going to overflow, try to make the entries fit by
|
||||
decreasing the font size. Using the --avoid-overfull option automatically
|
||||
enables the --fill-page option.
|
||||
|
||||
=item --media=I<media>, -mI<media>
|
||||
|
||||
Specify the paper size (Letter, A4, etc.) For a list of valid media sizes,
|
||||
@@ -549,6 +572,12 @@ Specify the size of the blank border between the contents of a calendar
|
||||
box and the centre of the lines surrounding it, in 1/72ndths of an inch.
|
||||
The default is 4.
|
||||
|
||||
=item --entry-spacing=I<n>
|
||||
|
||||
Specify the amount of extra space, in 1/72ndths of an inch, to leave
|
||||
between calendar entries in a given calendar box. The default is
|
||||
one-half of the --border-size value.
|
||||
|
||||
=item --line-thickness=I<n>
|
||||
|
||||
Specify the thickness of the lines drawn on the calendar. The default is 1.
|
||||
|
||||
@@ -608,7 +608,28 @@ sub draw_row
|
||||
for (my $col=0; $col<7; $col++) {
|
||||
my $day = $self->{daymap}->[$row]->[$col];
|
||||
next if ($day < 1);
|
||||
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
|
||||
if ($settings->{avoid_overfull_boxes}) {
|
||||
my $old_entry_size = $settings->{entry_size};
|
||||
my $old_spacing = $settings->{entry_spacing};
|
||||
my $drawn = 0;
|
||||
while ($settings->{entry_size} >= 2.0) {
|
||||
my $h = $self->draw_day($cr, $settings, $so_far, $day, $col, 0);
|
||||
if ($h <= $height) {
|
||||
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
|
||||
$drawn = 1;
|
||||
last;
|
||||
}
|
||||
$settings->{entry_size} -= 0.125;
|
||||
$settings->{entry_spacing} = $old_spacing * $settings->{entry_size} / $old_entry_size;
|
||||
}
|
||||
if (!$drawn) {
|
||||
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
|
||||
}
|
||||
$settings->{entry_size} = $old_entry_size;
|
||||
$settings->{entry_spacing} = $old_spacing;
|
||||
} else {
|
||||
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
|
||||
}
|
||||
}
|
||||
|
||||
return $so_far + $height + $settings->{border_size} * 2;
|
||||
@@ -717,8 +738,8 @@ sub draw_day
|
||||
next;
|
||||
}
|
||||
if ($done) {
|
||||
$so_far += $settings->{border_size};
|
||||
$entry_height += $settings->{border_size};
|
||||
$so_far += $settings->{entry_spacing};
|
||||
$entry_height += $settings->{entry_spacing};
|
||||
}
|
||||
$done = 1;
|
||||
my $h2 = $entry->render($self, $cr, $settings, $so_far, $day, $col, $height);
|
||||
|
||||
@@ -146,7 +146,7 @@ sub render
|
||||
my $layout = Pango::Cairo::create_layout($cr);
|
||||
|
||||
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
|
||||
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . int(0.75 * $settings->{entry_size}) . 'px');
|
||||
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . int(0.75 * $settings->{original_entry_size}) . 'px');
|
||||
$layout->set_font_description($desc);
|
||||
my ($wid, $h) = $layout->get_pixel_size();
|
||||
|
||||
@@ -197,7 +197,7 @@ sub render
|
||||
my $layout;
|
||||
my $bodywidth = 0;
|
||||
if ($self->{fontsize} <= 0) {
|
||||
$self->{fontsize} = $settings->{entry_size};
|
||||
$self->{fontsize} = $settings->{original_entry_size};
|
||||
}
|
||||
if ($self->{size} <= 0) {
|
||||
$self->{size} = $settings->{daynum_size};
|
||||
|
||||
@@ -342,6 +342,9 @@ set Option(PrintOrient) landscape
|
||||
set OptDescr(PrintFill) "(0/1) If 1, fill entire page when printing"
|
||||
set Option(PrintFill) 1
|
||||
|
||||
set OptDescr(PrintAvoidOverfull) "(0/1) If 1, avoid over-full calendar boxes if possible"
|
||||
set Option(PrintAvoidOverfull) 0
|
||||
|
||||
set OptDescr(WrapCal) "(0/1) If 1, make printed calendars occupy at most 5 rows"
|
||||
set Option(WrapCal) 0
|
||||
|
||||
@@ -1758,7 +1761,8 @@ proc DoPrintHelper {} {
|
||||
radiobutton .p.landscape -text "Landscape" -variable Option(PrintOrient) -value landscape
|
||||
radiobutton .p.portrait -text "Portrait" -variable Option(PrintOrient) -value portrait
|
||||
|
||||
checkbutton .p.fill -text "Fill page" -variable Option(PrintFill)
|
||||
checkbutton .p.fill -text "Fill page" -variable Option(PrintFill) -command PrintFillButtonPressed
|
||||
checkbutton .p.avoid -text "Avoid over-full boxes" -variable Option(PrintAvoidOverfull) -command PrintAvoidOverfullButtonPressed
|
||||
checkbutton .p.wrap -text "Use at most 5 rows" -variable Option(WrapCal)
|
||||
checkbutton .p.right -text "Day numbers at top-right" -variable Option(PrintDaysRight)
|
||||
checkbutton .p.calendars -text "Print small calendars" -variable Option(PrintSmallCalendars)
|
||||
@@ -1770,7 +1774,7 @@ proc DoPrintHelper {} {
|
||||
wm protocol .p WM_DELETE_WINDOW { .p.cancel flash; .p.cancel invoke }
|
||||
pack .p.f1 .p.ff .p.f2 .p.f2a .p.f3 .p.f3a \
|
||||
-side top -fill both -expand 1 -anchor w
|
||||
pack .p.fill .p.wrap .p.right .p.calendars -in .p.f3a \
|
||||
pack .p.fill .p.avoid .p.wrap .p.right .p.calendars -in .p.f3a \
|
||||
-side top -anchor w -fill none -expand 0
|
||||
pack .p.f4 -side top -fill both -expand 1 -anchor w
|
||||
pack .p.f11 .p.f12 -in .p.f1 -side top -fill none -expand 0 -anchor w
|
||||
@@ -1861,6 +1865,9 @@ proc DoPrintHelper {} {
|
||||
append cmd " -e"
|
||||
}
|
||||
|
||||
if {$Option(PrintAvoidOverfull)} {
|
||||
append cmd " --avoid-overfull"
|
||||
}
|
||||
if {!$Option(PrintDaysRight)} {
|
||||
append cmd " -x"
|
||||
}
|
||||
@@ -1883,6 +1890,19 @@ proc DoPrintHelper {} {
|
||||
}
|
||||
}
|
||||
|
||||
proc PrintFillButtonPressed {} {
|
||||
global Option
|
||||
if { ! $Option(PrintFill) && $Option(PrintAvoidOverfull) } {
|
||||
set Option(PrintAvoidOverfull) 0
|
||||
}
|
||||
}
|
||||
|
||||
proc PrintAvoidOverfullButtonPressed {} {
|
||||
global Option
|
||||
if { ! $Option(PrintFill) && $Option(PrintAvoidOverfull) } {
|
||||
set Option(PrintFill) 1
|
||||
}
|
||||
}
|
||||
proc ShowPrintCommand { cmd } {
|
||||
global Option
|
||||
catch { destroy .pc }
|
||||
|
||||
@@ -80,6 +80,8 @@ install: all
|
||||
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
|
||||
done
|
||||
-mkdir -p $(DESTDIR)$(datarootdir)/remind || true
|
||||
# Avoid problems with symlinks under holidays/
|
||||
-rm -rf $(DESTDIR)$(datarootdir)/remind/holidays > /dev/null 2>&1 || true
|
||||
cp -R ../include/* $(DESTDIR)$(datarootdir)/remind
|
||||
chmod -R a+rX $(DESTDIR)$(datarootdir)/remind
|
||||
-mkdir -p $(DESTDIR)$(prefix)/share/pixmaps
|
||||
|
||||
@@ -4727,6 +4727,7 @@ FEvalTrig(func_info *info)
|
||||
return r;
|
||||
}
|
||||
if (trig.tz != NULL && tim.ttime == NO_TIME) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return E_TZ_NO_AT;
|
||||
}
|
||||
@@ -4753,7 +4754,10 @@ FEvalTrig(func_info *info)
|
||||
dse = -1;
|
||||
}
|
||||
DestroyParser(&p);
|
||||
if (r) return r;
|
||||
if (r) {
|
||||
FreeTrig(&trig);
|
||||
return r;
|
||||
}
|
||||
if (dse < 0) {
|
||||
RetVal.type = INT_TYPE;
|
||||
RETVAL = dse;
|
||||
|
||||
103
src/init.c
103
src/init.c
@@ -54,6 +54,8 @@ static int tty_init(int fd);
|
||||
static void tty_raw(int fd);
|
||||
static void tty_reset(int fd);
|
||||
|
||||
static int GetInitDateFromTrigger(char const *s, int *y, int *m, int *d, int *systime);
|
||||
|
||||
static void ProcessLongOption(char const *arg);
|
||||
/***************************************************************
|
||||
*
|
||||
@@ -183,6 +185,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
int x;
|
||||
int dse;
|
||||
int ttyfd;
|
||||
int r;
|
||||
|
||||
/* Make sure remind is not installed set-uid or set-gid */
|
||||
if (getgid() != getegid() ||
|
||||
@@ -740,10 +743,28 @@ void InitRemind(int argc, char const *argv[])
|
||||
if (i < argc) {
|
||||
while (i < argc) {
|
||||
arg = argv[i++];
|
||||
/* If it begins with '@' then it's a trigger spec */
|
||||
if (*arg == '@') {
|
||||
if (m != NO_MON || d != NO_DAY || y != NO_YR || dse != NO_DATE) {
|
||||
Usage();
|
||||
}
|
||||
r = GetInitDateFromTrigger(arg+1, &y, &m, &d, &SysTime);
|
||||
if (r == OK) {
|
||||
if (SysTime != -1) {
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
LocalSysTime = SysTime;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Could not evaluate command-line trigger: %s\n", GetErr(r));
|
||||
Usage();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
FindToken(arg, &tok);
|
||||
switch (tok.type) {
|
||||
case T_Time:
|
||||
if (SysTime != -1L) Usage();
|
||||
if (SysTime != -1) Usage();
|
||||
else {
|
||||
SysTime = (long) tok.val * 60L;
|
||||
LocalSysTime = SysTime;
|
||||
@@ -753,7 +774,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
break;
|
||||
|
||||
case T_DateTime:
|
||||
if (SysTime != -1L) Usage();
|
||||
if (SysTime != -1) Usage();
|
||||
if (m != NO_MON || d != NO_DAY || y != NO_YR || dse != NO_DATE) Usage();
|
||||
SysTime = (tok.val % MINUTES_PER_DAY) * 60;
|
||||
LocalSysTime = SysTime;
|
||||
@@ -806,16 +827,13 @@ void InitRemind(int argc, char const *argv[])
|
||||
if (dse != NO_DATE) {
|
||||
FromDSE(dse, &y, &m, &d);
|
||||
}
|
||||
/* Must supply date in the form: day, mon, yr OR mon, yr */
|
||||
/* Must supply date in the form: day, mon, yr OR mon, yr */
|
||||
if (m != NO_MON || y != NO_YR || d != NO_DAY) {
|
||||
if (m == NO_MON || y == NO_YR) {
|
||||
if (rep == NO_REP) Usage();
|
||||
else if (m != NO_MON || y != NO_YR) Usage();
|
||||
else {
|
||||
m = CurMon;
|
||||
y = CurYear;
|
||||
if (d == NO_DAY) d = CurDay;
|
||||
}
|
||||
if (y == NO_YR) {
|
||||
y = CurYear;
|
||||
}
|
||||
if (m == NO_MON) {
|
||||
Usage();
|
||||
}
|
||||
if (d == NO_DAY) d=1;
|
||||
if (d > DaysInMonth(m, y)) {
|
||||
@@ -1401,3 +1419,66 @@ GetTerminalBackground(void)
|
||||
}
|
||||
return TerminalBackground;
|
||||
}
|
||||
|
||||
static int
|
||||
GetInitDateFromTrigger(char const *s, int *y, int *m, int *d, int *systime)
|
||||
{
|
||||
Parser p;
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
int dse;
|
||||
int r;
|
||||
|
||||
CreateParser(s, &p);
|
||||
r = ParseRem(&p, &trig, &tim);
|
||||
if (r) {
|
||||
DestroyParser(&p);
|
||||
return r;
|
||||
}
|
||||
if (trig.tz != NULL && tim.ttime == NO_TIME) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return E_TZ_NO_AT;
|
||||
}
|
||||
if (trig.typ == SAT_TYPE) {
|
||||
EnterTimezone(trig.tz);
|
||||
r=DoSatRemind(&trig, &tim, &p);
|
||||
ExitTimezone(trig.tz);
|
||||
if (r) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return r;
|
||||
}
|
||||
dse = LastTriggerDate;
|
||||
} else if (trig.typ == NO_TYPE) {
|
||||
EnterTimezone(trig.tz);
|
||||
dse = ComputeTrigger(get_scanfrom(&trig), &trig, &tim, &r, 0);
|
||||
ExitTimezone(trig.tz);
|
||||
} else {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
|
||||
DestroyParser(&p);
|
||||
if (r) {
|
||||
FreeTrig(&trig);
|
||||
return r;
|
||||
}
|
||||
if (dse < 0) {
|
||||
FreeTrig(&trig);
|
||||
return E_CANT_TRIG;
|
||||
}
|
||||
if (dse >= 0) {
|
||||
if (tim.ttime != NO_TIME) {
|
||||
if (*systime != -1) {
|
||||
Usage();
|
||||
}
|
||||
dse=AdjustTriggerForTimeZone(&trig, dse, &tim, 1);
|
||||
*systime = tim.ttime * 60;
|
||||
}
|
||||
FromDSE(dse, y, m, d);
|
||||
}
|
||||
FreeTrig(&trig);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ Makefiles
|
||||
Marczykowski
|
||||
Marek
|
||||
Marinus
|
||||
Matariki
|
||||
MaxFullOmits
|
||||
MaxLateMinutes
|
||||
MaxPartialOmits
|
||||
@@ -757,6 +758,7 @@ noto
|
||||
nqueued
|
||||
nroff
|
||||
num
|
||||
nz
|
||||
ok
|
||||
oktober
|
||||
ol
|
||||
|
||||
@@ -1046,7 +1046,7 @@ set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "06.02.04"
|
||||
version() => "06.02.05"
|
||||
set a059 wkday(today())
|
||||
today() => 1991-02-16
|
||||
wkday(1991-02-16) => "Saturday"
|
||||
@@ -2609,7 +2609,7 @@ a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a007 "1991-02-16"
|
||||
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a008 "11:44"
|
||||
a058 "06.02.04"
|
||||
a058 "06.02.05"
|
||||
a059 "Saturday"
|
||||
a010 12
|
||||
a060 6
|
||||
@@ -5563,8 +5563,8 @@ REM SATISFY ""
|
||||
REM SATISFY [version() > "01.00.00"]
|
||||
../tests/test.rem(1074): SATISFY: expression has no reference to trigdate() or $T...
|
||||
../tests/test.rem(1074): Trig = Saturday, 16 February, 1991
|
||||
version() => "06.02.04"
|
||||
"06.02.04" > "01.00.00" => 1
|
||||
version() => "06.02.05"
|
||||
"06.02.05" > "01.00.00" => 1
|
||||
../tests/test.rem(1074): Trig(satisfied) = Saturday, 16 February, 1991
|
||||
REM SATISFY [max(x, max(x, 1, 2, 3), 4, 5, 6) * 5]
|
||||
../tests/test.rem(1075): SATISFY: expression has no reference to trigdate() or $T...
|
||||
@@ -23831,7 +23831,7 @@ SECURITY: Won't read world-writable file or directory!
|
||||
Error reading include_dir/ww: Can't open file
|
||||
SECURITY: Won't read world-writable file or directory!
|
||||
Error reading include_dir/ww: No files matching *.rem
|
||||
06.02.04
|
||||
06.02.05
|
||||
Enabling test mode: This is meant for the acceptance test.
|
||||
Do not use --test in production.
|
||||
In test mode, the system time is fixed at 2025-01-06@19:00
|
||||
|
||||
Reference in New Issue
Block a user