1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642
|
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.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" ''
'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 (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\"
.\" 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 "2008-04-15" "1.1.12" "When 1.1.12"
.\" 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]
.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 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 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 "\-\-past=DAYS" 8
.IX Item "--past=DAYS"
How many days into the past the report extends. Default: \-1
.IP "\-\-future=DAYS" 8
.IX Item "--future=DAYS"
How many days into the past the report extends. Default: 14
.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=COLUMNS" 8
.IX Item "--rows=COLUMNS"
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 on the command line, or if the m or y command is
used.
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]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"
How to style today's date when doing the calendar (c) command.
Default: bold
.IP "\-\-items_today_style=STYLE" 8
.IX Item "--items_today_style=STYLE"
How to style the word ``today'' when doing the items (i) command.
Default: bold
.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]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.
Default: yes
.IP "\-\-test_expression" 8
.IX Item "--test_expression"
Used internally by `make test'.
.IP "\-\-bare_version" 8
.IX Item "--bare_version"
Used internally by the Makefile.
.IP "\-\-make_filter_regex" 8
.IX Item "--make_filter_regex"
Used internally.
.IP "\-\-test_accent_filtering" 8
.IX Item "--test_accent_filtering"
Used internally.
.PP
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
.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 When?
.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 When 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 When 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 When 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
When 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
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.
.PP
If you now run When, 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. When 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'', When 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.
.SH "INTERNATIONALIZATION"
.IX Header "INTERNATIONALIZATION"
When has at least partial support for Czech, Danish, Dutch,
English, French, German, Greek, Italian, Polish, and Spanish.
If When 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.
When should automatically detect what language you use (via your \f(CW$LANG\fR
environment variable), and if When has been translated into that language,
that's what you'll get \*(-- When's output will be in your language, and
When 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, When
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.
When 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 When 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 When 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 "FANCY TESTS"
.IX Header "FANCY TESTS"
In addition to w, discussed above, there are a bunch of other variables
you can test:
.PP
.Vb 8
\& 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.
\& e \- days until this year\*(Aqs (Western) Easter
.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, When
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. Here are some examples of how
to set up some common holidays:
* feb 14 , Valentine's Day
e=47 , Mardi Gras
e=46 , Ash Wednesday
e=7 , Palm Sunday
e=0 , Easter Sunday
e=0\-49 , Pentecost (49 days after easter)
m=jan & w=mon & a=3 , Martin Luther King Day
m=sep & w=mon & a=1 , Labor Day
m=may & w=mon & b=1 , Memorial Day
m=may & w=sun & a=2 , Mother's Day
m=jun & w=sun & a=3 , Father's Day
m=nov & w=thu & a=4 , Thanksgiving (U.S.)
m=oct & w=mon & a=2 , Thanksgiving (Canada)
.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 When'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 "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 "OTHER INFORMATION"
.IX Header "OTHER INFORMATION"
When'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 When 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"
When was written by Ben Crowell, http://www.lightandmatter.com/personal/.
Dimiter Trendafilov wrote the new and improved parser for date expressions.
This man page was based on Bryce Harrington's man page for inkscape.
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
\&\fBCopyright (C)\fR 2003\-2005 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.
|