home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-19.28-src.tgz / tar.out / fsf / emacs / info / emacs-15 (.txt) < prev    next >
GNU Info File  |  1996-09-28  |  49KB  |  892 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Mayan Calendar,  Prev: From Other Calendar,  Up: Other Calendars
  4. Converting from the Mayan Calendar
  5. ----------------------------------
  6.    Here are the commands to select dates based on the Mayan calendar:
  7. `g m l'
  8.      Move to a date specified by the long count calendar
  9.      (`calendar-goto-mayan-long-count-date').
  10. `g m n t'
  11.      Move to the next occurrence of a place in the tzolkin calendar
  12.      (`calendar-next-tzolkin-date').
  13. `g m p t'
  14.      Move to the previous occurrence of a place in the tzolkin calendar
  15.      (`calendar-previous-tzolkin-date').
  16. `g m n h'
  17.      Move to the next occurrence of a place in the haab calendar
  18.      (`calendar-next-haab-date').
  19. `g m p h'
  20.      Move to the previous occurrence of a place in the haab calendar
  21.      (`calendar-previous-haab-date').
  22. `g m n c'
  23.      Move to the next occurrence of a place in the calendar round
  24.      (`calendar-next-calendar-round-date').
  25. `g m p c'
  26.      Move to the previous occurrence of a place in the calendar round
  27.      (`calendar-previous-calendar-round-date').
  28.    To understand these commands, you need to understand the Mayan
  29. calendars.  The "long count" is a counting of days with these units:
  30.      1 kin = 1 day   1 uinal = 20 kin   1 tun = 18 uinal
  31.      1 katun = 20 tun   1 baktun = 20 katun
  32. Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
  33. tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
  34. count dates as early as 7.17.18.13.1, but no earlier.  When you use the
  35. `g m l' command, type the Mayan long count date with the baktun, katun,
  36. tun, uinal, and kin separated by periods.
  37.    The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of
  38. independent cycles of 13 and 20 days.  Since this cycle repeats
  39. endlessly, Emacs provides commands to move backward and forward to the
  40. previous or next point in the cycle.  Type `g m p t' to go to the
  41. previous tzolkin date; Emacs asks you for a tzolkin date and moves point
  42. to the previous occurrence of that date.  Similarly, type `g m n t' to
  43. go to the next occurrence of a tzolkin date.
  44.    The Mayan haab calendar is a cycle of 365 days arranged as 18 months
  45. of 20 days each, followed a 5-day monthless period.  Like the tzolkin
  46. cycle, this cycle repeats endlessly, and there are commands to move
  47. backward and forward to the previous or next point in the cycle.  Type
  48. `g m p h' to go to the previous haab date; Emacs asks you for a haab
  49. date and moves point to the previous occurrence of that date.
  50. Similarly, type `g m n h' to go to the next occurrence of a haab date.
  51.    The Maya also used the combination of the tzolkin date and the haab
  52. date.  This combination is a cycle of about 52 years called a *calendar
  53. round*.  If you type `g m p c', Emacs asks you for both a haab and a
  54. tzolkin date and then moves point to the previous occurrence of that
  55. combination.  Use `g m p c' to move point to the next occurrence of a
  56. combination.  These commands signal an error if the haab/tzolkin date
  57. combination you have typed is impossible.
  58.    Emacs uses strict completion (*note Strict Completion::.) whenever it
  59. asks you to type a Mayan name, so you don't have to worry about
  60. spelling.
  61. File: emacs,  Node: Diary,  Next: Appointments,  Prev: Other Calendars,  Up: Calendar/Diary
  62. The Diary
  63. =========
  64.    The Emacs diary keeps track of appointments or other events on a
  65. daily basis, in conjunction with the calendar.  To use the diary
  66. feature, you must first create a "diary file" containing a list of
  67. events and their dates.  Then Emacs can automatically pick out and
  68. display the events for today, for the immediate future, or for any
  69. specified date.
  70.    By default, Emacs uses `~/diary' as the diary file.  This is the
  71. same file that the `calendar' utility uses.  A sample `~/diary' file is:
  72.      12/22/1988  Twentieth wedding anniversary!!
  73.      &1/1.       Happy New Year!
  74.      10/22       Ruth's birthday.
  75.      * 21, *:    Payday
  76.      Tuesday--weekly meeting with grad students at 10am
  77.               Supowit, Shen, Bitner, and Kapoor to attend.
  78.      1/13/89     Friday the thirteenth!!
  79.      &thu 4pm    squash game with Lloyd.
  80.      mar 16      Dad's birthday
  81.      April 15, 1989 Income tax due.
  82.      &* 15       time cards due.
  83. This example uses extra spaces to align the event descriptions of most
  84. of the entries.  Such formatting is purely a matter of taste.
  85.    Although you probably will start by creating a diary manually, Emacs
  86. provides a number of commands to let you view, add, and change diary
  87. entries.
  88. * Menu:
  89. * Diary Commands::         Viewing diary entries and associated calendar dates.
  90. * Format of Diary File::   Entering events in your diary.
  91. * Date Formats::       Various ways you can specify dates.
  92. * Adding to Diary::       Commands to create diary entries.
  93. * Special Diary Entries::  Anniversaries, blocks of dates, cyclic entries, etc.
  94. File: emacs,  Node: Diary Commands,  Next: Format of Diary File,  Up: Diary
  95. Commands Displaying Diary Entries
  96. ---------------------------------
  97.    Once you have created a `~/diary' file, you can use the calendar to
  98. view it.  You can also view today's events outside of Calendar mode.
  99.      Display all diary entries for the selected date
  100.      (`view-diary-entries').
  101. `Mouse-2 Diary'
  102.      Display all diary entries for the date you click on.
  103.      Display the entire diary file (`show-all-diary-entries').
  104.      Mark all visible dates that have diary entries
  105.      (`mark-diary-entries').
  106.      Unmark the calendar window (`calendar-unmark').
  107. `M-x print-diary-entries'
  108.      Print hard copy of the diary display as it appears.
  109. `M-x diary'
  110.      Display all diary entries for today's date.
  111.    Displaying the diary entries with `d' shows in a separate window the
  112. diary entries for the selected date in the calendar.  The mode line of
  113. the new window shows the date of the diary entries and any holidays
  114. that fall on that date.  If you specify a numeric argument with `d', it
  115. shows all the diary entries for that many successive days.  Thus, `2 d'
  116. displays all the entries for the selected date and for the following
  117.    Another way to display the diary entries for a date is to click
  118. `Mouse-2' on the date, and then choose `Diary' from the menu that
  119. appears.
  120.    To get a broader view of which days are mentioned in the diary, use
  121. the `m' command.  This displays the dates that have diary entries fall
  122. in a different face (or places a `+' after these dates, if display with
  123. multiple faces is not available).  The command applies both to the
  124. currently visible months and to other months that subsequently become
  125. visible by scrolling.  To turn marking off and erase the current marks,
  126. type `u', which also turns off holiday marks (*note Holidays::.).
  127.    To see the full diary file, rather than just some of the entries, use
  128. the `s' command.
  129.    Display of selected diary entries uses the selective display feature
  130. to hide entries that don't apply.  This is the same feature that Outline
  131. mode uses to show part of an outline (*note Outline Mode::.).
  132.    The diary buffer as you see it is an illusion, so simply printing the
  133. buffer does not print what you see on your screen.  There is a special
  134. command to print hard copy of the diary buffer *as it appears*; this
  135. command is `M-x print-diary-entries'.  It sends the data directly to
  136. the printer.  You can customize it like `lpr-region' (*note
  137. Hardcopy::.).
  138.    The command `M-x diary' displays the diary entries for the current
  139. date, independently of the calendar display, and optionally for the next
  140. few days as well; the variable `number-of-diary-entries' specifies how
  141. many days to include.  *Note Calendar/Diary Options:
  142. (elisp)Calendar/Diary Options.
  143.    If you put `(diary)' in your `.emacs' file, this automatically
  144. displays a window with the day's diary entries, when you enter Emacs.
  145. The mode line of the displayed window shows the date and any holidays
  146. that fall on that date.
  147. File: emacs,  Node: Format of Diary File,  Next: Date Formats,  Prev: Diary Commands,  Up: Diary
  148. The Diary File
  149. --------------
  150.    Your "diary file" is a file that records events associated with
  151. particular dates.  The name of the diary file is specified by the
  152. variable `diary-file'; `~/diary' is the default.  The `calendar'
  153. utility program supports a subset of the format allowed by the Emacs
  154. diary facilities, so you can use that utility to view the diary file,
  155. with reasonable results aside from the entries it cannot understand.
  156.    Each entry in the diary file describes one event and consists of one
  157. or more lines.  An entry always begins with a date specification at the
  158. left margin.  The rest of the entry is simply text to describe the
  159. event.  If the entry has more than one line, then the lines after the
  160. first must begin with whitespace to indicate they continue a previous
  161. entry.  Lines that do not begin with valid dates and do not continue a
  162. preceding entry are ignored.
  163.    You can inhibit the marking of certain diary entries in the calendar
  164. window; to do this, insert an ampersand (`&') at the beginning of the
  165. entry, before the date.  This has no effect on display of the entry in
  166. the diary window; it affects only marks on dates in the calendar
  167. window.  Nonmarking entries are especially useful for generic entries
  168. that would otherwise mark many different dates.
  169.    If the first line of a diary entry consists only of the date or day
  170. name with no following blanks or punctuation, then the diary window
  171. display doesn't include that line; only the continuation lines appear.
  172. For example, this entry:
  173.      02/11/1989
  174.            Bill B. visits Princeton today
  175.            2pm Cognitive Studies Committee meeting
  176.            2:30-5:30 Liz at Lawrenceville
  177.            4:00pm Dentist appt
  178.            7:30pm Dinner at George's
  179.            8:00-10:00pm concert
  180. appears in the diary window without the date line at the beginning.
  181. This style of entry looks neater when you display just a single day's
  182. entries, but can cause confusion if you ask for more than one day's
  183. entries.
  184.    You can edit the diary entries as they appear in the window, but it
  185. is important to remember that the buffer displayed contains the *entire*
  186. diary file, with portions of it concealed from view.  This means, for
  187. instance, that the `C-f' (`forward-char') command can put point at what
  188. appears to be the end of the line, but what is in reality the middle of
  189. some concealed line.
  190.    *Be careful when editing the diary entries!*  Inserting additional
  191. lines or adding/deleting characters in the middle of a visible line
  192. cannot cause problems, but editing at the end of a line may not do what
  193. you expect.  Deleting a line may delete other invisible entries that
  194. follow it.  Before editing the diary, it is best to display the entire
  195. file with `s' (`show-all-diary-entries').
  196. File: emacs,  Node: Date Formats,  Next: Adding to Diary,  Prev: Format of Diary File,  Up: Diary
  197. Date Formats
  198. ------------
  199.    Here are some sample diary entries, illustrating different ways of
  200. formatting a date.  The examples all show dates in American order
  201. (month, day, year), but Calendar mode supports European order (day,
  202. month, year) as an option.
  203.      4/20/93  Switch-over to new tabulation system
  204.      apr. 25  Start tabulating annual results
  205.      4/30  Results for April are due
  206.      */25  Monthly cycle finishes
  207.      Friday  Don't leave without backing up files
  208.    The first entry appears only once, on April 20, 1993.  The second and
  209. third appear every year on the specified dates, and the fourth uses a
  210. wildcard (asterisk) for the month, so it appears on the 25th of every
  211. month.  The final entry appears every week on Friday.
  212.    You can use just numbers to express a date, as in `MONTH/DAY' or
  213. `MONTH/DAY/YEAR'.  This must be followed by a nondigit.  In the date
  214. itself, MONTH and DAY are numbers of one or two digits.  The optional
  215. YEAR is also a number, and may be abbreviated to the last two digits;
  216. that is, you can use `11/12/1989' or `11/12/89'.
  217.    Dates can also have the form `MONTHNAME DAY' or `MONTHNAME DAY,
  218. YEAR', where the month's name can be spelled in full or abbreviated to
  219. three characters (with or without a period).  Case is not significant.
  220.    A date may be "generic"; that is, partially unspecified.  Then the
  221. entry applies to all dates that match the specification.  If the date
  222. does not contain a year, it is generic and applies to any year.
  223. Alternatively, MONTH, DAY, or YEAR can be a `*'; this matches any
  224. month, day, or year, respectively.  Thus, a diary entry `3/*/*' matches
  225. any day in March of any year; so does `march *'.
  226.    If you prefer the European style of writing dates--in which the day
  227. comes before the month--type `M-x european-calendar' while in the
  228. calendar, or set the variable `european-calendar-style' to `t' *before*
  229. using any calendar or diary command.  This mode interprets all dates in
  230. the diary in the European manner, and also uses European style for
  231. displaying diary dates.  (Note that there is no comma after the
  232. MONTHNAME in the European style.)  To go back to the (default) American
  233. style of writing dates, type `M-x american-calendar'.
  234.    You can use the name of a day of the week as a generic date which
  235. applies to any date falling on that day of the week.  You can abbreviate
  236. the day of the week to three letters (with or without a period) or spell
  237. it in full; case is not significant.
  238. File: emacs,  Node: Adding to Diary,  Next: Special Diary Entries,  Prev: Date Formats,  Up: Diary
  239. Commands to Add to the Diary
  240. ----------------------------
  241.    While in the calendar, there are several commands to create diary
  242. entries:
  243. `i d'
  244.      Add a diary entry for the selected date (`insert-diary-entry').
  245. `i w'
  246.      Add a diary entry for the selected day of the week
  247.      (`insert-weekly-diary-entry').
  248. `i m'
  249.      Add a diary entry for the selected day of the month
  250.      (`insert-monthly-diary-entry').
  251. `i y'
  252.      Add a diary entry for the selected day of the year
  253.      (`insert-yearly-diary-entry').
  254.    You can make a diary entry for a specific date by selecting that date
  255. in the calendar window and typing the `i d' command.  This command
  256. displays the end of your diary file in another window and inserts the
  257. date; you can then type the rest of the diary entry.
  258.    If you want to make a diary entry that applies to a specific day of
  259. the week, select that day of the week (any occurrence will do) and type
  260. `i w'.  This inserts the day-of-week as a generic date; you can then
  261. type the rest of the diary entry.  You can make a monthly diary entry in
  262. the same fashion.  Select the day of the month, use the `i m' command,
  263. and type rest of the entry.  Similarly, you can insert a yearly diary
  264. entry with the `i y' command.
  265.    All of the above commands make marking diary entries by default.  To
  266. make a nonmarking diary entry, give a numeric argument to the command.
  267. For example, `C-u i w' makes a nonmarking weekly diary entry.
  268.    When you modify the diary file, be sure to save the file before
  269. exiting Emacs.
  270. File: emacs,  Node: Special Diary Entries,  Prev: Adding to Diary,  Up: Diary
  271. Special Diary Entries
  272. ---------------------
  273.    In addition to entries based on calendar dates, the diary file can
  274. contain "special entries" for regular events such as anniversaries.
  275. These entries are based on Lisp expressions (sexps) that Emacs evaluates
  276. as it scans the diary file.  Instead of a date, a special entry contains
  277. `%%' followed by a Lisp expression which must begin and end with
  278. parentheses.  The Lisp expression determines which dates the entry
  279. applies to.
  280.    Calendar mode provides commands to insert certain commonly used
  281. special entries:
  282. `i a'
  283.      Add an anniversary diary entry for the selected date
  284.      (`insert-anniversary-diary-entry').
  285. `i b'
  286.      Add a block diary entry for the current region
  287.      (`insert-block-diary-entry').
  288. `i c'
  289.      Add a cyclic diary entry starting at the date
  290.      (`insert-cyclic-diary-entry').
  291.    If you want to make a diary entry that applies to the anniversary of
  292. a specific date, move point to that date and use the `i a' command.
  293. This displays the end of your diary file in another window and inserts
  294. the anniversary description; you can then type the rest of the diary
  295. entry.  The entry looks like this:
  296.      %%(diary-anniversary 10 31 1948) Arthur's birthday
  297. This entry applies to October 31 in any year after 1948; `10 31 1948'
  298. specifies the date.  (If you are using the European calendar style, the
  299. month and day are interchanged.)  The reason this expression requires a
  300. beginning year is that advanced diary functions can use it to calculate
  301. the number of elapsed years.
  302.    A "block" diary entry applies to a specified range of consecutive
  303. dates.  Here is a block diary entry that applies to all dates from June
  304. 24, 1990 through July 10, 1990:
  305.      %%(diary-block 6 24 1990 7 10 1990) Vacation
  306. The `6 24 1990' indicates the starting date and the `7 10 1990'
  307. indicates the stopping date.  (Again, if you are using the European
  308. calendar style, the month and day are interchanged.)
  309.    To insert a block entry, place point and the mark on the two dates
  310. that begin and end the range, and type `i b'.  This command displays
  311. the end of your diary file in another window and inserts the block
  312. description; you can then type the diary entry.
  313.    "Cyclic" diary entries repeat after a fixed interval of days.  To
  314. create one, select the starting date and use the `i c' command.  The
  315. command prompts for the length of interval, then inserts the entry,
  316. which looks like this:
  317.      %%(diary-cyclic 50 3 1 1990) Renew medication
  318. This entry applies to March 1, 1990 and every 50th day following; `3 1
  319. 1990' specifies the starting date.  (If you are using the European
  320. calendar style, the month and day are interchanged.)
  321.    All three of these commands make marking diary entries.  To insert a
  322. nonmarking entry, give a numeric argument to the command.  For example,
  323. `C-u i a' makes a nonmarking anniversary diary entry.
  324.    Marking sexp diary entries in the calendar is *extremely*
  325. time-consuming, since every date visible in the calendar window must be
  326. individually checked.  So it's a good idea to make sexp diary entries
  327. nonmarking (with `&') when possible.
  328.    Another sophisticated kind of sexp entry, a "floating" diary entry,
  329. specifies a regularly-occurring event by offsets specified in days,
  330. weeks, and months.  It is comparable to a crontab entry interpreted by
  331. the `cron' utility.  Here is a nonmarking, floating diary entry that
  332. applies to the last Thursday in November:
  333.      &%%(diary-float 11 4 -1) American Thanksgiving
  334. The 11 specifies November (the eleventh month), the 4 specifies Thursday
  335. (the fourth day of the week, where Sunday is numbered zero), and the -1
  336. specifies "last" (1 would mean "first", 2 would mean "second", -2 would
  337. mean "second-to-last", and so on).  The month can be a single month or
  338. a list of months.  Thus you could change the 11 above to `'(1 2 3)' and
  339. have the entry apply to the last Thursday of January, February, and
  340. March.  If the month is `t', the entry applies to all months of the
  341. year.
  342.    Most generally, special diary entries can perform arbitrary
  343. computations to determine when they apply.  *Note Sexp Diary Entries:
  344. (elisp)Sexp Diary Entries.
  345. File: emacs,  Node: Appointments,  Next: Daylight Savings,  Prev: Diary,  Up: Calendar/Diary
  346. Appointments
  347. ============
  348.    If you have a diary entry for an appointment, and that diary entry
  349. begins with a recognizable time of day, Emacs can warn you, several
  350. minutes beforehand, that that appointment is pending.  Emacs alerts you
  351. to the appointment by displaying a message in the mode line.
  352.    To enable appointment notification, you must enable the time display
  353. feature of Emacs, `M-x display-time' (*note Mode Line::.).  You must
  354. also add the function `appt-make-list' to the `diary-hook', like this:
  355.      (add-hook 'diary-hook 'appt-make-list)
  356.    With these preparations done, when you display the diary (either with
  357. the `d' command in the calendar window or with the `M-x diary'
  358. command), it sets up an appointment list of all the diary entries found
  359. with recognizable times of day, and reminds you just before each of
  360. them.
  361.    For example, suppose the diary file contains these lines:
  362.      Monday
  363.        9:30am Coffee break
  364.       12:00pm Lunch
  365. Then on Mondays, after you have displayed the diary, you will be
  366. reminded at 9:20am about your coffee break and at 11:50am about lunch.
  367.    You can write times in conventional American am/pm style, or 24-hour
  368. European/military style.  You need not be consistent; your diary file
  369. can have a mixture of the two styles.
  370.    Emacs updates the appointments list automatically just after
  371. midnight.  This also displays the next day's diary entries in the diary
  372. buffer, unless you set `appt-display-diary' to `nil'.
  373.    You can also use the appointment notification facility like an alarm
  374. clock.  The command `M-x appt-add' adds entries to the appointment list
  375. without affecting your diary file.  You delete entries from the
  376. appointment list with `M-x appt-delete'.
  377.    You can turn off the appointment notification feature at any time by
  378. setting `appt-issue-message' to `nil'.
  379. File: emacs,  Node: Daylight Savings,  Prev: Appointments,  Up: Calendar/Diary
  380. Daylight Savings Time
  381. =====================
  382.    Emacs understands the difference between standard time and daylight
  383. savings time--the times given for sunrise, sunset, solstices,
  384. equinoxes, and the phases of the moon take that into account.  The rules
  385. for daylight savings time vary from place to place and have also varied
  386. historically from year to year.  To do the job properly, Emacs needs to
  387. know which rules to use.
  388.    Some operating systems keep track of the rules that apply to the
  389. place where you are; on these systems, Emacs gets the information it
  390. needs from the system automatically.  If some or all of this
  391. information is missing, Emacs fills in the gaps with the rules
  392. currently used in Cambridge, Massachusetts.  If the resulting rules are
  393. not what you want, you can tell Emacs the rules to use by setting
  394. certain variables.
  395.    These values should be Lisp expressions that refer to the variable
  396. `year', and evaluate to the Gregorian date on which daylight savings
  397. time starts or (respectively) ends, in the form of a list `(MONTH DAY
  398. YEAR)'.  The values should be `nil' if your area does not use daylight
  399. savings time.
  400.    Emacs uses these expressions to determine the starting date of
  401. daylight savings time for the holiday list and for correcting times of
  402. day in the solar and lunar calculations.
  403.    The values for Cambridge, Massachusetts are as follows:
  404.      (calendar-nth-named-day 1 0 4 year)
  405.      (calendar-nth-named-day -1 0 10 year)
  406. That is, the first 0th day (Sunday) of the fourth month (April) in the
  407. year specified by `year', and the last Sunday of the tenth month
  408. (October) of that year.  If daylight savings time were changed to start
  409. on October 1, you would set `calendar-daylight-savings-starts' to this:
  410.      (list 10 1 year)
  411.    If there is no daylight savings time at your location, or if you want
  412. all times in standard time, set `calendar-daylight-savings-starts' and
  413. `calendar-daylight-savings-ends' to `nil'.
  414.    The variable `calendar-daylight-time-offset' specifies the
  415. difference between daylight savings time and standard time, measured in
  416. minutes.  The value for Cambridge, Massachusetts is 60.
  417.    The two variables `calendar-daylight-savings-starts-time' and
  418. `calendar-daylight-savings-ends-time' specify the number of minutes
  419. after midnight local time when the transition to and from daylight
  420. savings time should occur.  For Cambridge, both variables' values are
  421. File: emacs,  Node: GNUS,  Next: Shell,  Prev: Calendar/Diary,  Up: Top
  422.    GNUS is an Emacs subsystem for reading and responding to netnews.
  423. You can use GNUS to browse through news groups, look at summaries of
  424. articles in specific group, and read articles of interest.  You can
  425. respond to authors or write replies to all the readers of a news group.
  426.    This section introduces GNUS and describes several basic features.
  427. Full documentation will appear elsewhere.
  428.    To start GNUS, type `M-x gnus RET'.
  429. * Menu:
  430. * Buffers of GNUS::       The Newsgroups, Summary and Article buffers.
  431. * GNUS Startup::       What you should know about starting GNUS.
  432. * Summary of GNUS::       A short description of the basic GNUS commands.
  433. File: emacs,  Node: Buffers of GNUS,  Next: GNUS Startup,  Up: GNUS
  434. GNUS's Three Buffers
  435. --------------------
  436.    GNUS creates and uses three Emacs buffers, each with its own
  437. particular purpose and its own major mode.
  438.    The "Newsgroup buffer" contains a list of newsgroups.  This is the
  439. first buffer that GNUS displays when it starts up.  Normally the list
  440. contains only the newsgroups to which you subscribe (which are listed in
  441. your `.newsrc' file) and which contain unread articles.  Use this
  442. buffer to select a specific newsgroup.
  443.    The "Summary buffer" lists the articles in a single newsgroup,
  444. including their subjects, their numbers, and who posted them.  GNUS
  445. creates a Summary buffer for a newsgroup when you select the group in
  446. the Newsgroup buffer.  Use this buffer to select an article.
  447.    The "Article buffer" displays the text of an article.  You rarely
  448. need to select this buffer because you can scroll through it while
  449. remaining in the Summary buffer.
  450. File: emacs,  Node: GNUS Startup,  Next: Summary of GNUS,  Prev: Buffers of GNUS,  Up: GNUS
  451. When GNUS Starts Up
  452. -------------------
  453.    At startup, GNUS reads your `.newsrc' news initialization file and
  454. attempts to communicate with the local news server, which is a
  455. repository of news articles.  The news server need not be the same
  456. computer you are logged in on.
  457.    If you start GNUS and connect to the server, but do not see any
  458. newsgroups listed in the Newsgroup buffer, type `L' to get a listing of
  459. all the newsgroups.  Then type `u' to unsubscribe from the newsgroups
  460. you don't want to read.  (You can move point to a particular group
  461. using `n' and `p' or the usual Emacs commands.)
  462.    When you quit GNUS with `q', it automatically records in your
  463. `.newsrc' initialization file the subscribed or unsubscribed status of
  464. all newsgroups, except for groups you have "killed".  (You do not need
  465. to edit this file yourself, but you may.)  When new newsgroups come
  466. into existence, GNUS subscribes to them automatically; if you don't
  467. want to read them, use `u' to unsubscribe from them.
  468. File: emacs,  Node: Summary of GNUS,  Prev: GNUS Startup,  Up: GNUS
  469. Summary of GNUS Commands
  470. ------------------------
  471.    Reading news is a two step process:
  472.   1. Choose a newsgroup in the Newsgroup buffer.
  473.   2. Select articles from the Summary buffer.  Each article selected is
  474.      displayed in the Article buffer in a large window, below the
  475.      Summary buffer in its small window.
  476.    Each GNUS buffer has its own special commands, but commands that do
  477. the similar things have similar key bindings.  Here are commands for the
  478. Newsgroup and Summary buffers:
  479.      In the Newsgroup buffer, suspend GNUS.  You can return to GNUS
  480.      later by selecting the Newsgroup buffer and typing `g' to get
  481.      newly arrived articles.
  482.      In the Newsgroup buffer, update your `.newsrc' initialization file
  483.      and quit GNUS.
  484.      In the Summary buffer, exit the current newsgroup and return to the
  485.      Newsgroup buffer.  Thus, typing `q' twice quits GNUS.
  486.      In the Newsgroup buffer, list all the newsgroups available on your
  487.      news server (except those you have killed).  This may be a long
  488.      list!
  489.      In the Newsgroup buffer, list only the newsgroups to which you
  490.      subscribe and which contain unread articles.
  491.      In the Newsgroup buffer, unsubscribe from (or subscribe to) the
  492.      newsgroup listed in the line that point is on.  When you quit GNUS
  493.      by typing `q', GNUS lists in your `.newsrc' file which groups you
  494.      have subscribed to.  The next time you start GNUS, you won't see
  495.      this group initially, because GNUS normally displays only
  496.      subscribed-to groups.
  497. `C-k'
  498.      In the Newsgroup buffer, "kill" the current line's newsgroup--don't
  499.      even list it in `.newsrc' from now on.  This affects future GNUS
  500.      sessions as well as the present session.
  501.      When you quit GNUS by typing `q', GNUS writes information in the
  502.      file `.newsrc' describing all newsgroups except those you have
  503.      "killed."
  504. `SPC'
  505.      In the Newsgroup buffer, select the group on the line under the
  506.      cursor and display the first unread article in that group.
  507.      In the Summary buffer,
  508.         * Select the article on the line under the cursor if none is
  509.           selected.
  510.         * Scroll the text of the selected article (if there is one).
  511.         * Select the next unread article if at the end of the current
  512.           article.
  513.      Thus, you can move through all the articles by repeatedly typing
  514.      SPC.
  515. `DEL'
  516.      In the Newsgroup Buffer, move point to the previous newsgroup
  517.      containing unread articles.
  518.      In the Summary buffer, scroll the text of the article backwards.
  519.      Move point to the next unread newsgroup, or select the next unread
  520.      article.
  521.      Move point to the previous unread newsgroup, or select the previous
  522.      unread article.
  523. `C-n'
  524. `C-p'
  525.      Move point to the next or previous item, even if it is marked as
  526.      read.  This does not select the article or newsgroup on that line.
  527.      In the Summary buffer, do an incremental search of the current
  528.      text in the Article buffer, just as if you switched to the Article
  529.      buffer and typed `C-s'.
  530. `M-s REGEXP RET'
  531.      In the Summary buffer, search forward for articles containing a
  532.      match for REGEXP.
  533. `C-c C-s C-n'
  534. `C-c C-s C-s'
  535. `C-c C-s C-d'
  536. `C-c C-s C-a'
  537.      In the Summary buffer, sort the list of articles by number,
  538.      subject, date, or author.
  539. `C-M-n'
  540. `C-M-p'
  541.      In the Summary buffer, read the next or previous article with the
  542.      same subject as the current article.
  543. File: emacs,  Node: Shell,  Next: Emacs Server,  Prev: GNUS,  Up: Top
  544. Running Shell Commands from Emacs
  545. =================================
  546.    Emacs has commands for passing single command lines to inferior shell
  547. processes; it can also run a shell interactively with input and output
  548. to an Emacs buffer named `*shell*'.
  549. `M-! CMD RET'
  550.      Run the shell command line CMD and display the output
  551.      (`shell-command').
  552. `M-| CMD RET'
  553.      Run the shell command line CMD with region contents as input;
  554.      optionally replace the region with the output
  555.      (`shell-command-on-region').
  556. `M-x shell'
  557.      Run a subshell with input and output through an Emacs buffer.  You
  558.      can then give commands interactively.
  559. * Menu:
  560. * Single Shell::           How to run one shell command and return.
  561. * Interactive Shell::      Permanent shell taking input via Emacs.
  562. * Shell Mode::             Special Emacs commands used with permanent shell.
  563. * History: Shell History.  Repeating previous commands in a shell buffer.
  564. * Options: Shell Options.  Options for customizing Shell mode.
  565. * Remote Host::            Connecting to another computer.
  566. File: emacs,  Node: Single Shell,  Next: Interactive Shell,  Up: Shell
  567. Single Shell Commands
  568. ---------------------
  569.    `M-!' (`shell-command') reads a line of text using the minibuffer
  570. executes it as a shell command in a subshell made just for this
  571. command.  Standard input for the command comes from the null device.
  572. If the shell command produces any output, the output goes into an Emacs
  573. buffer named `*Shell Command Output*', which is displayed in another
  574. window but not selected.  A numeric argument, as in `M-1 M-!', directs
  575. this command to insert any output into the current buffer.  In that
  576. case, point is left before the output and the mark is set after the
  577. output.
  578.    If the shell command line ends in `&', it runs asynchronously.
  579.    `M-|' (`shell-command-on-region') is like `M-!' but passes the
  580. contents of the region as the standard input to the shell command,
  581. instead of no input.  If a numeric argument is used, meaning insert the
  582. output in the current buffer, then the old region is deleted first and
  583. the output replaces it as the contents of the region.
  584.    Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
  585. use.  This variable is initialized based on your `SHELL' environment
  586. variable when Emacs is started.  If the file name does not specify a
  587. directory, the directories in the list `exec-path' are searched; this
  588. list is initialized based on the environment variable `PATH' when Emacs
  589. is started.  Your `.emacs' file can override either or both of these
  590. default initializations.
  591.    Both `M-!' and `M-|' wait for the shell command to complete.  To
  592. stop waiting, type `C-g' to quit; that terminates the shell command
  593. with the signal `SIGINT'--the same signal that `C-c' normally generates
  594. in the shell.  Emacs waits until the command actually terminates.  If
  595. the shell command doesn't stop (because it ignores the `SIGINT'
  596. signal), type `C-g' again; this sends the command a `SIGKILL' signal
  597. which is impossible to ignore.
  598. File: emacs,  Node: Interactive Shell,  Next: Shell Mode,  Prev: Single Shell,  Up: Shell
  599. Interactive Inferior Shell
  600. --------------------------
  601.    To run a subshell interactively, putting its typescript in an Emacs
  602. buffer, use `M-x shell'.  This creates (or reuses) a buffer named
  603. `*shell*' and runs a subshell with input coming from and output going
  604. to that buffer.  That is to say, any "terminal output" from the subshell
  605. goes into the buffer, advancing point, and any "terminal input" for the
  606. subshell comes from text in the buffer.  To give input to the subshell,
  607. go to the end of the buffer and type the input, terminated by RET.
  608.    Emacs does not wait for the subshell to do anything.  You can switch
  609. windows or buffers and edit them while the shell is waiting, or while
  610. it is running a command.  Output from the subshell waits until Emacs
  611. has time to process it; this happens whenever Emacs is waiting for
  612. keyboard input or for time to elapse.
  613.    To make multiple subshells, rename the buffer `*shell*' to something
  614. different using `M-x rename-uniquely'.  Then type `M-x shell' again to
  615. create a new buffer `*shell*' with its own subshell.  If you rename
  616. this buffer as well, you can create a third one, and so on.  All the
  617. subshells run independently and in parallel.
  618.    The file name used to load the subshell is the value of the variable
  619. `explicit-shell-file-name', if that is non-`nil'.  Otherwise, the
  620. environment variable `ESHELL' is used, or the environment variable
  621. `SHELL' if there is no `ESHELL'.  If the file name specified is
  622. relative, the directories in the list `exec-path' are searched; this
  623. list is initialized based on the environment variable `PATH' when Emacs
  624. is started.  Your `.emacs' file can override either or both of these
  625. default initializations.
  626.    As soon as the subshell is started, it is sent as input the contents
  627. of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME
  628. is the name of the file that the shell was loaded from.  For example,
  629. if you use bash, the file sent to it is `~/.emacs_bash'.
  630.    `cd', `pushd' and `popd' commands given to the inferior shell are
  631. watched by Emacs so it can keep the `*shell*' buffer's default
  632. directory the same as the shell's working directory.  These commands
  633. are recognized syntactically by examining lines of input that are sent.
  634. If you use aliases for these commands, you can tell Emacs to recognize
  635. them also.  For example, if the value of the variable
  636. `shell-pushd-regexp' matches the beginning of a shell command line,
  637. that line is regarded as a `pushd' command.  Change this variable when
  638. you add aliases for `pushd'.  Likewise, `shell-popd-regexp' and
  639. `shell-cd-regexp' are used to recognize commands with the meaning of
  640. `popd' and `cd'.  These commands are recognized only at the beginning
  641. of a shell command line.
  642.    If Emacs gets an error while trying to handle what it believes is a
  643. `cd', `pushd' or `popd' command, it runs the hook
  644. `shell-set-directory-error-hook' (*note Hooks::.).
  645.    If Emacs does not properly track changes in the current directory of
  646. the subshell, use the command `M-x dirs' to ask the shell what its
  647. current directory is.  This command works for shells that support the
  648. most common command syntax; it may not work for unusual shells.
  649. File: emacs,  Node: Shell Mode,  Next: Shell History,  Prev: Interactive Shell,  Up: Shell
  650. Shell Mode
  651. ----------
  652.    Shell buffer use Shell mode, which defines several special keys
  653. attached to the `C-c' prefix.  They are chosen to resemble the usual
  654. editing and job control characters present in shells that are not under
  655. Emacs, except that you must type `C-c' first.  Here is a complete list
  656. of the special key bindings of Shell mode:
  657. `RET'
  658.      At end of buffer send line as input; otherwise, copy current line
  659.      to end of buffer and send it (`comint-send-input').  When a line is
  660.      copied, any text at the beginning of the line that matches the
  661.      variable `shell-prompt-pattern' is left out; this variable's value
  662.      should be a regexp string that matches the prompts that your shell
  663.      uses.
  664. `TAB'
  665.      Complete the command name or file name before point in the shell
  666.      buffer (`comint-dynamic-complete').  TAB also completes history
  667.      references (*note History References::.) and environment variable
  668.      names.
  669.      The variable `shell-completion-fignore' specifies a list of file
  670.      name extensions to ignore in Shell mode completion.  The default
  671.      setting ignores file names ending in `~', `#' or `%'.  Other
  672.      related Comint modes use the variable `comint-completion-fignore'
  673.      instead.
  674. `M-?'
  675.      Display temporarily a list of the possible completions of the file
  676.      name before point in the shell buffer
  677.      (`comint-dynamic-list-filename-completions').
  678. `C-d'
  679.      Either delete a character or send EOF
  680.      (`comint-delchar-or-maybe-eof').  Typed at the end of the shell
  681.      buffer, `C-d' sends EOF to the subshell.  Typed at any other
  682.      position in the buffer, `C-d' deletes a character as usual.
  683. `C-c C-a'
  684.      Move to the beginning of the line, but after the prompt if any
  685.      (`comint-bol').
  686. `C-c C-u'
  687.      Kill all text pending at end of buffer to be sent as input
  688.      (`comint-kill-input').
  689. `C-c C-w'
  690.      Kill a word before point (`backward-kill-word').
  691. `C-c C-c'
  692.      Interrupt the shell or its current subjob if any
  693.      (`comint-interrupt-subjob').
  694. `C-c C-z'
  695.      Stop the shell or its current subjob if any (`comint-stop-subjob').
  696. `C-c C-\'
  697.      Send quit signal to the shell or its current subjob if any
  698.      (`comint-quit-subjob').
  699. `C-c C-o'
  700.      Kill the last batch of output from a shell command
  701.      (`comint-kill-output').  This is useful if a shell command spews
  702.      out lots of output that just gets in the way.
  703. `C-c C-r'
  704. `C-M-l'
  705.      Scroll to display the beginning of the last batch of output at the
  706.      top of the window; also move the cursor there
  707.      (`comint-show-output').
  708. `C-c C-e'
  709.      Scroll to put the end of the buffer at the bottom of the window
  710.      (`comint-show-maximum-output').
  711. `C-c C-f'
  712.      Move forward across one shell command, but not beyond the current
  713.      line (`shell-forward-command').  The variable
  714.      `shell-command-regexp' specifies how to recognize the end of a
  715.      command.
  716. `C-c C-b'
  717.      Move backward across one shell command, but not beyond the current
  718.      line (`shell-backward-command').
  719. `M-x dirs'
  720.      Ask the shell what its current directory is, so that Emacs can
  721.      agree with the shell.
  722. `M-x send-invisible RET TEXT RET'
  723.      Send TEXT as input to the shell, after reading it without echoing.
  724.      This is useful when a shell command runs a program that asks for
  725.      a password.
  726.      Alternatively, you can arrange for Emacs to notice password prompts
  727.      and turn off echoing for them, as follows:
  728.           (add-hook `comint-output-filter-functions
  729.                     `comint-watch-for-password-prompt)
  730. `M-x comint-continue-subjob'
  731.      Continue the shell process.  This is useful if you accidentally
  732.      suspend the shell process.(1)
  733. `M-x shell-strip-ctrl-m'
  734.      Discard all control-m characters from the shell output.
  735.    Shell mode also customizes the paragraph commands so that only shell
  736. prompts start new paragraphs.  Thus, a paragraph consists of an input
  737. command plus the output that follows it in the buffer.
  738.    Shell mode is a derivative of Comint mode, a general purpose mode for
  739. communicating with interactive subprocesses.  Most of the features of
  740. Shell mode actually come from Comint mode, as you can see from the
  741. command names listed above.  The specialization of Shell mode in
  742. particular include the choice of regular expression for detecting
  743. prompts, the directory tracking feature, and a few user commands.
  744.    Other Emacs features that use variants of Comint mode include GUD
  745. (*note Debuggers::.) and `M-x run-lisp' (*note External Lisp::.).
  746.    You can use `M-x comint-run' to execute any program of your choice
  747. in a subprocess using unmodified Comint mode--without the
  748. specializations of Shell mode.
  749.    ---------- Footnotes ----------
  750.    (1)  You should not suspend the shell process.  Suspending a subjob
  751. of the shell is a completely different matter--that is normal practice,
  752. but you must use the shell to continue the subjob; this command won't
  753. do it.
  754. File: emacs,  Node: Shell History,  Next: Shell Options,  Prev: Shell Mode,  Up: Shell
  755. Shell Command History
  756. ---------------------
  757.    Shell buffers support three ways of repeating earlier commands.  You
  758. can use the same keys used in the minibuffer; these work much as they do
  759. in the minibuffer, inserting text from prior commands while point
  760. remains always at the end of the buffer.  You can move through the
  761. buffer to previous inputs in their original place, then resubmit them or
  762. copy them to the end.  Or you can use a `!'-style history reference.
  763. * Menu:
  764. * Ring: Shell Ring.             Fetching commands from the history list.
  765. * Copy: Shell History Copying.  Moving to a command and then copying it.
  766. * History References::          Expanding `!'-style history references.
  767. File: emacs,  Node: Shell Ring,  Next: Shell History Copying,  Up: Shell History
  768. Shell History Ring
  769. ..................
  770. `M-p'
  771.      Fetch the next earlier old shell command.
  772. `M-n'
  773.      Fetch the next later old shell command.
  774. `M-r REGEXP RET'
  775. `M-s REGEXP RET'
  776.      Search backwards or forwards for old shell commands that match
  777.      REGEXP.
  778.    Shell buffers provide a history of previously entered shell
  779. commands.  To reuse shell commands from the history, use the editing
  780. commands `M-p', `M-n', `M-r' and `M-s'.  These work just like the
  781. minibuffer history commands except that they operate on the text at the
  782. end of the shell buffer, where you would normally insert text to send
  783. to the shell.
  784.    `M-p' fetches an earlier shell command to the end of the shell
  785. buffer.  Successive use of `M-p' fetches successively earlier shell
  786. commands, each replacing any text that was already present as potential
  787. shell input.  `M-n' does likewise except that it finds successively
  788. more recent shell commands from the buffer.
  789.    The history search commands `M-r' and `M-s' read a regular
  790. expression and search through the history for a matching command.  Aside
  791. from the choice of which command to fetch, they work just like `M-p'
  792. and `M-r'.  If you enter an empty regexp, these commands reuse the same
  793. regexp used last time.
  794.    When you find the previous input you want, you can resubmit it by
  795. typing RET, or you can edit it first and then resubmit it if you wish.
  796.    These commands get the text of previous shell commands from a special
  797. history list, not from the shell buffer itself.  Thus, editing the shell
  798. buffer, or even killing large parts of it, does not affect the history
  799. that these commands access.
  800.    Some shells store their command histories in files so that you can
  801. refer to previous commands from previous shell sessions.  Emacs reads
  802. the command history file for your chosen shell, to initialize its own
  803. command history.  The file name is `~/.bash_history' for bash,
  804. `~/.sh_history' for ksh, and `~/.history' for other shells.
  805. File: emacs,  Node: Shell History Copying,  Next: History References,  Prev: Shell Ring,  Up: Shell History
  806. Shell History Copying
  807. .....................
  808. `C-c C-p'
  809.      Move point to the previous prompt (`comint-previous-prompt').
  810. `C-c C-n'
  811.      Move point to the following prompt (`comint-next-prompt').
  812. `C-c RET'
  813.      Copy the input command which point is in, inserting the copy at
  814.      the end of the buffer (`comint-copy-old-input').  This is useful
  815.      if you move point back to a previous command.  After you copy the
  816.      command, you can submit the copy as input with RET.  If you wish,
  817.      you can edit the copy before resubmitting it.
  818.    Moving to a previous input and then copying it with `C-c RET'
  819. produces the same results--the same buffer contents--that you would get
  820. by using `M-p' enough times to fetch that previous input from the
  821. history list.  However, `C-c RET' copies the text from the buffer,
  822. which can be different from what is in the history list if you edit the
  823. input text in the buffer after it has been sent.
  824. File: emacs,  Node: History References,  Prev: Shell History Copying,  Up: Shell History
  825. Shell History References
  826. ........................
  827.    Various shells including csh and bash support "history references"
  828. that begin with `!' and `^'.  Shell mode can understands these
  829. constructs and perform the history substitution for you.  If you insert
  830. a history reference and type TAB, this searches the input history for a
  831. matching command, performs substitution if necessary, and places the
  832. result in the buffer in place of the history reference.  For example,
  833. you can fetch the most recent command beginning with `mv' with `! m v
  834. TAB'.  You can edit the command if you wish, and then resubmit the
  835. command to the shell by typing RET.
  836.    History references take effect only following a shell prompt.  The
  837. variable `shell-prompt-pattern' specifies how to recognize a shell
  838. prompt.  Comint modes in general use the variable
  839. `comint-prompt-regexp' to specify how to find a prompt; Shell mode uses
  840. `shell-prompt-pattern' to set up the local value of
  841. `comint-prompt-regexp'.
  842.    Shell mode can optionally expand history references in the buffer
  843. when you send them to the shell.  To request this, set the variable
  844. `comint-input-autoexpand' to `input'.
  845.    You can make SPC perform history expansion by binding SPC to the
  846. command `comint-magic-space'.
  847. File: emacs,  Node: Shell Options,  Next: Remote Host,  Prev: Shell History,  Up: Shell
  848. Shell Mode Options
  849. ------------------
  850.    If the variable `comint-scroll-to-bottom-on-input' is non-`nil',
  851. insertion and yank commands scroll the selected window to the bottom
  852. before inserting.
  853.    If `comint-scroll-show-maximum-output' is non-`nil' (which is the
  854. default), then scrolling due to arrival of output tries to place the
  855. last line of text at the bottom line of the window, so as to show as
  856. much useful text as possible.  (This mimics the scrolling behavior of
  857. many terminals.)
  858.    By setting `comint-scroll-to-bottom-on-output', you can opt for
  859. having point jump to the end of the buffer whenever output arrives--no
  860. matter where in the buffer point was before.  If the value is `this',
  861. point jumps in the selected window.  If the value is `all', point jumps
  862. in each window that shows the comint buffer.  If the value is `other',
  863. point jumps in all nonselected windows that show the current buffer.
  864. The default value is `nil', which means point does not jump to the end.
  865.    The variable `comint-input-ignoredups' controls whether successive
  866. identical inputs are stored in the input history.  A non-`nil' value
  867. means to omit an input that is the same as the previous input.  The
  868. default is `nil', which means to store each input even if it is equal
  869. to the previous input.
  870.    Three variables customize file name completion.  The variable
  871. `comint-completion-addsuffix' controls whether completion inserts a
  872. space or a slash to indicate a fully completed file or directory name
  873. (non-`nil' means do insert a space or slash).
  874. `comint-completion-recexact', if non-`nil', directs TAB to choose the
  875. shortest possible completion if the usual Emacs completion algorithm
  876. cannot add even a single character.  `comint-completion-autolist', if
  877. non-`nil', says to list all the possible completions whenever
  878. completion is not exact.
  879.    The command `comint-dynamic-complete-variable' does variable name
  880. completion using the environment variables as set within Emacs.  The
  881. variables controlling filename completion apply to variable name
  882. completion too.  This command is normally available through the menu
  883.    Command completion normally considers only executable files.  If you
  884. set `shell-command-execonly' to `nil', it considers nonexecutable files
  885. as well.
  886.    You can now configure the behavior of `pushd'.  Variables control
  887. whether `pushd' behaves like `cd' if no argument is given
  888. (`shell-pushd-tohome'), pop rather than rotate with a numeric argument
  889. (`shell-pushd-dextract'), and only add directories to the directory
  890. stack if they are not already on it (`shell-pushd-dunique').  The
  891. values you choose should match the underlying shell, of course.
  892.