home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / emacs-19.000 / emacs-19 / usr / local / info / emacs-16 < prev    next >
Encoding:
GNU Info File  |  1995-09-11  |  46.8 KB  |  1,160 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.55 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Sunrise/Sunset,  Next: Lunar Phases,  Prev: Holidays,  Up: Calendar/Diary
  6.  
  7. Times of Sunrise and Sunset
  8. ===========================
  9.  
  10.    Special calendar commands can tell you, to within a minute or two,
  11. the times of sunrise and sunset for any date.
  12.  
  13. `S'
  14.      Display times of sunrise and sunset for the selected date
  15.      (`calendar-sunrise-sunset').
  16.  
  17. `Mouse-2 Sunrise/Sunset'
  18.      Display times of sunrise and sunset for the date you click on.
  19.  
  20. `M-x sunrise-sunset'
  21.      Display times of sunrise and sunset for today's date.
  22.  
  23. `C-u M-x sunrise-sunset'
  24.      Display times of sunrise and sunset for a specified date.
  25.  
  26.    Within the calendar, to display the *local times* of sunrise and
  27. sunset in the echo area, move point to the date you want, and type `S'.
  28. Alternatively, click `Mouse-2' on the date, then choose
  29. `Sunrise/Sunset' from the menu that appears.  The command `M-x
  30. sunrise-sunset' is available outside the calendar to display this
  31. information for today's date or a specified date.  To specify a date
  32. other than today, use `C-u M-x sunrise-sunset', which prompts for the
  33. year, month, and day.
  34.  
  35.    You can display the times of sunrise and sunset for any location and
  36. any date with `C-u C-u M-x sunrise-sunset'.  This asks you for a
  37. longitude, latitude, number of minutes difference from Coordinated
  38. Universal Time, and date, and then tells you the times of sunrise and
  39. sunset for that location on that date.
  40.  
  41.    Because the times of sunrise and sunset depend on the location on
  42. earth, you need to tell Emacs your latitude, longitude, and location
  43. name before using these commands.  Here is an example of what to set:
  44.  
  45.      (setq calendar-latitude 40.1)
  46.      (setq calendar-longitude -88.2)
  47.      (setq calendar-location-name "Urbana, IL")
  48.  
  49. Use one decimal place in the values of `calendar-latitude' and
  50. `calendar-longitude'.
  51.  
  52.    Your time zone also affects the local time of sunrise and sunset.
  53. Emacs usually gets time zone information from the operating system, but
  54. if these values are not what you want (or if the operating system does
  55. not supply them), you must set them yourself.  Here is an example:
  56.  
  57.      (setq calendar-time-zone -360)
  58.      (setq calendar-standard-time-zone-name "CST")
  59.      (setq calendar-daylight-time-zone-name "CDT")
  60.  
  61. The value of `calendar-time-zone' is the number of minutes difference
  62. between your local standard time and Coordinated Universal Time
  63. (Greenwich time).  The values of `calendar-standard-time-zone-name' and
  64. `calendar-daylight-time-zone-name' are the abbreviations used in your
  65. time zone.  Emacs displays the times of sunrise and sunset *corrected
  66. for daylight savings time*.  *Note Daylight Savings::, for how daylight
  67. savings time is determined.
  68.  
  69.    As a user, you might find it convenient to set the calendar location
  70. variables for your usual physical location in your `.emacs' file.  And
  71. when you install Emacs on a machine, you can create a `default.el' file
  72. which sets them properly for the typical location of most users of that
  73. machine.  *Note Init File::.
  74.  
  75. 
  76. File: emacs,  Node: Lunar Phases,  Next: Other Calendars,  Prev: Sunrise/Sunset,  Up: Calendar/Diary
  77.  
  78. Phases of the Moon
  79. ==================
  80.  
  81.    These calendar commands display the dates and times of the phases of
  82. the moon (new moon, first quarter, full moon, last quarter).  This
  83. feature is useful for debugging problems that "depend on the phase of
  84. the moon."
  85.  
  86. `M'
  87.      Display the dates and times for all the quarters of the moon for
  88.      the three-month period shown (`calendar-phases-of-moon').
  89.  
  90. `M-x phases-of-moon'
  91.      Display dates and times of the quarters of the moon for three
  92.      months around today's date.
  93.  
  94.    Within the calendar, use the `M' command to display a separate
  95. buffer of the phases of the moon for the current three-month range.  The
  96. dates and times listed are accurate to within a few minutes.
  97.  
  98.    Outside the calendar, use the command `M-x phases-of-moon' to
  99. display the list of the phases of the moon for the current month and the
  100. preceding and succeeding months.  For information about a different
  101. month, use `C-u M-x phases-of-moon', which prompts for the month and
  102. year.
  103.  
  104.    The dates and times given for the phases of the moon are given in
  105. local time (corrected for daylight savings, when appropriate); but if
  106. the variable `calendar-time-zone' is void, Coordinated Universal Time
  107. (the Greenwich time zone) is used.  *Note Daylight Savings::.
  108.  
  109. 
  110. File: emacs,  Node: Other Calendars,  Next: Diary,  Prev: Lunar Phases,  Up: Calendar/Diary
  111.  
  112. Conversion To and From Other Calendars
  113. ======================================
  114.  
  115.    The Emacs calendar displayed is *always* the Gregorian calendar,
  116. sometimes called the "new style" calendar, which is used in most of the
  117. world today.  However, this calendar did not exist before the sixteenth
  118. century and was not widely used before the eighteenth century; it did
  119. not fully displace the Julian calendar and gain universal acceptance
  120. until the early twentieth century.  The Emacs calendar can display any
  121. month since January, year 1 of the current era, but the calendar
  122. displayed is the Gregorian, even for a date at which the Gregorian
  123. calendar did not exist.
  124.  
  125.    While Emacs cannot display other calendars, it can convert dates to
  126. and from several other calendars.
  127.  
  128. * Menu:
  129.  
  130. * Calendar Systems::       The calendars Emacs understands
  131.                  (aside from Gregorian).
  132. * To Other Calendar::       Converting the selected date to various calendars.
  133. * From Other Calendar::       Moving to a date specified in another calendar.
  134. * Mayan Calendar::       Moving to a date specified in a Mayan calendar.
  135.  
  136. 
  137. File: emacs,  Node: Calendar Systems,  Next: To Other Calendar,  Up: Other Calendars
  138.  
  139. Supported Calendar Systems
  140. --------------------------
  141.  
  142.    The ISO commercial calendar is used largely in Europe.
  143.  
  144.    The Julian calendar, named after Julius Caesar, was the one used in
  145. Europe throughout medieval times, and in many countries up until the
  146. nineteenth century.
  147.  
  148.    Astronomers use a simple counting of days elapsed since noon, Monday,
  149. January 1, 4713 B.C. on the Julian calendar.  The number of days elapsed
  150. is called the *Julian day number* or the *Astronomical day number*.
  151.  
  152.    The Hebrew calendar is used by tradition in the Jewish religion.  The
  153. Emacs calendar program uses the Hebrew calendar to determine the dates
  154. of Jewish holidays.  Hebrew calendar dates begin and end at sunset.
  155.  
  156.    The Islamic calendar is used in many predominantly Islamic countries.
  157. Emacs uses it to determine the dates of Islamic holidays.  There is no
  158. universal agreement in the Islamic world about the calendar; Emacs uses
  159. a widely accepted version, but the precise dates of Islamic holidays
  160. often depend on proclamation by religious authorities, not on
  161. calculations.  As a consequence, the actual dates of observance can vary
  162. slightly from the dates computed by Emacs.  Islamic calendar dates begin
  163. and end at sunset.
  164.  
  165.    The French Revolutionary calendar was created by the Jacobins after
  166. the 1789 revolution, to represent a more secular and nature-based view
  167. of the annual cycle, and to install a 10-day week in a rationalization
  168. measure similar to the metric system.  The French government officially
  169. abandoned this calendar at the end of 1805.
  170.  
  171.    The Maya of Central America used three separate, overlapping calendar
  172. systems, the *long count*, the *tzolkin*, and the *haab*.  Emacs knows
  173. about all three of these calendars.  Experts dispute the exact
  174. correlation between the Mayan calendar and our calendar; Emacs uses the
  175. Goodman-Martinez-Thompson correlation in its calculations.
  176.  
  177. 
  178. File: emacs,  Node: To Other Calendar,  Next: From Other Calendar,  Prev: Calendar Systems,  Up: Other Calendars
  179.  
  180. Converting To Other Calendars
  181. -----------------------------
  182.  
  183.    The following commands describe the selected date (the date at point)
  184. in various other calendar systems:
  185.  
  186. `Mouse-2  Other Calendars'
  187.      Display the date that you click on, expressed in various other
  188.      calendars.
  189.  
  190. `p c'
  191.      Display ISO commercial calendar equivalent for selected day
  192.      (`calendar-print-iso-date').
  193.  
  194. `p j'
  195.      Display Julian date for selected day
  196.      (`calendar-print-julian-date').
  197.  
  198. `p a'
  199.      Display astronomical (Julian) day number for selected day
  200.      (`calendar-print-astro-day-number').
  201.  
  202. `p h'
  203.      Display Hebrew date for selected day
  204.      (`calendar-print-hebrew-date').
  205.  
  206. `p i'
  207.      Display Islamic date for selected day
  208.      (`calendar-print-islamic-date').
  209.  
  210. `p f'
  211.      Display French Revolutionary date for selected day
  212.      (`calendar-print-french-date').
  213.  
  214. `p m'
  215.      Display Mayan date for selected day (`calendar-print-mayan-date').
  216.  
  217.    If you are using X windows, the easiest way to translate a date into
  218. other calendars is to click on it with `Mouse-2', then choose `Other
  219. Calendars' from the menu that appears.  This displays the equivalent
  220. forms of the date in all the calendars Emacs understands, in the form
  221. of a menu.  (Choosing an alternative from this menu doesn't actually do
  222. anything--the menu is used only for display.)
  223.  
  224.    Put point on the desired date of the Gregorian calendar, then type
  225. the appropriate keys.  The `p' is a mnemonic for "print" since Emacs
  226. "prints" the equivalent date in the echo area.
  227.  
  228. 
  229. File: emacs,  Node: From Other Calendar,  Next: Mayan Calendar,  Prev: To Other Calendar,  Up: Other Calendars
  230.  
  231. Converting From Other Calendars
  232. -------------------------------
  233.  
  234.    You can use the other supported calendars to specify a date to move
  235. to.  This section describes the commands for doing this using calendars
  236. other than Mayan; for the Mayan calendar, see the following section.
  237.  
  238. `g c'
  239.      Move to a date specified in the ISO commercial calendar
  240.      (`calendar-goto-iso-date').
  241.  
  242. `g j'
  243.      Move to a date specified in the Julian calendar
  244.      (`calendar-goto-julian-date').
  245.  
  246. `g a'
  247.      Move to a date specified in astronomical (Julian) day number
  248.      (`calendar-goto-astro-day-number').
  249.  
  250. `g h'
  251.      Move to a date specified in the Hebrew calendar
  252.      (`calendar-goto-hebrew-date').
  253.  
  254. `g i'
  255.      Move to a date specified in the Islamic calendar
  256.      (`calendar-goto-islamic-date').
  257.  
  258. `g f'
  259.      Move to a date specified in the French Revolutionary calendar
  260.      (`calendar-goto-french-date').
  261.  
  262.    These commands ask you for a date on the other calendar, move point
  263. to the Gregorian calendar date equivalent to that date, and display the
  264. other calendar's date in the echo area.  Emacs uses strict completion
  265. (*note Completion::.) whenever it asks you to type a month name, so you
  266. don't have to worry about the spelling of Hebrew, Islamic, or French
  267. names.
  268.  
  269.    One common question concerning the Hebrew calendar is the computation
  270. of the anniversary of a date of death, called a "yahrzeit."  The Emacs
  271. calendar includes a facility for such calculations.  If you are in the
  272. calendar, the command `M-x list-yahrzeit-dates' asks you for a range of
  273. years and then displays a list of the yahrzeit dates for those years
  274. for the date given by point.  If you are not in the calendar, this
  275. command first asks you for the date of death and the range of years,
  276. and then displays the list of yahrzeit dates.
  277.  
  278. 
  279. File: emacs,  Node: Mayan Calendar,  Prev: From Other Calendar,  Up: Other Calendars
  280.  
  281. Converting from the Mayan Calendar
  282. ----------------------------------
  283.  
  284.    Here are the commands to select dates based on the Mayan calendar:
  285.  
  286. `g m l'
  287.      Move to a date specified by the long count calendar
  288.      (`calendar-goto-mayan-long-count-date').
  289.  
  290. `g m n t'
  291.      Move to the next occurrence of a place in the tzolkin calendar
  292.      (`calendar-next-tzolkin-date').
  293.  
  294. `g m p t'
  295.      Move to the previous occurrence of a place in the tzolkin calendar
  296.      (`calendar-previous-tzolkin-date').
  297.  
  298. `g m n h'
  299.      Move to the next occurrence of a place in the haab calendar
  300.      (`calendar-next-haab-date').
  301.  
  302. `g m p h'
  303.      Move to the previous occurrence of a place in the haab calendar
  304.      (`calendar-previous-haab-date').
  305.  
  306. `g m n c'
  307.      Move to the next occurrence of a place in the calendar round
  308.      (`calendar-next-calendar-round-date').
  309.  
  310. `g m p c'
  311.      Move to the previous occurrence of a place in the calendar round
  312.      (`calendar-previous-calendar-round-date').
  313.  
  314.    To understand these commands, you need to understand the Mayan
  315. calendars.  The "long count" is a counting of days with these units:
  316.  
  317.      1 kin = 1 day   1 uinal = 20 kin   1 tun = 18 uinal
  318.      1 katun = 20 tun   1 baktun = 20 katun
  319.  
  320. Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
  321. tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
  322. count dates as early as 7.17.18.13.1, but no earlier.  When you use the
  323. `g m l' command, type the Mayan long count date with the baktun, katun,
  324. tun, uinal, and kin separated by periods.
  325.  
  326.    The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
  327. independent cycles of 13 and 20 days.  Since this cycle repeats
  328. endlessly, Emacs provides commands to move backward and forward to the
  329. previous or next point in the cycle.  Type `g m p t' to go to the
  330. previous tzolkin date; Emacs asks you for a tzolkin date and moves point
  331. to the previous occurrence of that date.  Similarly, type `g m n t' to
  332. go to the next occurrence of a tzolkin date.
  333.  
  334.    The Mayan haab calendar is a cycle of 365 days arranged as 18 months
  335. of 20 days each, followed a 5-day monthless period.  Like the tzolkin
  336. cycle, this cycle repeats endlessly, and there are commands to move
  337. backward and forward to the previous or next point in the cycle.  Type
  338. `g m p h' to go to the previous haab date; Emacs asks you for a haab
  339. date and moves point to the previous occurrence of that date.
  340. Similarly, type `g m n h' to go to the next occurrence of a haab date.
  341.  
  342.    The Maya also used the combination of the tzolkin date and the haab
  343. date.  This combination is a cycle of about 52 years called a *calendar
  344. round*.  If you type `g m p c', Emacs asks you for both a haab and a
  345. tzolkin date and then moves point to the previous occurrence of that
  346. combination.  Use `g m p c' to move point to the next occurrence of a
  347. combination.  These commands signal an error if the haab/tzolkin date
  348. combination you have typed is impossible.
  349.  
  350.    Emacs uses strict completion (*note Strict Completion::.) whenever it
  351. asks you to type a Mayan name, so you don't have to worry about
  352. spelling.
  353.  
  354. 
  355. File: emacs,  Node: Diary,  Next: Appointments,  Prev: Other Calendars,  Up: Calendar/Diary
  356.  
  357. The Diary
  358. =========
  359.  
  360.    The Emacs diary keeps track of appointments or other events on a
  361. daily basis, in conjunction with the calendar.  To use the diary
  362. feature, you must first create a "diary file" containing a list of
  363. events and their dates.  Then Emacs can automatically pick out and
  364. display the events for today, for the immediate future, or for any
  365. specified date.
  366.  
  367.    By default, Emacs uses `~/diary' as the diary file.  This is the
  368. same file that the `calendar' utility uses.  A sample `~/diary' file is:
  369.  
  370.      12/22/1988  Twentieth wedding anniversary!!
  371.      &1/1.       Happy New Year!
  372.      10/22       Ruth's birthday.
  373.      * 21, *:    Payday
  374.      Tuesday--weekly meeting with grad students at 10am
  375.               Supowit, Shen, Bitner, and Kapoor to attend.
  376.      1/13/89     Friday the thirteenth!!
  377.      &thu 4pm    squash game with Lloyd.
  378.      mar 16      Dad's birthday
  379.      April 15, 1989 Income tax due.
  380.      &* 15       time cards due.
  381.  
  382. This example uses extra spaces to align the event descriptions of most
  383. of the entries.  Such formatting is purely a matter of taste.
  384.  
  385.    Although you probably will start by creating a diary manually, Emacs
  386. provides a number of commands to let you view, add, and change diary
  387. entries.
  388.  
  389. * Menu:
  390.  
  391. * Diary Commands::         Viewing diary entries and associated calendar dates.
  392. * Format of Diary File::   Entering events in your diary.
  393. * Date Formats::       Various ways you can specify dates.
  394. * Adding to Diary::       Commands to create diary entries.
  395. * Special Diary Entries::  Anniversaries, blocks of dates, cyclic entries, etc.
  396.  
  397. 
  398. File: emacs,  Node: Diary Commands,  Next: Format of Diary File,  Up: Diary
  399.  
  400. Commands Displaying Diary Entries
  401. ---------------------------------
  402.  
  403.    Once you have created a `~/diary' file, you can use the calendar to
  404. view it.  You can also view today's events outside of Calendar mode.
  405.  
  406. `d'
  407.      Display all diary entries for the selected date
  408.      (`view-diary-entries').
  409.  
  410. `Mouse-2 Diary'
  411.      Display all diary entries for the date you click on.
  412.  
  413. `s'
  414.      Display the entire diary file (`show-all-diary-entries').
  415.  
  416. `m'
  417.      Mark all visible dates that have diary entries
  418.      (`mark-diary-entries').
  419.  
  420. `u'
  421.      Unmark the calendar window (`calendar-unmark').
  422.  
  423. `M-x print-diary-entries'
  424.      Print hard copy of the diary display as it appears.
  425.  
  426. `M-x diary'
  427.      Display all diary entries for today's date.
  428.  
  429.    Displaying the diary entries with `d' shows in a separate window the
  430. diary entries for the selected date in the calendar.  The mode line of
  431. the new window shows the date of the diary entries and any holidays
  432. that fall on that date.  If you specify a numeric argument with `d', it
  433. shows all the diary entries for that many successive days.  Thus, `2 d'
  434. displays all the entries for the selected date and for the following
  435. day.
  436.  
  437.    Another way to display the diary entries for a date is to click
  438. `Mouse-2' on the date, and then choose `Diary' from the menu that
  439. appears.
  440.  
  441.    To get a broader view of which days are mentioned in the diary, use
  442. the `m' command.  This displays the dates that have diary entries fall
  443. in a different face (or places a `+' after these dates, if display with
  444. multiple faces is not available).  The command applies both to the
  445. currently visible months and to other months that subsequently become
  446. visible by scrolling.  To turn marking off and erase the current marks,
  447. type `u', which also turns off holiday marks (*note Holidays::.).
  448.  
  449.    To see the full diary file, rather than just some of the entries, use
  450. the `s' command.
  451.  
  452.    Display of selected diary entries uses the selective display feature
  453. to hide entries that don't apply.  This is the same feature that Outline
  454. mode uses to show part of an outline (*note Outline Mode::.).
  455.  
  456.    The diary buffer as you see it is an illusion, so simply printing the
  457. buffer does not print what you see on your screen.  There is a special
  458. command to print hard copy of the diary buffer *as it appears*; this
  459. command is `M-x print-diary-entries'.  It sends the data directly to
  460. the printer.  You can customize it like `lpr-region' (*note
  461. Hardcopy::.).
  462.  
  463.    The command `M-x diary' displays the diary entries for the current
  464. date, independently of the calendar display, and optionally for the next
  465. few days as well; the variable `number-of-diary-entries' specifies how
  466. many days to include.  *Note Calendar/Diary Options:
  467. (elisp)Calendar/Diary Options.
  468.  
  469.    If you put `(diary)' in your `.emacs' file, this automatically
  470. displays a window with the day's diary entries, when you enter Emacs.
  471. The mode line of the displayed window shows the date and any holidays
  472. that fall on that date.
  473.  
  474. 
  475. File: emacs,  Node: Format of Diary File,  Next: Date Formats,  Prev: Diary Commands,  Up: Diary
  476.  
  477. The Diary File
  478. --------------
  479.  
  480.    Your "diary file" is a file that records events associated with
  481. particular dates.  The name of the diary file is specified by the
  482. variable `diary-file'; `~/diary' is the default.  The `calendar'
  483. utility program supports a subset of the format allowed by the Emacs
  484. diary facilities, so you can use that utility to view the diary file,
  485. with reasonable results aside from the entries it cannot understand.
  486.  
  487.    Each entry in the diary file describes one event and consists of one
  488. or more lines.  An entry always begins with a date specification at the
  489. left margin.  The rest of the entry is simply text to describe the
  490. event.  If the entry has more than one line, then the lines after the
  491. first must begin with whitespace to indicate they continue a previous
  492. entry.  Lines that do not begin with valid dates and do not continue a
  493. preceding entry are ignored.
  494.  
  495.    You can inhibit the marking of certain diary entries in the calendar
  496. window; to do this, insert an ampersand (`&') at the beginning of the
  497. entry, before the date.  This has no effect on display of the entry in
  498. the diary window; it affects only marks on dates in the calendar
  499. window.  Nonmarking entries are especially useful for generic entries
  500. that would otherwise mark many different dates.
  501.  
  502.    If the first line of a diary entry consists only of the date or day
  503. name with no following blanks or punctuation, then the diary window
  504. display doesn't include that line; only the continuation lines appear.
  505. For example, this entry:
  506.  
  507.      02/11/1989
  508.            Bill B. visits Princeton today
  509.            2pm Cognitive Studies Committee meeting
  510.            2:30-5:30 Liz at Lawrenceville
  511.            4:00pm Dentist appt
  512.            7:30pm Dinner at George's
  513.            8:00-10:00pm concert
  514.  
  515. appears in the diary window without the date line at the beginning.
  516. This style of entry looks neater when you display just a single day's
  517. entries, but can cause confusion if you ask for more than one day's
  518. entries.
  519.  
  520.    You can edit the diary entries as they appear in the window, but it
  521. is important to remember that the buffer displayed contains the *entire*
  522. diary file, with portions of it concealed from view.  This means, for
  523. instance, that the `C-f' (`forward-char') command can put point at what
  524. appears to be the end of the line, but what is in reality the middle of
  525. some concealed line.
  526.  
  527.    *Be careful when editing the diary entries!*  Inserting additional
  528. lines or adding/deleting characters in the middle of a visible line
  529. cannot cause problems, but editing at the end of a line may not do what
  530. you expect.  Deleting a line may delete other invisible entries that
  531. follow it.  Before editing the diary, it is best to display the entire
  532. file with `s' (`show-all-diary-entries').
  533.  
  534. 
  535. File: emacs,  Node: Date Formats,  Next: Adding to Diary,  Prev: Format of Diary File,  Up: Diary
  536.  
  537. Date Formats
  538. ------------
  539.  
  540.    Here are some sample diary entries, illustrating different ways of
  541. formatting a date.  The examples all show dates in American order
  542. (month, day, year), but Calendar mode supports European order (day,
  543. month, year) as an option.
  544.  
  545.      4/20/93  Switch-over to new tabulation system
  546.      apr. 25  Start tabulating annual results
  547.      4/30  Results for April are due
  548.      */25  Monthly cycle finishes
  549.      Friday  Don't leave without backing up files
  550.  
  551.    The first entry appears only once, on April 20, 1993.  The second and
  552. third appear every year on the specified dates, and the fourth uses a
  553. wildcard (asterisk) for the month, so it appears on the 25th of every
  554. month.  The final entry appears every week on Friday.
  555.  
  556.    You can use just numbers to express a date, as in `MONTH/DAY' or
  557. `MONTH/DAY/YEAR'.  This must be followed by a nondigit.  In the date
  558. itself, MONTH and DAY are numbers of one or two digits.  The optional
  559. YEAR is also a number, and may be abbreviated to the last two digits;
  560. that is, you can use `11/12/1989' or `11/12/89'.
  561.  
  562.    Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
  563. YEAR', where the month's name can be spelled in full or abbreviated to
  564. three characters (with or without a period).  Case is not significant.
  565.  
  566.    A date may be "generic"; that is, partially unspecified.  Then the
  567. entry applies to all dates that match the specification.  If the date
  568. does not contain a year, it is generic and applies to any year.
  569. Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any
  570. month, day, or year, respectively.  Thus, a diary entry `3/*/*' matches
  571. any day in March of any year; so does `march *'.
  572.  
  573.    If you prefer the European style of writing dates--in which the day
  574. comes before the month--type `M-x european-calendar' while in the
  575. calendar, or set the variable `european-calendar-style' to `t' *before*
  576. using any calendar or diary command.  This mode interprets all dates in
  577. the diary in the European manner, and also uses European style for
  578. displaying diary dates.  (Note that there is no comma after the
  579. MONTHNAME in the European style.)  To go back to the (default) American
  580. style of writing dates, type `M-x american-calendar'.
  581.  
  582.    You can use the name of a day of the week as a generic date which
  583. applies to any date falling on that day of the week.  You can abbreviate
  584. the day of the week to three letters (with or without a period) or spell
  585. it in full; case is not significant.
  586.  
  587. 
  588. File: emacs,  Node: Adding to Diary,  Next: Special Diary Entries,  Prev: Date Formats,  Up: Diary
  589.  
  590. Commands to Add to the Diary
  591. ----------------------------
  592.  
  593.    While in the calendar, there are several commands to create diary
  594. entries:
  595.  
  596. `i d'
  597.      Add a diary entry for the selected date (`insert-diary-entry').
  598.  
  599. `i w'
  600.      Add a diary entry for the selected day of the week
  601.      (`insert-weekly-diary-entry').
  602.  
  603. `i m'
  604.      Add a diary entry for the selected day of the month
  605.      (`insert-monthly-diary-entry').
  606.  
  607. `i y'
  608.      Add a diary entry for the selected day of the year
  609.      (`insert-yearly-diary-entry').
  610.  
  611.    You can make a diary entry for a specific date by selecting that date
  612. in the calendar window and typing the `i d' command.  This command
  613. displays the end of your diary file in another window and inserts the
  614. date; you can then type the rest of the diary entry.
  615.  
  616.    If you want to make a diary entry that applies to a specific day of
  617. the week, select that day of the week (any occurrence will do) and type
  618. `i w'.  This inserts the day-of-week as a generic date; you can then
  619. type the rest of the diary entry.  You can make a monthly diary entry in
  620. the same fashion.  Select the day of the month, use the `i m' command,
  621. and type rest of the entry.  Similarly, you can insert a yearly diary
  622. entry with the `i y' command.
  623.  
  624.    All of the above commands make marking diary entries by default.  To
  625. make a nonmarking diary entry, give a numeric argument to the command.
  626. For example, `C-u i w' makes a nonmarking weekly diary entry.
  627.  
  628.    When you modify the diary file, be sure to save the file before
  629. exiting Emacs.
  630.  
  631. 
  632. File: emacs,  Node: Special Diary Entries,  Prev: Adding to Diary,  Up: Diary
  633.  
  634. Special Diary Entries
  635. ---------------------
  636.  
  637.    In addition to entries based on calendar dates, the diary file can
  638. contain "special entries" for regular events such as anniversaries.
  639. These entries are based on Lisp expressions (sexps) that Emacs evaluates
  640. as it scans the diary file.  Instead of a date, a special entry contains
  641. `%%' followed by a Lisp expression which must begin and end with
  642. parentheses.  The Lisp expression determines which dates the entry
  643. applies to.
  644.  
  645.    Calendar mode provides commands to insert certain commonly used
  646. special entries:
  647.  
  648. `i a'
  649.      Add an anniversary diary entry for the selected date
  650.      (`insert-anniversary-diary-entry').
  651.  
  652. `i b'
  653.      Add a block diary entry for the current region
  654.      (`insert-block-diary-entry').
  655.  
  656. `i c'
  657.      Add a cyclic diary entry starting at the date
  658.      (`insert-cyclic-diary-entry').
  659.  
  660.    If you want to make a diary entry that applies to the anniversary of
  661. a specific date, move point to that date and use the `i a' command.
  662. This displays the end of your diary file in another window and inserts
  663. the anniversary description; you can then type the rest of the diary
  664. entry.  The entry looks like this:
  665.  
  666.      %%(diary-anniversary 10 31 1948) Arthur's birthday
  667.  
  668. This entry applies to October 31 in any year after 1948; `10 31 1948'
  669. specifies the date.  (If you are using the European calendar style, the
  670. month and day are interchanged.)  The reason this expression requires a
  671. beginning year is that advanced diary functions can use it to calculate
  672. the number of elapsed years.
  673.  
  674.    A "block" diary entry applies to a specified range of consecutive
  675. dates.  Here is a block diary entry that applies to all dates from June
  676. 24, 1990 through July 10, 1990:
  677.  
  678.      %%(diary-block 6 24 1990 7 10 1990) Vacation
  679.  
  680. The `6 24 1990' indicates the starting date and the `7 10 1990'
  681. indicates the stopping date.  (Again, if you are using the European
  682. calendar style, the month and day are interchanged.)
  683.  
  684.    To insert a block entry, place point and the mark on the two dates
  685. that begin and end the range, and type `i b'.  This command displays
  686. the end of your diary file in another window and inserts the block
  687. description; you can then type the diary entry.
  688.  
  689.    "Cyclic" diary entries repeat after a fixed interval of days.  To
  690. create one, select the starting date and use the `i c' command.  The
  691. command prompts for the length of interval, then inserts the entry,
  692. which looks like this:
  693.  
  694.      %%(diary-cyclic 50 3 1 1990) Renew medication
  695.  
  696. This entry applies to March 1, 1990 and every 50th day following; `3 1
  697. 1990' specifies the starting date.  (If you are using the European
  698. calendar style, the month and day are interchanged.)
  699.  
  700.    All three of these commands make marking diary entries.  To insert a
  701. nonmarking entry, give a numeric argument to the command.  For example,
  702. `C-u i a' makes a nonmarking anniversary diary entry.
  703.  
  704.    Marking sexp diary entries in the calendar is *extremely*
  705. time-consuming, since every date visible in the calendar window must be
  706. individually checked.  So it's a good idea to make sexp diary entries
  707. nonmarking (with `&') when possible.
  708.  
  709.    Another sophisticated kind of sexp entry, a "floating" diary entry,
  710. specifies a regularly-occurring event by offsets specified in days,
  711. weeks, and months.  It is comparable to a crontab entry interpreted by
  712. the `cron' utility.  Here is a nonmarking, floating diary entry that
  713. applies to the last Thursday in November:
  714.  
  715.      &%%(diary-float 11 4 -1) American Thanksgiving
  716.  
  717. The 11 specifies November (the eleventh month), the 4 specifies Thursday
  718. (the fourth day of the week, where Sunday is numbered zero), and the -1
  719. specifies "last" (1 would mean "first", 2 would mean "second", -2 would
  720. mean "second-to-last", and so on).  The month can be a single month or
  721. a list of months.  Thus you could change the 11 above to `'(1 2 3)' and
  722. have the entry apply to the last Thursday of January, February, and
  723. March.  If the month is `t', the entry applies to all months of the
  724. year.
  725.  
  726.    Most generally, special diary entries can perform arbitrary
  727. computations to determine when they apply.  *Note Sexp Diary Entries:
  728. (elisp)Sexp Diary Entries.
  729.  
  730. 
  731. File: emacs,  Node: Appointments,  Next: Daylight Savings,  Prev: Diary,  Up: Calendar/Diary
  732.  
  733. Appointments
  734. ============
  735.  
  736.    If you have a diary entry for an appointment, and that diary entry
  737. begins with a recognizable time of day, Emacs can warn you, several
  738. minutes beforehand, that that appointment is pending.  Emacs alerts you
  739. to the appointment by displaying a message in the mode line.
  740.  
  741.    To enable appointment notification, you must enable the time display
  742. feature of Emacs, `M-x display-time' (*note Mode Line::.).  You must
  743. also add the function `appt-make-list' to the `diary-hook', like this:
  744.  
  745.      (add-hook 'diary-hook 'appt-make-list)
  746.  
  747.    With these preparations done, when you display the diary (either with
  748. the `d' command in the calendar window or with the `M-x diary'
  749. command), it sets up an appointment list of all the diary entries found
  750. with recognizable times of day, and reminds you just before each of
  751. them.
  752.  
  753.    For example, suppose the diary file contains these lines:
  754.  
  755.      Monday
  756.        9:30am Coffee break
  757.       12:00pm Lunch
  758.  
  759. Then on Mondays, after you have displayed the diary, you will be
  760. reminded at 9:20am about your coffee break and at 11:50am about lunch.
  761.  
  762.    You can write times in conventional American am/pm style, or 24-hour
  763. European/military style.  You need not be consistent; your diary file
  764. can have a mixture of the two styles.
  765.  
  766.    Emacs updates the appointments list automatically just after
  767. midnight.  This also displays the next day's diary entries in the diary
  768. buffer, unless you set `appt-display-diary' to `nil'.
  769.  
  770.    You can also use the appointment notification facility like an alarm
  771. clock.  The command `M-x appt-add' adds entries to the appointment list
  772. without affecting your diary file.  You delete entries from the
  773. appointment list with `M-x appt-delete'.
  774.  
  775.    You can turn off the appointment notification feature at any time by
  776. setting `appt-issue-message' to `nil'.
  777.  
  778. 
  779. File: emacs,  Node: Daylight Savings,  Prev: Appointments,  Up: Calendar/Diary
  780.  
  781. Daylight Savings Time
  782. =====================
  783.  
  784.    Emacs understands the difference between standard time and daylight
  785. savings time--the times given for sunrise, sunset, solstices,
  786. equinoxes, and the phases of the moon take that into account.  The rules
  787. for daylight savings time vary from place to place and have also varied
  788. historically from year to year.  To do the job properly, Emacs needs to
  789. know which rules to use.
  790.  
  791.    Some operating systems keep track of the rules that apply to the
  792. place where you are; on these systems, Emacs gets the information it
  793. needs from the system automatically.  If some or all of this
  794. information is missing, Emacs fills in the gaps with the rules
  795. currently used in Cambridge, Massachusetts.  If the resulting rules are
  796. not what you want, you can tell Emacs the rules to use by setting
  797. certain variables.
  798.  
  799.    These values should be Lisp expressions that refer to the variable
  800. `year', and evaluate to the Gregorian date on which daylight savings
  801. time starts or (respectively) ends, in the form of a list `(MONTH DAY
  802. YEAR)'.  The values should be `nil' if your area does not use daylight
  803. savings time.
  804.  
  805.    Emacs uses these expressions to determine the starting date of
  806. daylight savings time for the holiday list and for correcting times of
  807. day in the solar and lunar calculations.
  808.  
  809.    The values for Cambridge, Massachusetts are as follows:
  810.  
  811.      (calendar-nth-named-day 1 0 4 year)
  812.      (calendar-nth-named-day -1 0 10 year)
  813.  
  814. That is, the first 0th day (Sunday) of the fourth month (April) in the
  815. year specified by `year', and the last Sunday of the tenth month
  816. (October) of that year.  If daylight savings time were changed to start
  817. on October 1, you would set `calendar-daylight-savings-starts' to this:
  818.  
  819.      (list 10 1 year)
  820.  
  821.    If there is no daylight savings time at your location, or if you want
  822. all times in standard time, set `calendar-daylight-savings-starts' and
  823. `calendar-daylight-savings-ends' to `nil'.
  824.  
  825.    The variable `calendar-daylight-time-offset' specifies the
  826. difference between daylight savings time and standard time, measured in
  827. minutes.  The value for Cambridge, Massachusetts is 60.
  828.  
  829.    The two variables `calendar-daylight-savings-starts-time' and
  830. `calendar-daylight-savings-ends-time' specify the number of minutes
  831. after midnight local time when the transition to and from daylight
  832. savings time should occur.  For Cambridge, both variables' values are
  833. 120.
  834.  
  835. 
  836. File: emacs,  Node: GNUS,  Next: Shell,  Prev: Calendar/Diary,  Up: Top
  837.  
  838. GNUS
  839. ====
  840.  
  841.    GNUS is an Emacs subsystem for reading and responding to netnews.
  842. You can use GNUS to browse through news groups, look at summaries of
  843. articles in specific group, and read articles of interest.  You can
  844. respond to authors or write replies to all the readers of a news group.
  845.  
  846.    This section introduces GNUS and describes several basic features.
  847. *Note GNUS: (gnus)Top.
  848.  
  849.    To start GNUS, type `M-x gnus RET'.
  850.  
  851. * Menu:
  852.  
  853. * Buffers of GNUS::       The Newsgroups, Summary and Article buffers.
  854. * GNUS Startup::       What you should know about starting GNUS.
  855. * Summary of GNUS::       A short description of the basic GNUS commands.
  856.  
  857. 
  858. File: emacs,  Node: Buffers of GNUS,  Next: GNUS Startup,  Up: GNUS
  859.  
  860. GNUS's Three Buffers
  861. --------------------
  862.  
  863.    GNUS creates and uses three Emacs buffers, each with its own
  864. particular purpose and its own major mode.
  865.  
  866.    The "Newsgroup buffer" contains a list of newsgroups.  This is the
  867. first buffer that GNUS displays when it starts up.  Normally the list
  868. contains only the newsgroups to which you subscribe (which are listed in
  869. your `.newsrc' file) and which contain unread articles.  Use this
  870. buffer to select a specific newsgroup.
  871.  
  872.    The "Summary buffer" lists the articles in a single newsgroup,
  873. including their subjects, their numbers, and who posted them.  GNUS
  874. creates a Summary buffer for a newsgroup when you select the group in
  875. the Newsgroup buffer.  Use this buffer to select an article.
  876.  
  877.    The "Article buffer" displays the text of an article.  You rarely
  878. need to select this buffer because you can scroll through it while
  879. remaining in the Summary buffer.
  880.  
  881. 
  882. File: emacs,  Node: GNUS Startup,  Next: Summary of GNUS,  Prev: Buffers of GNUS,  Up: GNUS
  883.  
  884. When GNUS Starts Up
  885. -------------------
  886.  
  887.    At startup, GNUS reads your `.newsrc' news initialization file and
  888. attempts to communicate with the local news server, which is a
  889. repository of news articles.  The news server need not be the same
  890. computer you are logged in on.
  891.  
  892.    If you start GNUS and connect to the server, but do not see any
  893. newsgroups listed in the Newsgroup buffer, type `L' to get a listing of
  894. all the newsgroups.  Then type `u' to unsubscribe from the newsgroups
  895. you don't want to read.  (You can move point to a particular group
  896. using `n' and `p' or the usual Emacs commands.)
  897.  
  898.    The first time you start GNUS, it subscribes automatically to every
  899. newsgroup that exists.  Subsequently, GNUS subscribes automatically to
  900. all newly created newsgroups.  You can unsubscribe groups with `u'.
  901. You can inhibit automatic subscription by adding the following line to
  902. your `~/.newsrc' file:
  903.  
  904.      options -n !all !all.all
  905.  
  906.    When you quit GNUS with `q', it automatically records in your
  907. `.newsrc' initialization file the subscribed or unsubscribed status of
  908. all newsgroups, except for groups you have "killed".  (You do not need
  909. to edit this file yourself, but you may.)  When new newsgroups come
  910. into existence, GNUS subscribes to them automatically; if you don't
  911. want to read them, use `u' to unsubscribe from them.
  912.  
  913. 
  914. File: emacs,  Node: Summary of GNUS,  Prev: GNUS Startup,  Up: GNUS
  915.  
  916. Summary of GNUS Commands
  917. ------------------------
  918.  
  919.    Reading news is a two step process:
  920.  
  921.   1. Choose a newsgroup in the Newsgroup buffer.
  922.  
  923.   2. Select articles from the Summary buffer.  Each article selected is
  924.      displayed in the Article buffer in a large window, below the
  925.      Summary buffer in its small window.
  926.  
  927.    Each GNUS buffer has its own special commands, but commands that do
  928. the similar things have similar key bindings.  Here are commands for the
  929. Newsgroup and Summary buffers:
  930.  
  931. `z'
  932.      In the Newsgroup buffer, suspend GNUS.  You can return to GNUS
  933.      later by selecting the Newsgroup buffer and typing `g' to get
  934.      newly arrived articles.
  935.  
  936. `q'
  937.      In the Newsgroup buffer, update your `.newsrc' initialization file
  938.      and quit GNUS.
  939.  
  940.      In the Summary buffer, exit the current newsgroup and return to the
  941.      Newsgroup buffer.  Thus, typing `q' twice quits GNUS.
  942.  
  943. `L'
  944.      In the Newsgroup buffer, list all the newsgroups available on your
  945.      news server (except those you have killed).  This may be a long
  946.      list!
  947.  
  948. `l'
  949.      In the Newsgroup buffer, list only the newsgroups to which you
  950.      subscribe and which contain unread articles.
  951.  
  952. `u'
  953.      In the Newsgroup buffer, unsubscribe from (or subscribe to) the
  954.      newsgroup listed in the line that point is on.  When you quit GNUS
  955.      by typing `q', GNUS lists in your `.newsrc' file which groups you
  956.      have subscribed to.  The next time you start GNUS, you won't see
  957.      this group initially, because GNUS normally displays only
  958.      subscribed-to groups.
  959.  
  960. `C-k'
  961.      In the Newsgroup buffer, "kill" the current line's newsgroup--don't
  962.      even list it in `.newsrc' from now on.  This affects future GNUS
  963.      sessions as well as the present session.
  964.  
  965.      When you quit GNUS by typing `q', GNUS writes information in the
  966.      file `.newsrc' describing all newsgroups except those you have
  967.      "killed."
  968.  
  969. `SPC'
  970.      In the Newsgroup buffer, select the group on the line under the
  971.      cursor and display the first unread article in that group.
  972.  
  973.      In the Summary buffer,
  974.  
  975.         * Select the article on the line under the cursor if none is
  976.           selected.
  977.  
  978.         * Scroll the text of the selected article (if there is one).
  979.  
  980.         * Select the next unread article if at the end of the current
  981.           article.
  982.  
  983.      Thus, you can move through all the articles by repeatedly typing
  984.      SPC.
  985.  
  986. `DEL'
  987.      In the Newsgroup Buffer, move point to the previous newsgroup
  988.      containing unread articles.
  989.  
  990.      In the Summary buffer, scroll the text of the article backwards.
  991.  
  992. `n'
  993.      Move point to the next unread newsgroup, or select the next unread
  994.      article.
  995.  
  996. `p'
  997.      Move point to the previous unread newsgroup, or select the previous
  998.      unread article.
  999.  
  1000. `C-n'
  1001. `C-p'
  1002.      Move point to the next or previous item, even if it is marked as
  1003.      read.  This does not select the article or newsgroup on that line.
  1004.  
  1005. `s'
  1006.      In the Summary buffer, do an incremental search of the current
  1007.      text in the Article buffer, just as if you switched to the Article
  1008.      buffer and typed `C-s'.
  1009.  
  1010. `M-s REGEXP RET'
  1011.      In the Summary buffer, search forward for articles containing a
  1012.      match for REGEXP.
  1013.  
  1014. `C-c C-s C-n'
  1015. `C-c C-s C-s'
  1016. `C-c C-s C-d'
  1017. `C-c C-s C-a'
  1018.      In the Summary buffer, sort the list of articles by number,
  1019.      subject, date, or author.
  1020.  
  1021. `C-M-n'
  1022. `C-M-p'
  1023.      In the Summary buffer, read the next or previous article with the
  1024.      same subject as the current article.
  1025.  
  1026. 
  1027. File: emacs,  Node: Shell,  Next: Emacs Server,  Prev: GNUS,  Up: Top
  1028.  
  1029. Running Shell Commands from Emacs
  1030. =================================
  1031.  
  1032.    Emacs has commands for passing single command lines to inferior shell
  1033. processes; it can also run a shell interactively with input and output
  1034. to an Emacs buffer named `*shell*'.
  1035.  
  1036. `M-! CMD RET'
  1037.      Run the shell command line CMD and display the output
  1038.      (`shell-command').
  1039.  
  1040. `M-| CMD RET'
  1041.      Run the shell command line CMD with region contents as input;
  1042.      optionally replace the region with the output
  1043.      (`shell-command-on-region').
  1044.  
  1045. `M-x shell'
  1046.      Run a subshell with input and output through an Emacs buffer.  You
  1047.      can then give commands interactively.
  1048.  
  1049. * Menu:
  1050.  
  1051. * Single Shell::           How to run one shell command and return.
  1052. * Interactive Shell::      Permanent shell taking input via Emacs.
  1053. * Shell Mode::             Special Emacs commands used with permanent shell.
  1054. * History: Shell History.  Repeating previous commands in a shell buffer.
  1055. * Options: Shell Options.  Options for customizing Shell mode.
  1056. * Remote Host::            Connecting to another computer.
  1057.  
  1058. 
  1059. File: emacs,  Node: Single Shell,  Next: Interactive Shell,  Up: Shell
  1060.  
  1061. Single Shell Commands
  1062. ---------------------
  1063.  
  1064.    `M-!' (`shell-command') reads a line of text using the minibuffer
  1065. executes it as a shell command in a subshell made just for this
  1066. command.  Standard input for the command comes from the null device.
  1067. If the shell command produces any output, the output goes into an Emacs
  1068. buffer named `*Shell Command Output*', which is displayed in another
  1069. window but not selected.  A numeric argument, as in `M-1 M-!', directs
  1070. this command to insert any output into the current buffer.  In that
  1071. case, point is left before the output and the mark is set after the
  1072. output.
  1073.  
  1074.    If the shell command line ends in `&', it runs asynchronously.
  1075.  
  1076.    `M-|' (`shell-command-on-region') is like `M-!' but passes the
  1077. contents of the region as the standard input to the shell command,
  1078. instead of no input.  If a numeric argument is used, meaning insert the
  1079. output in the current buffer, then the old region is deleted first and
  1080. the output replaces it as the contents of the region.
  1081.  
  1082.    Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
  1083. use.  This variable is initialized based on your `SHELL' environment
  1084. variable when Emacs is started.  If the file name does not specify a
  1085. directory, the directories in the list `exec-path' are searched; this
  1086. list is initialized based on the environment variable `PATH' when Emacs
  1087. is started.  Your `.emacs' file can override either or both of these
  1088. default initializations.
  1089.  
  1090.    Both `M-!' and `M-|' wait for the shell command to complete.  To
  1091. stop waiting, type `C-g' to quit; that terminates the shell command
  1092. with the signal `SIGINT'--the same signal that `C-c' normally generates
  1093. in the shell.  Emacs waits until the command actually terminates.  If
  1094. the shell command doesn't stop (because it ignores the `SIGINT'
  1095. signal), type `C-g' again; this sends the command a `SIGKILL' signal
  1096. which is impossible to ignore.
  1097.  
  1098. 
  1099. File: emacs,  Node: Interactive Shell,  Next: Shell Mode,  Prev: Single Shell,  Up: Shell
  1100.  
  1101. Interactive Inferior Shell
  1102. --------------------------
  1103.  
  1104.    To run a subshell interactively, putting its typescript in an Emacs
  1105. buffer, use `M-x shell'.  This creates (or reuses) a buffer named
  1106. `*shell*' and runs a subshell with input coming from and output going
  1107. to that buffer.  That is to say, any "terminal output" from the subshell
  1108. goes into the buffer, advancing point, and any "terminal input" for the
  1109. subshell comes from text in the buffer.  To give input to the subshell,
  1110. go to the end of the buffer and type the input, terminated by RET.
  1111.  
  1112.    Emacs does not wait for the subshell to do anything.  You can switch
  1113. windows or buffers and edit them while the shell is waiting, or while
  1114. it is running a command.  Output from the subshell waits until Emacs
  1115. has time to process it; this happens whenever Emacs is waiting for
  1116. keyboard input or for time to elapse.
  1117.  
  1118.    To make multiple subshells, rename the buffer `*shell*' to something
  1119. different using `M-x rename-uniquely'.  Then type `M-x shell' again to
  1120. create a new buffer `*shell*' with its own subshell.  If you rename
  1121. this buffer as well, you can create a third one, and so on.  All the
  1122. subshells run independently and in parallel.
  1123.  
  1124.    The file name used to load the subshell is the value of the variable
  1125. `explicit-shell-file-name', if that is non-`nil'.  Otherwise, the
  1126. environment variable `ESHELL' is used, or the environment variable
  1127. `SHELL' if there is no `ESHELL'.  If the file name specified is
  1128. relative, the directories in the list `exec-path' are searched; this
  1129. list is initialized based on the environment variable `PATH' when Emacs
  1130. is started.  Your `.emacs' file can override either or both of these
  1131. default initializations.
  1132.  
  1133.    As soon as the subshell is started, it is sent as input the contents
  1134. of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME
  1135. is the name of the file that the shell was loaded from.  For example,
  1136. if you use bash, the file sent to it is `~/.emacs_bash'.
  1137.  
  1138.    `cd', `pushd' and `popd' commands given to the inferior shell are
  1139. watched by Emacs so it can keep the `*shell*' buffer's default
  1140. directory the same as the shell's working directory.  These commands
  1141. are recognized syntactically by examining lines of input that are sent.
  1142. If you use aliases for these commands, you can tell Emacs to recognize
  1143. them also.  For example, if the value of the variable
  1144. `shell-pushd-regexp' matches the beginning of a shell command line,
  1145. that line is regarded as a `pushd' command.  Change this variable when
  1146. you add aliases for `pushd'.  Likewise, `shell-popd-regexp' and
  1147. `shell-cd-regexp' are used to recognize commands with the meaning of
  1148. `popd' and `cd'.  These commands are recognized only at the beginning
  1149. of a shell command line.
  1150.  
  1151.    If Emacs gets an error while trying to handle what it believes is a
  1152. `cd', `pushd' or `popd' command, it runs the hook
  1153. `shell-set-directory-error-hook' (*note Hooks::.).
  1154.  
  1155.    If Emacs does not properly track changes in the current directory of
  1156. the subshell, use the command `M-x dirs' to ask the shell what its
  1157. current directory is.  This command works for shells that support the
  1158. most common command syntax; it may not work for unusual shells.
  1159.  
  1160.