diff -Nru when-1.1.38/debian/changelog when-1.1.42/debian/changelog --- when-1.1.38/debian/changelog 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/changelog 2021-12-15 09:53:55.000000000 +0000 @@ -1,3 +1,16 @@ +when (1.1.42-1) unstable; urgency=medium + + * Replace home-made GitLab CI with the standard Salsa pipeline + * Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP + * Add debian/watch file to track new upstream releases + * Bump Debhelper compat level to 13 + * Add basic information for debian/upstream/metadata + * Declare compliance with Debian policy 4.6.0 + * Update copyright years for debian/* packaging files + * New upstream version 1.1.42 + + -- Salvatore Bonaccorso Wed, 15 Dec 2021 10:53:55 +0100 + when (1.1.38-2) unstable; urgency=medium * Update .gitlab-ci.yml based on Salsa CI Team's template diff -Nru when-1.1.38/debian/control when-1.1.42/debian/control --- when-1.1.38/debian/control 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/control 2021-12-15 09:53:55.000000000 +0000 @@ -2,9 +2,9 @@ Section: misc Priority: optional Maintainer: Salvatore Bonaccorso -Build-Depends: debhelper-compat (= 12) +Build-Depends: debhelper-compat (= 13) Build-Depends-Indep: perl -Standards-Version: 4.3.0 +Standards-Version: 4.6.0 Homepage: http://www.lightandmatter.com/when/when.html Vcs-Browser: https://salsa.debian.org/carnil/when Vcs-Git: https://salsa.debian.org/carnil/when.git diff -Nru when-1.1.38/debian/copyright when-1.1.42/debian/copyright --- when-1.1.38/debian/copyright 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/copyright 2021-12-15 09:53:55.000000000 +0000 @@ -12,7 +12,7 @@ Files: debian/* Copyright: 2007, 2008, Marcela Tiznado - 2010-2018, Salvatore Bonaccorso + 2010-2021, Salvatore Bonaccorso License: Artistic or GPL-1+ License: Artistic diff -Nru when-1.1.38/debian/.gitlab-ci.yml when-1.1.42/debian/.gitlab-ci.yml --- when-1.1.38/debian/.gitlab-ci.yml 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/.gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -include: https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - -build: - extends: .build-unstable - -reprotest: - extends: .test-reprotest - -lintian: - extends: .test-lintian - -autopkgtest: - extends: .test-autopkgtest - -piuparts: - extends: .test-piuparts diff -Nru when-1.1.38/debian/salsa-ci.yml when-1.1.42/debian/salsa-ci.yml --- when-1.1.38/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/debian/salsa-ci.yml 2021-12-15 09:53:55.000000000 +0000 @@ -0,0 +1,3 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru when-1.1.38/debian/tests/smoke-test when-1.1.42/debian/tests/smoke-test --- when-1.1.38/debian/tests/smoke-test 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/tests/smoke-test 2021-12-15 09:53:55.000000000 +0000 @@ -1,9 +1,9 @@ #!/bin/sh set -e -TEMP=${ADTTMP:-${TMPDIR:-/tmp}} +TEMP=${AUTOPKGTEST_TMP:-${TMPDIR:-/tmp}} TDIR=$(mktemp -d $TEMP/smokeXXXXXX) -export HOME=$ADTTMP +export HOME=$AUTOPKGTEST_TMP # create some configuration needed in home mkdir -p ${HOME}/.when diff -Nru when-1.1.38/debian/upstream/metadata when-1.1.42/debian/upstream/metadata --- when-1.1.38/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/debian/upstream/metadata 2021-12-15 09:53:55.000000000 +0000 @@ -0,0 +1,6 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/bcrowell/when/issues +Bug-Submit: https://github.com/bcrowell/when/issues/new +Repository: https://github.com/bcrowell/when.git +Repository-Browse: https://github.com/bcrowell/when diff -Nru when-1.1.38/debian/watch when-1.1.42/debian/watch --- when-1.1.38/debian/watch 2018-12-28 22:37:27.000000000 +0000 +++ when-1.1.42/debian/watch 2021-12-15 09:53:55.000000000 +0000 @@ -1,4 +1,4 @@ -# Currently there is no possibility to monitor new -# upstream versions of 'when' as the new upstream -# versions are not released as when-$version.tar.gz -# but only as when.tar.gz. +version=4 +opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*@ARCHIVE_EXT@)%@PACKAGE@-$1%" \ +https://github.com/bcrowell/when/tags \ +(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru when-1.1.38/.gitignore when-1.1.42/.gitignore --- when-1.1.38/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/.gitignore 2021-11-05 13:53:17.000000000 +0000 @@ -0,0 +1,3 @@ +AA* +*~ +*.1 diff -Nru when-1.1.38/LICENSE when-1.1.42/LICENSE --- when-1.1.38/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/LICENSE 2021-11-05 13:53:17.000000000 +0000 @@ -0,0 +1,4 @@ +(c) 2003-2013 Benjamin Crowell + +This free software is copyleft licensed under the same terms as Perl, or, +at your option, under version 2 of the GPL license. diff -Nru when-1.1.38/Makefile when-1.1.42/Makefile --- when-1.1.38/Makefile 2018-05-06 19:31:06.000000000 +0000 +++ when-1.1.42/Makefile 2021-11-05 13:53:17.000000000 +0000 @@ -1,6 +1,5 @@ # making a new version: # change version number near top of program -# [doesn't work: change version number in *TWO PLACES* in /home/bcrowell/Documents/web/source/when/when.source] # Update version numbers on web page (no longer made from .source file). # make install (so make test will run the right version) # make test @@ -8,6 +7,9 @@ # ...this fails as of 2018 may 6, apparently because of incompatibility between versions of gpg # make post # git: commit and push +# git tag x.y.z && git push --tags +# In github, do what's described here: https://help.github.com/en/github/administering-a-repository/managing-releases-in-a-repository +# ... packagers for distros seem to want tags and github releases to make things easier for them # Updating manpage doesn't work right, for reasons I don't understand. M4 seems to remember # the previous version of manpage.txt rather than reading it in afresh. To work around this, # need to rename it to something other than manpage.txt, alter the when.source file to refer @@ -46,7 +48,7 @@ install -m 755 temp $(DESTDIR)$(bindir)/when # ... 755=u:rwx,go:rx rm temp - gzip -9 when.1.gz + gzip -n9 when.1.gz - test -d $(DESTDIR)$(MANDIR) || mkdir -p $(DESTDIR)$(MANDIR) install -m 644 when.1.gz $(DESTDIR)$(MANDIR) rm -f when.1.gz @@ -76,7 +78,7 @@ post: when.tar.gz when when.1 cp when.tar.gz $(HOME)/Lightandmatter/when - make_plain_text_manpage.pl >$(HOME)/Documents/web/source/when/manpage.txt + #make_plain_text_manpage.pl >$(HOME)/Documents/web/source/when/manpage.txt # debian stuff fails as of 2018 may 6: #cp when_$(VERSION)-debian-source.tar.gz $(HOME)/Lightandmatter/when #cp when_$(VERSION)-*_all.deb $(HOME)/Lightandmatter/when diff -Nru when-1.1.38/make_plain_text_manpage.pl when-1.1.42/make_plain_text_manpage.pl --- when-1.1.38/make_plain_text_manpage.pl 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/make_plain_text_manpage.pl 2021-11-05 13:53:17.000000000 +0000 @@ -0,0 +1,42 @@ +#!/usr/bin/perl +use strict; + +my $man = `nroff -man when.1`; +$man =~ s/(.)\x{08}./$1/g; +$man =~ s/[^ \w,.\-:;'"()[]{}<>+=|\\`~!?\/@#$%^&*_]//g; + +my $version = `perl when --bare_version`; +$version =~ m/((\d+\.)+\d+)/; +$version = $1; +# ... same logic as in Makefile + +# doesn't actually do version + +print clean_up_text($man); + +#------------------ + +sub clean_up_text { + # gets rid of Mac and Windows curly quotes + # changes crlf to \n, etc. + # converts utf8/Mac/Win m-dashes to --, and n-dashes to - + my $text = shift; + # curly quotes: + $text =~ s/\xe2\x80(\x9c|\x9d)/"/g; # utf8 curly quotes + $text =~ s/\xe2\x80(\x98|\x99)/'/g; # utf8 curly apostrophe/single quotes + $text =~ s/\xef\xa3\xa7/--/g; # utf8 m-dash + $text =~ s/\xe2\x80\x94/--/g; # another type of utf8 m-dash?? + $text =~ s/(\223|\224)/"/g; # octal; Windows curly quotes + $text =~ s/(\221|\222)/'/g; # octal; Windows curly apostrophe/single quotes + $text =~ s/\226/-/g; # Windows n-dash + $text =~ s/\227/--/g; # Windows m-dash + $text =~ s/(\xd2|\xd3)/"/g; # Mac curly quotes + $text =~ s/(\xd4|\xd5)/"/g; # Mac curly apostrophe/single quotes + $text =~ s/\xd0/-/g; # Mac n-dash + $text =~ s/\xd1/--/g; # Mac m-dash + $text =~ s/\xc9/.../g; # Mac ellipsis + $text =~ s/\r\n/\n/g; # crlf -> newline + $text =~ s/\r/\n/g; # cr -> newline + $text =~ s/\342\200\220/-/g; # octal; some goofy version of a hyphen + return $text; +} diff -Nru when-1.1.38/README.md when-1.1.42/README.md --- when-1.1.38/README.md 1970-01-01 00:00:00.000000000 +0000 +++ when-1.1.42/README.md 2021-11-05 13:53:17.000000000 +0000 @@ -0,0 +1,12 @@ +When +==== + +When is an extremely simple personal calendar program, aimed at the Unix geek who wants something minimalistic. It can keep track of things you need to do on particular dates. There are a lot of calendar and "personal information manager" programs out there, so what reasons are there to use When? + +* It's a very short and simple program, so you can easily tinker with it yourself. +* It doesn't depend on any libraries, so it's easy to install. You should be able to install it on any system where Perl is available, even if you don't have privileges for installing libraries. +* Its file format is a simple text file, which you can edit in your favorite editor. + +There is an ubuntu package, which is called when. + +When's web page is http://www.lightandmatter.com/when/when.html . diff -Nru when-1.1.38/when when-1.1.42/when --- when-1.1.38/when 2018-05-06 19:31:06.000000000 +0000 +++ when-1.1.42/when 2021-11-05 13:53:17.000000000 +0000 @@ -3,7 +3,7 @@ #---------------------------------------------------------------- # Version number #---------------------------------------------------------------- -our $version = "1.1.38"; +our $version = "1.1.42"; #---------------------------------------------------------------- # Short documentation @@ -360,7 +360,7 @@ You can combine these commands. For instance, ``when cw'' will print out calendars, and then show you your items for the next week. -For events that occur once a year, such as birthdays and annivesaries, +For events that occur once a year, such as birthdays and anniversaries, you can either use a * in place of the year, * dec 25 , Christmas @@ -419,7 +419,7 @@ =head1 INTERNATIONALIZATION B has at least partial support for Czech, Danish, Dutch, -English, French, German, Greek, Hungarian, Italian, Polish, Romanian, Spanish, and Ukrainian. +English, French, German, Greek, Hungarian, Italian, Polish, Romanian, Spanish, Ukrainian and Portuguese. If B has not been translated into your language, or has only been partially translated, the text that hasn't been translated will be displayed in English. @@ -448,7 +448,7 @@ filter_accents_on_output = 1 -in your ~/.when/preferences file. I'd be interested in hearing from +in your preferences file. I'd be interested in hearing from any users who can suggest a better mechanism for this than attempting to interpret the $TERM variable. @@ -466,7 +466,16 @@ option on the command line, but that's not necessary if your $LANG environment variable is set correctly. -=head1 FORMAT OF THE PREFERENCES FILE +=head1 LOCATION AND FORMAT OF THE PREFERENCES FILE + +Most people will have their preferences file in ~/.when/preferences. +Those who prefer to keep their home directory uncluttered with dotfiles +can use one of the following standard possibilities defined by the XDG standard. +In decreasing order of priority: +${WHEN_CONFIG_HOME}/preferences, +${XDG_CONFIG_HOME}/when/preferences, +$HOME/.config/when/preferences, and $HOME/.when/preferences. + Each line consists of something like this: @@ -630,7 +639,7 @@ B<$HOME>/.when/calendar - The default location for the user's calendar (pointed to by the preferences file) -B<$HOME>/.when/preferences - The user's preferences. +B<$HOME>/.when/preferences - The user's preferences. (See above for alternative locations, which follow the XDG standard.) =head1 BUGS @@ -715,7 +724,9 @@ 'editor'=>'emacs -nw', # editor 'now'=>'', # pretend it's some other day today 'filter_accents_on_output'=>!($ENV{TERM}=~m/(mlterm|xterm)/), - # since most Unix terminals show accented Unicode chars as garbage + # ...since most Unix terminals show accented Unicode chars as garbage. + # Testing with rxvt 2.7.10 shows that this does seem necessary for rxvt; + # see https://github.com/bcrowell/when/pull/10 . 'styled_output'=>1, # Do they want ANSI styling if the output is a TTY? 'styled_output_if_not_tty'=>0, # Do they want ANSI styling if the output isn't a TTY? 'calendar_today_style'=>'bold', # ANSI styling for today's date on the calendar. @@ -889,6 +900,7 @@ 'el'=>'Ιαν Φεβ Μαρ Απρ Μάι Ιούν Ιούλ Αύγ Σεπ Οκτ Νοέ Δεκ', # Greek 'ro'=>'ian feb mar apr mai iun iul aug sep oct noi dec', # Romanian 'uk'=>'Січ Лют Бер Кві Тра Чер Лип Сер Вер Жов Лис Гру', # Ukrainian + 'pt'=>'Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez', #Portuguese ); our %month_name_long = ( @@ -920,6 +932,8 @@ 'ro'=>'ianuarie februarie martie aprilie mai iunie iulie august septembrie octombrie noiembrie decembrie', # Ukrainian 'uk'=>'Січень Лютий Березень Квітень Травень Червень Липень Серпень Вересень Жовтень Листопад Грудень', + #Portuguese + 'pt'=>'Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro', ); our %wday_name = ( @@ -937,6 +951,7 @@ 'el'=>'Κυρ Δευ Τρί Τετ Πέμ Παρ Σάβ', # Greek 'ro'=>'du lu ma mi jo vi sb', # Romanian 'uk'=>'Нд Пн Вт Ср Чт Пт Сб', # Ukrainian + 'pt'=>'Dom Seg Ter Qua Qui Sex Sab', #Portuguese ); #------------------------------------------------------------------------ @@ -1341,6 +1356,42 @@ 'error_running_editor'=>"Помилка при виконанні команди %s, %s. Можливо %s не встановлено?\nВи обрали цю команду у файлі %s.\n", 'describe_julian_day'=>"Дата %s відповідає модифікованому юліанському дню %d.\n", ) + } elsif ($lingo eq 'pt') { #Portuguese + %strings = + ( + 'date_syntax_error'=>"A data %s não está no formato requerido, que é 'y m d', com espaços em branco separando as três partes.", + 'error_opening_prefs'=>"O arquivo de preferências %s existe, mas houve um erro ao abri-lo para entrada.", + 'syntax_err_in_prefs'=>"Erros de sintaxe no arquivo de preferências %s: \n%s", + 'prefs_file_not_found'=>"O arquivo de preferências %s não foi encontrado", + 'illegal_command'=>"Comando ilegal, %s\n", + 'error_opening_calendar'=>"Não foi possível abrir o arquivo %s para entrada", + 'error_prefiltering'=>"Não foi possível executar o pré filtro %s\n", + 'not_utf8'=>"O arquivo %s não parece estar codificado em utf8 (ou ascii, que é um subconjunto do utf8). O utilitário unix, 'file', pode provavelmente dizer o que está codificando isso.\n ", + 'yesterday'=>'ontem', + 'today'=>'hoje', + 'tomorrow'=>'amanhã', + 'syntax_error_in_calendar'=>"Erro de sintaxe no calendário: %s\n", + 'illegal_year'=>"Ano ilegal: %s\n", + 'illegal_month'=>"Mês ilegal: %s\n", + 'illegal_day_of_month'=>"Dia do mês ilegal: %s\n", + 'first_time_not_tty'=>"Para configurar seu calendário, use o comando ``when'' em uma janela interativa de terminal.\n", + 'ask_if_set_up'=>("Você pode agora configurar seu calendário. Isso envolve criar um diretório ~/.when, e fazendo\n". + "alguns arquivos nele. Se você quer fazer isso, digite y e aperte return"), + 'error_creating_dir'=>"Erro ao criar o arquivo %s", + 'ask_for_editor'=>("Você pode editar seu arquivo de calendário usando seu editor favorito. Por favor, entre com o comando que você\n" + ."quer usar para executar seu editor, ou aperte return para aceitar o padrão:\n"), + 'error_creating_prefs'=>"Erro ao criar o arquivo %s\n", + 'error_creating_cal'=>"Erro ao criar o arquivo %s\n", + 'getting_started'=>("Agora você pode adicionar itens para seu arquivo de calendário. Faça ``when --help'' para mais informações.\n"), + 'not_unique_w_match'=>'%s não corresponde um único dia da semana de %s', + 'no_w_match'=>'%s não corresponde com nenhum dia da semana de %s', + 'not_valid_expression'=>'%s não é uma data ou expressão válida', + 'illegal_var'=>'variável ilegal: %s', + 'illegal_month_in_expression'=>'mês ilegal na expressão: %s', + 'expression_syntax_error'=>'erro de sintaxe: %s', + 'error_running_editor'=>"Erro ao executar comando %s, %s. Talvez %s não esteja instalado?\nVocê selecionou esse comando no arquivo %s.\n", + 'describe_julian_day'=>"A data %s corresponde ao sua data juliana modificada %d.\n", + ) } else { # default to English %strings = ( @@ -1397,8 +1448,20 @@ #---------------------------------------------------------------- # Read the preferences file. #---------------------------------------------------------------- -my $dir = glob "~/.when"; -my $prefs_file = glob '~/.when/preferences'; +sub find_config_dir() { + my @locations = (); # follow XDG standard, https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + if ($ENV{WHEN_CONFIG_HOME}) { push @locations,$ENV{WHEN_CONFIG_HOME} } + if ($ENV{XDG_CONFIG_HOME}) { push @locations,"$ENV{XDG_CONFIG_HOME}/when" } + push @locations,glob "~/.config/when"; + push @locations,glob "~/.when"; + foreach my $loc(@locations) { + if (-d $loc) { return $loc } + } + return $locations[-1]; # doesn't exist, but it's the typical location, so return it and expect an error +} + +my $dir = find_config_dir(); +my $prefs_file = glob "$dir/preferences"; our $quickie = 0; our $got_command_line_options = 0; @@ -1637,7 +1700,7 @@ do_output(describe_date()."\n"); } if ($cmd eq 'normal') { - normal_behavior($now,$want_styling); + if (normal_behavior($now,$want_styling)!=0) {exit(-1)}; } if ($cmd eq 'calendar') { calendar(NOW=>$now,WANT_STYLING=>$want_styling,TODAY_STYLE=>$preferences{'calendar_today_style'},PAST=>$preferences{'past'},FUTURE=>$preferences{'future'}); @@ -1670,6 +1733,11 @@ print filter_accents_if_desired($x); } +sub do_output_to_stderr { + my $x = shift; + print STDERR filter_accents_if_desired($x); +} + sub filter_accents_if_desired { my $x = shift; if ($preferences{'filter_accents_on_output'}) { @@ -1755,16 +1823,16 @@ $match = DateMatch->new('exact',$date); if ($match->{ERR} ne '') { my $err = $match->{ERR}; - do_output("****** $err\n****** $line\n\n"); - return; + do_output_to_stderr("****** $err\n****** $line\n\n"); + return -1; } } else { $match = DateMatch->new('condition',$date); if ($match->{ERR}) { my $err = $match->{ERR}; - do_output("****** $err\n****** $line\n\n"); - return; + do_output_to_stderr("****** $err\n****** $line\n\n"); + return -1; } } if ($match->{TYPE} eq 'condition') { @@ -1867,6 +1935,7 @@ } } if (!$did_it) {print $complete_output} + return 0; } #---------------------------------------------------------------- @@ -2013,7 +2082,6 @@ } my $this_month = $when->m; while ($when->m == $this_month) { - if ($when->day_of_week==1) {push @cal,$line; $line = ''} my $display = sprintf('%2d',$when->d); if ($when->compare($today)==0 && $mark_today) { if ($args{WANT_STYLING} && $args{TODAY_STYLE} ne '') { @@ -2025,6 +2093,9 @@ } $line = "$line$display "; $when->increment_day_in_place(); + # The first day of a second and the subsequent weeks in this month + # will be printed on the next line in the calendar + if ($when->day_of_week==1) {push @cal,$line; $line = ''} } if ($line ne '') {push @cal,$line; $line = ''} @@ -2826,8 +2897,9 @@ my @t = ( ["\x{c2}",'A'],["\x{c4}",'A'],["\x{ce}",'I'],["\x{d6}",'O'],["\x{da}",'U'], ["\x{dc}",'U'],["\x{df}",'s'],["\x{e0}",'a'],["\x{e1}",'a'],["\x{e2}",'a'], - ["\x{e4}",'a'],["\x{e9}",'e'],["\x{ea}",'e'],["\x{ed}",'i'],["\x{ee}",'i'],["\x{f1}",'n'], - ["\x{f3}",'o'],["\x{f6}",'o'],["\x{fa}",'u'],["\x{fb}",'u'],["\x{fc}",'u'], + ["\x{e4}",'a'],["\x{e3}",'a'],["\x{e7}",'c'], + ["\x{e9}",'e'],["\x{ea}",'e'],["\x{ed}",'i'],["\x{ee}",'i'],["\x{f1}",'n'], + ["\x{f3}",'o'],["\x{f5}",'e'],["\x{f6}",'o'],["\x{fa}",'u'],["\x{fb}",'u'],["\x{fc}",'u'], ["\x{fd}",'y'],["\x{2011}",'-'],["\x{105}",'a'],["\x{103}",'a'],["\x{102}",'A'], ["\x{107}",'c'],["\x{10d}",'c'],["\x{10c}",'C'],["\x{11b}",'e'],["\x{119}",'e'], ["\x{142}",'l'],["\x{144}",'n'],["\x{159}",'r'],["\x{158}",'r'],["\x{15b}",'s'], diff -Nru when-1.1.38/when.1 when-1.1.42/when.1 --- when-1.1.38/when.1 2018-05-06 19:31:06.000000000 +0000 +++ when-1.1.42/when.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,750 +0,0 @@ -.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -. ds C` -. ds C' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.\" -.\" Avoid warning from groff about undefined register 'F'. -.de IX -.. -.nr rF 0 -.if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{ -. if \nF \{ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. if !\nF==2 \{ -. nr % 0 -. nr F 2 -. \} -. \} -.\} -.rr rF -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "WHEN 1" -.TH WHEN 1 "2018-05-06" "1.1.38" "When 1.1.38" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -When \- a minimalistic personal calendar program -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -when -.PP -when [options] [commands] -.PP -The basic idea is just to type `when' at the command line. The first time -you run the program, it will prompt you for some setup information. To -edit you calendar file in your favorite editor, do `when e'. The basic -format of the calendar file is like this: -.PP -.Vb 1 -\& 2003 feb 3 , Fly to Stockholm to accept Nobel Prize. -.Ve -.PP -Once you have a calendar file, running the program as plain old `when' -from the command line will print out the things on your calendar for the -next two weeks. -.SH "COMMANDS" -.IX Header "COMMANDS" -.IP "\fBi\fR" 8 -.IX Item "i" -Print upcoming items on your calendar. (This is the default command.) -.IP "\fBc\fR" 8 -.IX Item "c" -Print calendars (grids like on a wall calendar, not showing items) -for last month, this month, and next month. -.IP "\fBe\fR" 8 -.IX Item "e" -Invoke your favorite editor to edit your calendar file. -.IP "\fBw\fR,\fBm\fR,\fBy\fR" 8 -.IX Item "w,m,y" -Print items for the coming week, month, or year, rather -than for the default period of two weeks. -.IP "\fBj\fR" 8 -.IX Item "j" -Print the modified Julian day (useful for finding the time interval -between two dates). -.IP "\fBd\fR" 8 -.IX Item "d" -Print nothing but the current date. -.SH "OPTIONS" -.IX Header "OPTIONS" -All of the following options, except \-\-help, can be set in the preferences -file. True/false options can be set on the command line as \-\-option or -\&\-\-nooption, and in the preferences file by setting the option to 0 or 1. -.IP "\-\-help" 8 -.IX Item "--help" -Prints a brief help message. -.IP "\-\-version" 8 -.IX Item "--version" -Prints a brief message, including a statement of what version of the -software it is. -.IP "\-\-language=LANG" 8 -.IX Item "--language=LANG" -Set the language to \s-1LANG.\s0 See the section below on internationalization. -This option is not normally needed, because the language is automatically -detected. -.IP "\-\-future=DAYS" 8 -.IX Item "--future=DAYS" -How many days into the future the report extends. Default: 14 -.IP "\-\-past=DAYS" 8 -.IX Item "--past=DAYS" -How many days into the past the report extends. Like the \-\-future option, -\&\-\-past is interpreted as an offset relative to the present date, so normally -you would want this to be a negative value. Default: \-1 -.IP "\-\-calendar=FILE" 8 -.IX Item "--calendar=FILE" -Your calendar file. The default is to use the file pointed to -by your preferences file, which is set up the first time you -run When. -.IP "\-\-editor=COMMAND" 8 -.IX Item "--editor=COMMAND" -Command used to invoke your editor. Default: \*(L"emacs \-nw\*(R" -Example: when \-\-editor=\*(L"vim\*(R" -.IP "\-\-wrap=COLUMNS" 8 -.IX Item "--wrap=COLUMNS" -Number of columns of text for the output (or 0 if you don't want -wrapping at all). Default: 80 -.IP "\-\-[no]wrap_auto" 8 -.IX Item "--[no]wrap_auto" -Attempt to detect the width of the terminal, and set the width of the output -accordingly. This applies only if the output is a tty, and is subject to any -maximum set by \-\-wrap_max. Overrides any value set by \-\-wrap. Default: no -.IP "\-\-wrap_max=COLUMNS" 8 -.IX Item "--wrap_max=COLUMNS" -Maximum number of columns of text for the output (or \-1 if you don't want -any maximum). Useful in combination with \-\-wrap_auto to preserve legibility -on very large terminal windows. Default: \-1 -.IP "\-\-rows=ROWS" 8 -.IX Item "--rows=ROWS" -Number of rows of text that will fit in the terminal window. -When listing your calendar, output will be truncated to this -length, unless that would result in listing less than three days -into the future. This behavior is overridden (the maximum number -of rows is set to infinity) if the \-\-future option is given -explicitly, or if the m or y command is -used. To make this option have an effect, you will normally need -to use \-\-norows_auto as well. -Default: 40 -.IP "\-\-[no]rows_auto" 8 -.IX Item "--[no]rows_auto" -Attempt to detect the height of the terminal, rather than using the value -set in the \-\-rows option. This applies only if the output is a tty. -Overrides any value set by \-\-rows. Default: yes -.IP "\-\-[no]header" 8 -.IX Item "--[no]header" -Print headers at the top of the output of the i, c, w, m and y commands. -Default: yes -.IP "\-\-[no]paging" 8 -.IX Item "--[no]paging" -When the output is longer than the value set by rows or rows_auto, use -a pager to display the output. (The \s-1PAGER\s0 and \s-1LESS\s0 environment variables -are respected. If \s-1PAGER\s0 isn't set, the default is \*(L"less.\*(R") Default: yes -.IP "\-\-paging_less_options" 8 -.IX Item "--paging_less_options" -Extra options if the pager is \*(L"less.\*(R" Default: \*(L"\-rXFE\*(R" -.IP "\-\-[no]filter_accents_on_output" 8 -.IX Item "--[no]filter_accents_on_output" -Whether to change accented characters to unaccented ones. -Default: yes, unless the \f(CW$TERM\fR environment variable equals \*(L"mlterm\*(R" -or \*(L"xterm\*(R". -.IP "\-\-[no]styled_output" 8 -.IX Item "--[no]styled_output" -If the output is a terminal, should we use \s-1ANSI\s0 terminal codes for -styling? Default: yes -.IP "\-\-[no]styled_output_if_not_tty" 8 -.IX Item "--[no]styled_output_if_not_tty" -Style the output even if it's not a terminal. Default: no -.IP "\-\-calendar_today_style=STYLE" 8 -.IX Item "--calendar_today_style=STYLE" -.PD 0 -.IP "\-\-items_today_style=STYLE" 8 -.IX Item "--items_today_style=STYLE" -.PD -The first of these says how to style today's date when doing the calendar (c) command. -The second says how to style the word ``today'' when doing the items (i) command. -Defaults: bold -.Sp -The styling of output can be specified using the following keywords: -bold, underlined, flashing. -To change the color of the text, use these: -fgblack, fgred, fggreen, fgyellow, fgblue, fgpurple, fgcyan, -fgwhite. -To change the background color, use similar keywords, but with bg instead -of fg. Example: -when \-\-calendar_today_style=\*(L"bold,fgred,bgcyan\*(R" c -.IP "\-\-prefilter" 8 -.IX Item "--prefilter" -Pipe the calendar file through a program before reading it. Default: "" -.ie n .IP "\-\-now=""Y M D""" 8 -.el .IP "\-\-now=``Y M D''" 8 -.IX Item "--now=Y M D" -Pretend today is some other date. -.IP "\-\-[no]neighboring_months" 8 -.IX Item "--[no]neighboring_months" -The default behavior of \*(L"when c\*(R" is to print out calendars for -last month, this month, and next month. By choosing \-\-noneighboring_months, -you can avoid printing out months not included in the range set by -\&\-\-past and \-\-future. -.IP "\-\-[no]monday_first" 8 -.IX Item "--[no]monday_first" -Start the week from Monday, rather than Sunday. Default: no -.IP "\-\-[no]orthodox_easter" 8 -.IX Item "--[no]orthodox_easter" -Calculate Easter according to the Orthodox Eastern Church's calendar. Default: no -.IP "\-\-[no]ampm" 8 -.IX Item "--[no]ampm" -Display the time of day using 12\-hour time, rather than 24\-hour time. Also -affects the parsing of input times. -Default: yes -.IP "\-\-auto_pm=x" 8 -.IX Item "--auto_pm=x" -When times are input with hours that are less than x, and \s-1AM\s0 or \s-1PM\s0 is not explicitly -specified, automatically assume that they are \s-1PM\s0 rather than \s-1AM.\s0 Default: 0 -.IP "\-\-[no]literal_only" 8 -.IX Item "--[no]literal_only" -Only display items that are given as literal dates, e.g., \*(L"2008 jul 4\*(R". Don't -display items that are defined by expressions, e.g., periodic items like -\&\*(L"w=thu\*(R". Default: no -.IP "\-\-test_expression" 8 -.IX Item "--test_expression" -.PD 0 -.IP "\-\-bare_version" 8 -.IX Item "--bare_version" -.IP "\-\-make_filter_regex" 8 -.IX Item "--make_filter_regex" -.IP "\-\-test_accent_filtering" 8 -.IX Item "--test_accent_filtering" -.PD -These options are used internally for building and testing. -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -\&\fBWhen\fR is an extremely simple personal calendar program, aimed at the Unix -geek who wants something minimalistic. It can keep track of things you need to -do on particular dates. There are a lot of calendar and ``personal information -manager'' programs out there, so what reasons are there to use \fBWhen\fR? -.IP "It's a very short and simple program, so you can easily tinker with it yourself." 4 -.IX Item "It's a very short and simple program, so you can easily tinker with it yourself." -.PD 0 -.IP "It doesn't depend on any libraries, so it's easy to install. You should be able to install it on any system where Perl is available, even if you don't have privileges for installing libraries." 4 -.IX Item "It doesn't depend on any libraries, so it's easy to install. You should be able to install it on any system where Perl is available, even if you don't have privileges for installing libraries." -.IP "Its file format is a simple text file, which you can edit in your favorite editor." 4 -.IX Item "Its file format is a simple text file, which you can edit in your favorite editor." -.PD -.PP -Although \fBWhen\fR should run on virtually any operating system where Perl is -available, in this document I'll assume you're running some -flavor of Unix. -.SH "INSTALLATION AND GETTING STARTED" -.IX Header "INSTALLATION AND GETTING STARTED" -While logged in as root, execute the following command: -.PP -.Vb 1 -\& make install -.Ve -.PP -Run \fBWhen\fR for the first time using this command: -.PP -.Vb 1 -\& when -.Ve -.PP -You'll be prompted for some information needed to set up your calendar file. -.SH "USE" -.IX Header "USE" -If you run \fBWhen\fR again after the initial setup run, it should print out a -single line of text, telling you the current date. It won't print out -anything else, because your calendar file is empty, so you don't have -any appointments coming up. -.PP -Now you can start putting items in your calendar file. Each item is a line -of text that looks like this: -.PP -.Vb 1 -\& 2003 feb 3 , Fly to Stockholm to accept Nobel Prize. -.Ve -.PP -A convenient way to edit your calendar file is with this command: -.PP -.Vb 1 -\& when e -.Ve -.PP -This pops you into your favorite editor (the one you chose when you ran -\&\fBWhen\fR for the first time). -.PP -The date has to be in year-month-day format, but you can either spell the -month or give it as a number. (Month names are case-insensitive, and it -doesn't matter if you represent February as F, Fe, Feb, Februa, or whatever. -It just has to be a unique match. You can give a trailing ., which will be -ignored. In Czech, \*(L"cer\*(R" can be used as an abbreviation for Cerven, and \*(L"cec\*(R" for -Cervenec.) Extra whitespace is -ignored until you get into the actual text after the comma. Blank lines -and lines beginning with a # sign are ignored. -.PP -If you now run \fBWhen\fR, it will print out a list of all the items in your -calendar file that fall within a certain time interval. (The interval starts from -yesterday. \fBWhen\fR tries to pick the end of the time interval so that its output -fits on your terminal window, but it will always be at least three days, and -no more than two weeks in the future.) -To see all your items for the next month, do ``when m'', -and similarly for a year, y, or a single week, w. -.PP -If you do ``when c'', \fBWhen\fR prints out calendars for last month, this month, -and next month. -.PP -You can combine these commands. For instance, ``when cw'' will print -out calendars, and then show you your items for the next week. -.PP -For events that occur once a year, such as birthdays and annivesaries, -you can either use a * in place of the year, -.PP -.Vb 1 -\& * dec 25 , Christmas -.Ve -.PP -or use a year with an asterisk: -.PP -.Vb 1 -\& 1920* aug 29 , Charlie Parker turns \ea, born in \ey -.Ve -.PP -In the second example, \ea tells you how old Charlie Parker would be this -year, and \ey reproduces the year he was born, i.e., the output would be: -.PP -.Vb 1 -\& today 2003 Aug 29 Charlie Parker turns 83, born in 1920 -.Ve -.PP -For things you have to do every week, you can use an expression of the -form w=xxx, where xxx is the first few letters of the name of the day -of the week in your language. (You have to supply enough letters to -eliminate ambiguity, e.g., in English, w=th or w=tu, not just w=t.) -Example: -.PP -.Vb 1 -\& w=sun , go to church, 10:00 -.Ve -.PP -You can actually do fancier tests than this as well; for more information, -see the section 'fancy tests' below. -Here's how to set up some common holidays: -.PP -.Vb 10 -\& m=jan & w=mon & a=3 , Martin Luther King Day -\& * feb 14 , Valentine\*(Aqs Day -\& m=feb & w=mon & a=3 , Washington\*(Aqs Birthday observed -\& m=may & w=sun & a=2 , Mother\*(Aqs Day -\& m=may & w=mon & b=1 , Memorial Day -\& m=jun & w=sun & a=3 , Father\*(Aqs Day -\& * jul 4 , Independence Day -\& m=sep & w=mon & a=1 , Labor Day -\& m=oct & w=mon & a=2 , Columbus Day -\& m=oct & w=mon & a=2 , Thanksgiving (Canada) -\& * nov 11 , Armistice Day -\& m=nov & w=thu & a=4 , Thanksgiving (U.S.) -\& e=47 , Mardi Gras -\& e=46 , Ash Wednesday -\& e=7 , Palm Sunday -\& e=0 , Easter Sunday -\& e=0\-49 , Pentecost (49 days after easter) -.Ve -.PP -In the U.S., when certain holidays fall on a weekend, federal workers, as well as many -private employees, get a Monday or Friday off. The full list is given at http://www.opm.gov/operating_status_schedules/fedhol/2011.asp. -If you want a reminder of both the holiday and the day you get off from work, here's an example of how you would set that up: -.PP -.Vb 2 -\& * jul 4 , Independence Day -\& m=jul & c=4 , Independence Day (observed as a federal holiday) -.Ve -.SH "COMMENTS" -.IX Header "COMMENTS" -A line beginning with the # character is taken as a comment, and is ignored. -A line consisting only of whitespace characters is also ignored. -.SH "INTERNATIONALIZATION" -.IX Header "INTERNATIONALIZATION" -\&\fBWhen\fR has at least partial support for Czech, Danish, Dutch, -English, French, German, Greek, Hungarian, Italian, Polish, Romanian, Spanish, and Ukrainian. -If \fBWhen\fR has not been translated into your language, -or has only been partially translated, the text that hasn't been translated -will be displayed in English. -\&\fBWhen\fR should automatically detect what language you use (via your \f(CW$LANG\fR -environment variable), and if \fBWhen\fR has been translated into that language, -that's what you'll get \*(-- \fBWhen\fR's output will be in your language, and -\&\fBWhen\fR will also expect you to use that language in your calendar file -for the names of the months and the days of the week. -.PP -Your calendar file must be in \s-1UTF\-8 \s0(or \s-1ASCII,\s0 which is a subset of \s-1UTF\-8\s0). -If your calendar file is in some other encoding, such as \s-1ISO\-8859, \s0\fBWhen\fR -will typically be able to detect that, and will refuse to read it. -Command-line options can also contain \s-1UTF\-8.\s0 -.PP -Some terminal emulators -(aterm, ...) display accented characters as garbage, -but others (mlterm, xterm...) can display them correctly. -\&\fBWhen\fR checks the \f(CW$TERM\fR environment variable, and if it equals -\&\*(L"mlterm\*(R" or \*(L"xterm\*(R", then accented characters will be displayed. Otherwise, -they are filtered out of the output. -You can override this by putting a line like -.PP -.Vb 1 -\& filter_accents_on_output = 0 -.Ve -.PP -or -.PP -.Vb 1 -\& filter_accents_on_output = 1 -.Ve -.PP -in your ~/.when/preferences file. I'd be interested in hearing from -any users who can suggest a better mechanism for this than attempting to -interpret the \f(CW$TERM\fR variable. -.PP -On input, accents are allowed, but not required, e.g., in a French-language -input file, the date 2005 Fev 17 could be given with an accented e or an -unaccented one, and either will work. If an input month or day of the week does -not match any of the ones for your language, then \fBWhen\fR will try -to interpret it as English instead. -.PP -You can put a line like -.PP -.Vb 1 -\& language = fr -.Ve -.PP -in your preferences file to set your language, or supply the \-\-language -option on the command line, but that's not necessary if your \f(CW$LANG\fR -environment variable is set correctly. -.SH "FORMAT OF THE PREFERENCES FILE" -.IX Header "FORMAT OF THE PREFERENCES FILE" -Each line consists of something like this: -.PP -.Vb 1 -\& variable = value -.Ve -.PP -Whitespace is ignored everywhere except inside the value. Variable names -are case-insensitive. Blank lines are ignored. -.SH "MORE EXAMPLES" -.IX Header "MORE EXAMPLES" -A useful command to have your shell execute when you log in is this: -.PP -.Vb 1 -\& when \-\-past=0 \-\-future=1 -.Ve -.PP -To print out a calendar for a full year to come: -.PP -.Vb 1 -\& when \-\-past=0 \-\-future=365 c -.Ve -.SH "POPPING UP YOUR CALENDAR WHEN YOU LOG IN" -.IX Header "POPPING UP YOUR CALENDAR WHEN YOU LOG IN" -Your calendar doesn't do you any good if you forget to look at it -every day. An easy way to make it pop up when you log in is to -make your .xsession or .xinitrc file look like this: -.PP -.Vb 3 -\& /usr/bin/when \-\-past=0 \-\-future=1 &>~/when.today -\& emacs \-geometry 70x25 \-bg bisque ~/when.today & -\& startkde -.Ve -.PP -The .xsession file is used if you have a graphical login manager -set up on your machine, the .xinitrc if you don't. In this example, -the first line outputs your calendar to a file. The complete path -to the \fBWhen\fR program is given, because your shell's path variable -will not yet be properly initialized when this runs. The second -line pops up a \s-1GUI\s0 emacs window, which is distinctively colored so -that it will catch your eye. The last line starts your window -manager, \s-1KDE\s0 in this example. Whatever window manager you use, -just make sure to retain the preexisting line in the file that starts -it, and make sure that that line is the very last one in the file. -.SH "SORTING BY TIME OF DAY" -.IX Header "SORTING BY TIME OF DAY" -If you want the various items that lie on a single day to be printed out in -a certain order, the simplest way to do it is to put them in that order in the -input file. That method won't work, however, when some of the items lie on dates -that are determined by expressions rather than given explicitly. The most common -reason for wanting to do this kind of thing is that you have things you need to do -at certain times during the day, and you want them sorted out by time. In this situation, -you can give a time at the beginning of the item's text, and \fBWhen\fR will recognize that -and sort the items by time. Times can be in h:mm or hh:mm format. If \-\-ampm is set, -then an optional -suffix a or p can be used for \s-1AM\s0 or \s-1PM,\s0 e.g., 9:30a for 9:30 \s-1AM.\s0 If you use \s-1AM/PM\s0 -time, then you can also, e.g., set \-\-auto_pm=9 so that hours less than 9 are automatically -assumed to be \s-1PM.\s0 Here is an example: -.PP -.Vb 2 -\& 2010 apr 25 , 7:00 dinner at the anarcho\-syndicalist commune -\& w=sun , 10:00 church -.Ve -.PP -April 25, 2010 is a Sunday, so on that date both of these items will be displayed. -If \-\-auto_pm is set to 8 or higher, then the 7:00 will automatically be interpreted -as 7:00 \s-1PM,\s0 and the dinner date will be displayed below the morning church ceremony. -.SH "FANCY TESTS" -.IX Header "FANCY TESTS" -In addition to w, discussed above, there are a bunch of other variables -you can test: -.PP -.Vb 10 -\& w \- day of the week -\& m \- month -\& d \- day of the month -\& y \- year -\& j \- modified Julian day number -\& a \- 1 for the first 7 days of the month, 2 for the next 7, etc. -\& b \- 1 for the last 7 days of the month, 2 for the previous 7, etc. -\& c \- on Monday or Friday, equals the day of the month of the nearest weekend day; otherwise \-1 -\& e \- days until this year\*(Aqs (Western) Easter -\& z \- day of the year (1 on New Year\*(Aqs day) -.Ve -.PP -You can specify months either as numbers, m=2, or as names in your language, m=feb. -You can also use the logical operators & (and) and | (or). The following -example reminds you to pay your employees on the first and fifteenth -day of every month: -.PP -.Vb 1 -\& d=1 | d=15 , Pay employees. -.Ve -.PP -This example reminds you to rehearse with your band on the last Saturday -of every month: -.PP -.Vb 1 -\& w=sat & b=1 , Rehearse with band. -.Ve -.PP -The following two lines -.PP -.Vb 2 -\& * dec 25 , Christmas -\& m=dec & d=25 , Christmas -.Ve -.PP -both do exactly the same thing, but the first version is easier to -understand and makes the program run faster. (When you do a test, \fBWhen\fR -has to run through every day in the range of dates you asked for, -and evaluate the test for each of those days. On my machine, if I -print out a calendar for a whole year, using a file with 10 simple -tests in it, it takes a few seconds.) -Parentheses can be used, too. -.PP -Depending on your nationality and religion, you probably have a bunch -of holidays that don't lie on fixed dates. In Christianity, many of -these (the \*(L"movable feasts\*(R") are calculated relative to Easter Sunday, -which is why the e variable is useful. -.PP -There is a not operator, !: -.PP -.Vb 1 -\& w=fri & !(m=dec & d=25) , poker game -.Ve -.PP -There is a modulo operator, %, and a subtraction operator, \-. -Using these, along with the j variable, it is just barely possible -for \fBWhen\fR's little parser to perform the following feat: -.PP -.Vb 1 -\& !(j%14\-1) , do something every other Wednesday -.Ve -.PP -The logic behind this silly little piece of wizardry goes like this. -First, we determine, using the command `when j \-\-now=\*(L"2005 jan 26\*(R"', -that the first Wednesday on which we want to -do this has a Julian day that equals 1, modulo 14. Then we write this -expression so that if it's a Wednesday whose Julian day equals 1, -modulo 14, the quantity in parentheses will be zero, and taking its logical -negation will yield a true value. -.PP -The operators' associativity and order of priority (from highest to lowest) is -like this: -.PP -.Vb 7 -\& left % -\& left \- -\& left < > <= >= -\& left = != -\& right ! -\& left & -\& left | -.Ve -.SH "INCLUDING FILES" -.IX Header "INCLUDING FILES" -If your calendar file gets too large, you may prefer to split it up into -smaller chunks \*(-- perhaps one for birthdays, one for Tibetan holidays, etc. -An easy way of accomplishing this is to install the program m4, -put the line -.PP -.Vb 1 -\& prefilter = m4 \-P -.Ve -.PP -in your preferences file, -and then put lines in your calendar file like this: -.PP -.Vb 1 -\& m4_include(/home/yourname/.when/birthdays) -.Ve -.SH "ENVIRONMENT" -.IX Header "ENVIRONMENT" -\&\fB\f(CB$LANG\fB\fR to automatically detect the user's language -.PP -\&\fB\f(CB$TERM\fB\fR to try to figure out if the terminal emulator can display -accented characters -.SH "FILES" -.IX Header "FILES" -\&\fB\f(CB$HOME\fB\fR/.when/calendar \- The default location for the -user's calendar (pointed to by the preferences file) -.PP -\&\fB\f(CB$HOME\fB\fR/.when/preferences \- The user's preferences. -.SH "BUGS" -.IX Header "BUGS" -The filename of the calendar file cannot have unicode in it. -This is because perl's \fIFile::Glob::glob()\fR function does not -support unicode properly. See http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod -and http://stackoverflow.com/questions/18436275/should\-perls\-fileglob\-always\-be\-post\-filtered\-through\-utf8decode . -.SH "OTHER INFORMATION" -.IX Header "OTHER INFORMATION" -\&\fBWhen\fR's web page is at -.PP -.Vb 1 -\& http://www.lightandmatter.com/when/when.html , -.Ve -.PP -where you can always find the latest version of the software. -There is a page for \fBWhen\fR on Freshmeat, at -.PP -.Vb 1 -\& http://freshmeat.net/projects/when/ , -.Ve -.PP -where you can give comments, rate it, and subscribe to e\-mail announcements of new releases. -.SH "AUTHOR" -.IX Header "AUTHOR" -\&\fBWhen\fR was written by Ben Crowell, http://www.lightandmatter.com/personal/. -Dimiter Trendafilov wrote the new and improved parser for date expressions. -.SH "COPYRIGHT AND LICENSE" -.IX Header "COPYRIGHT AND LICENSE" -\&\fBCopyright (C)\fR 2003\-2012 by Benjamin Crowell. -.PP -\&\fBWhen\fR is free software; you can redistribute it and/or modify it -under the terms of the \s-1GPL,\s0 or, optionally, Perl's license.