| 1 | @c This is part of the Emacs manual. -*- coding: iso-latin-1 -*- |
| 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012 |
| 3 | @c Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Calendar/Diary |
| 6 | @chapter The Calendar and the Diary |
| 7 | @cindex calendar |
| 8 | @findex calendar |
| 9 | |
| 10 | Emacs provides the functions of a desk calendar, with a diary of |
| 11 | planned or past events. It also has facilities for managing your |
| 12 | appointments, and keeping track of how much time you spend working on |
| 13 | certain projects. |
| 14 | |
| 15 | To enter the calendar, type @kbd{M-x calendar}; this displays a |
| 16 | three-month calendar centered on the current month, with point on the |
| 17 | current date. With a numeric argument, as in @kbd{C-u M-x calendar}, it |
| 18 | prompts you for the month and year to be the center of the three-month |
| 19 | calendar. The calendar uses its own buffer, whose major mode is |
| 20 | Calendar mode. |
| 21 | |
| 22 | @kbd{Mouse-3} in the calendar brings up a menu of operations on a |
| 23 | particular date; @kbd{Mouse-2} brings up a menu of commonly used |
| 24 | calendar features that are independent of any particular date. To exit |
| 25 | the calendar, type @kbd{q}. |
| 26 | |
| 27 | @iftex |
| 28 | This chapter describes the basic calendar features. |
| 29 | For more advanced topics, |
| 30 | @pxref{Advanced Calendar/Diary Usage,,, emacs-xtra, Specialized Emacs Features}. |
| 31 | @end iftex |
| 32 | |
| 33 | @menu |
| 34 | * Calendar Motion:: Moving through the calendar; selecting a date. |
| 35 | * Scroll Calendar:: Bringing earlier or later months onto the screen. |
| 36 | * Counting Days:: How many days are there between two dates? |
| 37 | * General Calendar:: Exiting or recomputing the calendar. |
| 38 | * Writing Calendar Files:: Writing calendars to files of various formats. |
| 39 | * Holidays:: Displaying dates of holidays. |
| 40 | * Sunrise/Sunset:: Displaying local times of sunrise and sunset. |
| 41 | * Lunar Phases:: Displaying phases of the moon. |
| 42 | * Other Calendars:: Converting dates to other calendar systems. |
| 43 | * Diary:: Displaying events from your diary. |
| 44 | * Appointments:: Reminders when it's time to do something. |
| 45 | * Importing Diary:: Converting diary events to/from other formats. |
| 46 | * Daylight Saving:: How to specify when daylight saving time is active. |
| 47 | * Time Intervals:: Keeping track of time intervals. |
| 48 | @ifnottex |
| 49 | * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. |
| 50 | @end ifnottex |
| 51 | @end menu |
| 52 | |
| 53 | @node Calendar Motion |
| 54 | @section Movement in the Calendar |
| 55 | |
| 56 | @cindex moving inside the calendar |
| 57 | Calendar mode provides commands to move through the calendar in |
| 58 | logical units of time such as days, weeks, months, and years. If you |
| 59 | move outside the three months originally displayed, the calendar |
| 60 | display ``scrolls'' automatically through time to make the selected |
| 61 | date visible. Moving to a date lets you view its holidays or diary |
| 62 | entries, or convert it to other calendars; moving by long time periods |
| 63 | is also useful simply to scroll the calendar. |
| 64 | |
| 65 | @menu |
| 66 | * Calendar Unit Motion:: Moving by days, weeks, months, and years. |
| 67 | * Move to Beginning or End:: Moving to start/end of weeks, months, and years. |
| 68 | * Specified Dates:: Moving to the current date or another |
| 69 | specific date. |
| 70 | @end menu |
| 71 | |
| 72 | @node Calendar Unit Motion |
| 73 | @subsection Motion by Standard Lengths of Time |
| 74 | |
| 75 | The commands for movement in the calendar buffer parallel the |
| 76 | commands for movement in text. You can move forward and backward by |
| 77 | days, weeks, months, and years. |
| 78 | |
| 79 | @table @kbd |
| 80 | @item C-f |
| 81 | Move point one day forward (@code{calendar-forward-day}). |
| 82 | @item C-b |
| 83 | Move point one day backward (@code{calendar-backward-day}). |
| 84 | @item C-n |
| 85 | Move point one week forward (@code{calendar-forward-week}). |
| 86 | @item C-p |
| 87 | Move point one week backward (@code{calendar-backward-week}). |
| 88 | @item M-@} |
| 89 | Move point one month forward (@code{calendar-forward-month}). |
| 90 | @item M-@{ |
| 91 | Move point one month backward (@code{calendar-backward-month}). |
| 92 | @item C-x ] |
| 93 | Move point one year forward (@code{calendar-forward-year}). |
| 94 | @item C-x [ |
| 95 | Move point one year backward (@code{calendar-backward-year}). |
| 96 | @end table |
| 97 | |
| 98 | @kindex C-f @r{(Calendar mode)} |
| 99 | @findex calendar-forward-day |
| 100 | @kindex C-b @r{(Calendar mode)} |
| 101 | @findex calendar-backward-day |
| 102 | @kindex C-n @r{(Calendar mode)} |
| 103 | @findex calendar-forward-week |
| 104 | @kindex C-p @r{(Calendar mode)} |
| 105 | @findex calendar-backward-week |
| 106 | The day and week commands are natural analogues of the usual Emacs |
| 107 | commands for moving by characters and by lines. Just as @kbd{C-n} |
| 108 | usually moves to the same column in the following line, in Calendar |
| 109 | mode it moves to the same day in the following week. And @kbd{C-p} |
| 110 | moves to the same day in the previous week. |
| 111 | |
| 112 | The arrow keys are equivalent to @kbd{C-f}, @kbd{C-b}, @kbd{C-n} and |
| 113 | @kbd{C-p}, just as they normally are in other modes. |
| 114 | |
| 115 | @kindex M-@} @r{(Calendar mode)} |
| 116 | @findex calendar-forward-month |
| 117 | @kindex M-@{ @r{(Calendar mode)} |
| 118 | @findex calendar-backward-month |
| 119 | @kindex C-x ] @r{(Calendar mode)} |
| 120 | @findex calendar-forward-year |
| 121 | @kindex C-x [ @r{(Calendar mode)} |
| 122 | @findex calendar-forward-year |
| 123 | The commands for motion by months and years work like those for |
| 124 | weeks, but move a larger distance. The month commands @kbd{M-@}} and |
| 125 | @kbd{M-@{} move forward or backward by an entire month. The year |
| 126 | commands @kbd{C-x ]} and @w{@kbd{C-x [}} move forward or backward a |
| 127 | whole year. |
| 128 | |
| 129 | The easiest way to remember these commands is to consider months and |
| 130 | years analogous to paragraphs and pages of text, respectively. But |
| 131 | the commands themselves are not quite analogous. The ordinary Emacs |
| 132 | paragraph commands move to the beginning or end of a paragraph, |
| 133 | whereas these month and year commands move by an entire month or an |
| 134 | entire year, keeping the same date within the month or year. |
| 135 | |
| 136 | All these commands accept a numeric argument as a repeat count. |
| 137 | For convenience, the digit keys and the minus sign specify numeric |
| 138 | arguments in Calendar mode even without the Meta modifier. For example, |
| 139 | @kbd{100 C-f} moves point 100 days forward from its present location. |
| 140 | |
| 141 | @node Move to Beginning or End |
| 142 | @subsection Beginning or End of Week, Month or Year |
| 143 | |
| 144 | A week (or month, or year) is not just a quantity of days; we think of |
| 145 | weeks (months, years) as starting on particular dates. So Calendar mode |
| 146 | provides commands to move to the start or end of a week, month or year: |
| 147 | |
| 148 | @table @kbd |
| 149 | @kindex C-a @r{(Calendar mode)} |
| 150 | @findex calendar-beginning-of-week |
| 151 | @item C-a |
| 152 | Move point to start of week (@code{calendar-beginning-of-week}). |
| 153 | @kindex C-e @r{(Calendar mode)} |
| 154 | @findex calendar-end-of-week |
| 155 | @item C-e |
| 156 | Move point to end of week (@code{calendar-end-of-week}). |
| 157 | @kindex M-a @r{(Calendar mode)} |
| 158 | @findex calendar-beginning-of-month |
| 159 | @item M-a |
| 160 | Move point to start of month (@code{calendar-beginning-of-month}). |
| 161 | @kindex M-e @r{(Calendar mode)} |
| 162 | @findex calendar-end-of-month |
| 163 | @item M-e |
| 164 | Move point to end of month (@code{calendar-end-of-month}). |
| 165 | @kindex M-< @r{(Calendar mode)} |
| 166 | @findex calendar-beginning-of-year |
| 167 | @item M-< |
| 168 | Move point to start of year (@code{calendar-beginning-of-year}). |
| 169 | @kindex M-> @r{(Calendar mode)} |
| 170 | @findex calendar-end-of-year |
| 171 | @item M-> |
| 172 | Move point to end of year (@code{calendar-end-of-year}). |
| 173 | @end table |
| 174 | |
| 175 | These commands also take numeric arguments as repeat counts, with the |
| 176 | repeat count indicating how many weeks, months, or years to move |
| 177 | backward or forward. |
| 178 | |
| 179 | @vindex calendar-week-start-day |
| 180 | @cindex weeks, which day they start on |
| 181 | @cindex calendar, first day of week |
| 182 | By default, weeks begin on Sunday. To make them begin on Monday |
| 183 | instead, set the variable @code{calendar-week-start-day} to 1. |
| 184 | |
| 185 | @node Specified Dates |
| 186 | @subsection Specified Dates |
| 187 | |
| 188 | Calendar mode provides commands for moving to a particular date |
| 189 | specified in various ways. |
| 190 | |
| 191 | @table @kbd |
| 192 | @item g d |
| 193 | Move point to specified date (@code{calendar-goto-date}). |
| 194 | @item g D |
| 195 | Move point to specified day of year (@code{calendar-goto-day-of-year}). |
| 196 | @item g w |
| 197 | Move point to specified week of year (@code{calendar-iso-goto-week}). |
| 198 | @item o |
| 199 | Center calendar around specified month (@code{calendar-other-month}). |
| 200 | @item . |
| 201 | Move point to today's date (@code{calendar-goto-today}). |
| 202 | @end table |
| 203 | |
| 204 | @kindex g d @r{(Calendar mode)} |
| 205 | @findex calendar-goto-date |
| 206 | @kbd{g d} (@code{calendar-goto-date}) prompts for a year, a month, and a day |
| 207 | of the month, and then moves to that date. Because the calendar includes all |
| 208 | dates from the beginning of the current era, you must type the year in its |
| 209 | entirety; that is, type @samp{1990}, not @samp{90}. |
| 210 | |
| 211 | @kindex g D @r{(Calendar mode)} |
| 212 | @findex calendar-goto-day-of-year |
| 213 | @kindex g w @r{(Calendar mode)} |
| 214 | @findex calendar-iso-goto-week |
| 215 | @kbd{g D} (@code{calendar-goto-day-of-year}) prompts for a year and |
| 216 | day number, and moves to that date. Negative day numbers count |
| 217 | backward from the end of the year. @kbd{g w} |
| 218 | (@code{calendar-iso-goto-week}) prompts for a year and week number, |
| 219 | and moves to that week. |
| 220 | |
| 221 | @kindex o @r{(Calendar mode)} |
| 222 | @findex calendar-other-month |
| 223 | @kbd{o} (@code{calendar-other-month}) prompts for a month and year, |
| 224 | then centers the three-month calendar around that month. |
| 225 | |
| 226 | @kindex . @r{(Calendar mode)} |
| 227 | @findex calendar-goto-today |
| 228 | You can return to today's date with @kbd{.}@: |
| 229 | (@code{calendar-goto-today}). |
| 230 | |
| 231 | @node Scroll Calendar |
| 232 | @section Scrolling in the Calendar |
| 233 | |
| 234 | @cindex scrolling in the calendar |
| 235 | The calendar display scrolls automatically through time when you |
| 236 | move out of the visible portion. You can also scroll it manually. |
| 237 | Imagine that the calendar window contains a long strip of paper with |
| 238 | the months on it. Scrolling the calendar means moving the strip |
| 239 | horizontally, so that new months become visible in the window. |
| 240 | |
| 241 | @table @kbd |
| 242 | @item > |
| 243 | Scroll calendar one month forward (@code{calendar-scroll-left}). |
| 244 | @item < |
| 245 | Scroll calendar one month backward (@code{calendar-scroll-right}). |
| 246 | @item C-v |
| 247 | @itemx @key{next} |
| 248 | Scroll forward by three months (@code{calendar-scroll-left-three-months}). |
| 249 | @item M-v |
| 250 | @itemx @key{prior} |
| 251 | Scroll backward by three months (@code{calendar-scroll-right-three-months}). |
| 252 | @end table |
| 253 | |
| 254 | @kindex > @r{(Calendar mode)} |
| 255 | @findex calendar-scroll-left |
| 256 | @kindex < @r{(Calendar mode)} |
| 257 | @findex calendar-scroll-right |
| 258 | The most basic calendar scroll commands scroll by one month at a |
| 259 | time. This means that there are two months of overlap between the |
| 260 | display before the command and the display after. @kbd{>} scrolls the |
| 261 | calendar contents one month forward in time. @kbd{<} scrolls the |
| 262 | contents one month backwards in time. |
| 263 | |
| 264 | @kindex C-v @r{(Calendar mode)} |
| 265 | @findex calendar-scroll-left-three-months |
| 266 | @kindex M-v @r{(Calendar mode)} |
| 267 | @findex calendar-scroll-right-three-months |
| 268 | The commands @kbd{C-v} and @kbd{M-v} scroll the calendar by an entire |
| 269 | ``screenful''---three months---in analogy with the usual meaning of |
| 270 | these commands. @kbd{C-v} makes later dates visible and @kbd{M-v} makes |
| 271 | earlier dates visible. These commands take a numeric argument as a |
| 272 | repeat count; in particular, since @kbd{C-u} multiplies the next command |
| 273 | by four, typing @kbd{C-u C-v} scrolls the calendar forward by a year and |
| 274 | typing @kbd{C-u M-v} scrolls the calendar backward by a year. |
| 275 | |
| 276 | The function keys @key{next} and @key{prior} are equivalent to |
| 277 | @kbd{C-v} and @kbd{M-v}, just as they are in other modes. |
| 278 | |
| 279 | @node Counting Days |
| 280 | @section Counting Days |
| 281 | |
| 282 | @table @kbd |
| 283 | @item M-= |
| 284 | Display the number of days in the current region |
| 285 | (@code{calendar-count-days-region}). |
| 286 | @end table |
| 287 | |
| 288 | @kindex M-= @r{(Calendar mode)} |
| 289 | @findex calendar-count-days-region |
| 290 | To determine the number of days in a range, set the mark on one |
| 291 | date using @kbd{C-SPC}, move point to another date, and type @kbd{M-=} |
| 292 | (@code{calendar-count-days-region}). The numbers of days shown is |
| 293 | @emph{inclusive}; that is, it includes the days specified by mark and |
| 294 | point. |
| 295 | |
| 296 | @node General Calendar |
| 297 | @section Miscellaneous Calendar Commands |
| 298 | |
| 299 | @table @kbd |
| 300 | @item p d |
| 301 | Display day-in-year (@code{calendar-print-day-of-year}). |
| 302 | @item C-c C-l |
| 303 | Regenerate the calendar window (@code{calendar-redraw}). |
| 304 | @item SPC |
| 305 | Scroll the next window up (@code{scroll-other-window}). |
| 306 | @item DEL |
| 307 | Scroll the next window down (@code{scroll-other-window-down}). |
| 308 | @item q |
| 309 | Exit from calendar (@code{calendar-exit}). |
| 310 | @end table |
| 311 | |
| 312 | @kindex p d @r{(Calendar mode)} |
| 313 | @cindex day of year |
| 314 | @findex calendar-print-day-of-year |
| 315 | To display the number of days elapsed since the start of the year, or |
| 316 | the number of days remaining in the year, type the @kbd{p d} command |
| 317 | (@code{calendar-print-day-of-year}). This displays both of those |
| 318 | numbers in the echo area. The count of days elapsed includes the |
| 319 | selected date. The count of days remaining does not include that |
| 320 | date. |
| 321 | |
| 322 | @kindex C-c C-l @r{(Calendar mode)} |
| 323 | @findex calendar-redraw |
| 324 | If the calendar window text gets corrupted, type @kbd{C-c C-l} |
| 325 | (@code{calendar-redraw}) to redraw it. (This can only happen if you use |
| 326 | non-Calendar-mode editing commands.) |
| 327 | |
| 328 | @kindex SPC @r{(Calendar mode)} |
| 329 | In Calendar mode, you can use @kbd{SPC} (@code{scroll-other-window}) |
| 330 | and @kbd{DEL} (@code{scroll-other-window-down}) to scroll the other |
| 331 | window (if there is one) up or down, respectively. This is handy when |
| 332 | you display a list of holidays or diary entries in another window. |
| 333 | |
| 334 | @kindex q @r{(Calendar mode)} |
| 335 | @findex exit-calendar |
| 336 | @vindex calendar-remove-frame-by-deleting |
| 337 | To exit from the calendar, type @kbd{q} (@code{calendar-exit}). This |
| 338 | buries all buffers related to the calendar, selecting other buffers. |
| 339 | (If a frame contains a dedicated calendar window, exiting from the |
| 340 | calendar deletes or iconifies that frame depending on the value of |
| 341 | @code{calendar-remove-frame-by-deleting}.) |
| 342 | |
| 343 | @c FIXME this mentions holidays and diary entries, albeit briefly, so |
| 344 | @c should it be moved after those sections? Or at least xref them. |
| 345 | @node Writing Calendar Files |
| 346 | @section Writing Calendar Files |
| 347 | |
| 348 | You can write calendars and diary entries to HTML and @LaTeX{} files. |
| 349 | |
| 350 | @cindex calendar and HTML |
| 351 | The Calendar HTML commands produce files of HTML code that contain |
| 352 | calendar and diary entries. Each file applies to one month, and has a |
| 353 | name of the format @file{@var{yyyy}-@var{mm}.html}, where @var{yyyy} and |
| 354 | @var{mm} are the four-digit year and two-digit month, respectively. The |
| 355 | variable @code{cal-html-directory} specifies the default output |
| 356 | directory for the HTML files. |
| 357 | |
| 358 | @vindex cal-html-css-default |
| 359 | Diary entries enclosed by @code{<} and @code{>} are interpreted as |
| 360 | HTML tags (for example: this is a diary entry with <font |
| 361 | color=''red''>some red text</font>). You can change the overall |
| 362 | appearance of the displayed HTML pages (for example, the color of |
| 363 | various page elements, header styles) via a stylesheet @file{cal.css} in |
| 364 | the directory containing the HTML files (see the value of the variable |
| 365 | @code{cal-html-css-default} for relevant style settings). |
| 366 | |
| 367 | @kindex t @r{(Calendar mode)} |
| 368 | @table @kbd |
| 369 | @item H m |
| 370 | Generate a one-month calendar (@code{cal-html-cursor-month}). |
| 371 | @item H y |
| 372 | Generate a calendar file for each month of a year, as well as an index |
| 373 | page (@code{cal-html-cursor-year}). By default, this command writes |
| 374 | files to a @var{yyyy} subdirectory - if this is altered some hyperlinks |
| 375 | between years will not work. |
| 376 | @end table |
| 377 | |
| 378 | If the variable @code{cal-html-print-day-number-flag} is |
| 379 | non-@code{nil}, then the monthly calendars show the day-of-the-year |
| 380 | number. The variable @code{cal-html-year-index-cols} specifies the |
| 381 | number of columns in the yearly index page. |
| 382 | |
| 383 | @cindex calendar and @LaTeX{} |
| 384 | The Calendar @LaTeX{} commands produce a buffer of @LaTeX{} code that |
| 385 | prints as a calendar. Depending on the command you use, the printed |
| 386 | calendar covers the day, week, month or year that point is in. |
| 387 | |
| 388 | @kindex t @r{(Calendar mode)} |
| 389 | @table @kbd |
| 390 | @item t m |
| 391 | Generate a one-month calendar (@code{cal-tex-cursor-month}). |
| 392 | @item t M |
| 393 | Generate a sideways-printing one-month calendar |
| 394 | (@code{cal-tex-cursor-month-landscape}). |
| 395 | @item t d |
| 396 | Generate a one-day calendar |
| 397 | (@code{cal-tex-cursor-day}). |
| 398 | @item t w 1 |
| 399 | Generate a one-page calendar for one week |
| 400 | (@code{cal-tex-cursor-week}). |
| 401 | @item t w 2 |
| 402 | Generate a two-page calendar for one week |
| 403 | (@code{cal-tex-cursor-week2}). |
| 404 | @item t w 3 |
| 405 | Generate an ISO-style calendar for one week |
| 406 | (@code{cal-tex-cursor-week-iso}). |
| 407 | @item t w 4 |
| 408 | Generate a calendar for one Monday-starting week |
| 409 | (@code{cal-tex-cursor-week-monday}). |
| 410 | @item t f w |
| 411 | Generate a Filofax-style two-weeks-at-a-glance calendar |
| 412 | (@code{cal-tex-cursor-filofax-2week}). |
| 413 | @item t f W |
| 414 | Generate a Filofax-style one-week-at-a-glance calendar |
| 415 | (@code{cal-tex-cursor-filofax-week}). |
| 416 | @item t y |
| 417 | Generate a calendar for one year |
| 418 | (@code{cal-tex-cursor-year}). |
| 419 | @item t Y |
| 420 | Generate a sideways-printing calendar for one year |
| 421 | (@code{cal-tex-cursor-year-landscape}). |
| 422 | @item t f y |
| 423 | Generate a Filofax-style calendar for one year |
| 424 | (@code{cal-tex-cursor-filofax-year}). |
| 425 | @end table |
| 426 | |
| 427 | Some of these commands print the calendar sideways (in ``landscape |
| 428 | mode''), so it can be wider than it is long. Some of them use Filofax |
| 429 | paper size (3.75in x 6.75in). All of these commands accept a prefix |
| 430 | argument, which specifies how many days, weeks, months or years to print |
| 431 | (starting always with the selected one). |
| 432 | |
| 433 | If the variable @code{cal-tex-holidays} is non-@code{nil} (the default), |
| 434 | then the printed calendars show the holidays in @code{calendar-holidays}. |
| 435 | If the variable @code{cal-tex-diary} is non-@code{nil} (the default is |
| 436 | @code{nil}), diary entries are included also (in monthly, filofax, and |
| 437 | iso-week calendars only). If the variable @code{cal-tex-rules} is |
| 438 | non-@code{nil} (the default is @code{nil}), the calendar displays ruled |
| 439 | pages in styles that have sufficient room. Consult the documentation of |
| 440 | the individual cal-tex functions to see which calendars support which |
| 441 | features. |
| 442 | |
| 443 | You can use the variable @code{cal-tex-preamble-extra} to insert extra |
| 444 | @LaTeX{} commands in the preamble of the generated document if you need |
| 445 | to. |
| 446 | |
| 447 | @node Holidays |
| 448 | @section Holidays |
| 449 | @cindex holidays |
| 450 | |
| 451 | The Emacs calendar knows about many major and minor holidays, |
| 452 | and can display them. You can add your own holidays to the default list. |
| 453 | |
| 454 | @table @kbd |
| 455 | @item Mouse-3 Holidays |
| 456 | @itemx h |
| 457 | Display holidays for the selected date |
| 458 | (@code{calendar-cursor-holidays}). |
| 459 | @item x |
| 460 | Mark holidays in the calendar window (@code{calendar-mark-holidays}). |
| 461 | @item u |
| 462 | Unmark calendar window (@code{calendar-unmark}). |
| 463 | @item a |
| 464 | List all holidays for the displayed three months in another window |
| 465 | (@code{calendar-list-holidays}). |
| 466 | @item M-x holidays |
| 467 | List all holidays for three months around today's date in another |
| 468 | window. |
| 469 | @item M-x list-holidays |
| 470 | List holidays in another window for a specified range of years. |
| 471 | @end table |
| 472 | |
| 473 | @kindex h @r{(Calendar mode)} |
| 474 | @findex calendar-cursor-holidays |
| 475 | @vindex calendar-view-holidays-initially-flag |
| 476 | To see if any holidays fall on a given date, position point on that |
| 477 | date in the calendar window and use the @kbd{h} command. Alternatively, |
| 478 | click on that date with @kbd{Mouse-3} and then choose @kbd{Holidays} |
| 479 | from the menu that appears. Either way, this displays the holidays for |
| 480 | that date, in the echo area if they fit there, otherwise in a separate |
| 481 | window. |
| 482 | |
| 483 | @kindex x @r{(Calendar mode)} |
| 484 | @findex calendar-mark-holidays |
| 485 | @kindex u @r{(Calendar mode)} |
| 486 | @findex calendar-unmark |
| 487 | @vindex calendar-mark-holidays-flag |
| 488 | To view the distribution of holidays for all the dates shown in the |
| 489 | calendar, use the @kbd{x} command. This displays the dates that are |
| 490 | holidays in a different face. |
| 491 | @iftex |
| 492 | @xref{Calendar Customizing,,, emacs-xtra, Specialized Emacs Features}. |
| 493 | @end iftex |
| 494 | @ifnottex |
| 495 | @xref{Calendar Customizing, calendar-holiday-marker}. |
| 496 | @end ifnottex |
| 497 | The command applies both to the currently visible months and to |
| 498 | other months that subsequently become visible by scrolling. To turn |
| 499 | marking off and erase the current marks, type @kbd{u}, which also |
| 500 | erases any diary marks (@pxref{Diary}). If the variable |
| 501 | @code{calendar-mark-holidays-flag} is non-@code{nil}, creating or |
| 502 | updating the calendar marks holidays automatically. |
| 503 | |
| 504 | @kindex a @r{(Calendar mode)} |
| 505 | @findex calendar-list-holidays |
| 506 | To get even more detailed information, use the @kbd{a} command, which |
| 507 | displays a separate buffer containing a list of all holidays in the |
| 508 | current three-month range. You can use @key{SPC} and @key{DEL} in the |
| 509 | calendar window to scroll that list up and down, respectively. |
| 510 | |
| 511 | @findex holidays |
| 512 | The command @kbd{M-x holidays} displays the list of holidays for the |
| 513 | current month and the preceding and succeeding months; this works even |
| 514 | if you don't have a calendar window. If the variable |
| 515 | @code{calendar-view-holidays-initially-flag} is non-@code{nil}, creating |
| 516 | the calendar displays holidays in this way. If you want the list of |
| 517 | holidays centered around a different month, use @kbd{C-u M-x |
| 518 | holidays}, which prompts for the month and year. |
| 519 | |
| 520 | The holidays known to Emacs include United States holidays and the |
| 521 |