aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2012-02-17 16:33:15 +0900
committerKenichi Handa2012-02-17 16:33:15 +0900
commit48dd1e399f41aa349e8651d049cb4a707ffd0bb0 (patch)
tree54a1d0b537b697ca2cb0bb420d125eafbbbb534c
parentc406be4337317c4ff4e60dc74a10921bd1102cac (diff)
parentbcc657043df41514ec80c3e172c6872b88221005 (diff)
downloademacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.tar.gz
emacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.zip
merge trunk
-rw-r--r--admin/FOR-RELEASE17
-rw-r--r--doc/emacs/ChangeLog24
-rw-r--r--doc/emacs/ack.texi9
-rw-r--r--doc/emacs/cal-xtra.texi34
-rw-r--r--doc/emacs/calendar.texi161
-rw-r--r--doc/emacs/dired-xtra.texi13
-rw-r--r--doc/emacs/fortran-xtra.texi67
-rw-r--r--doc/emacs/sending.texi4
-rw-r--r--doc/emacs/vc1-xtra.texi10
-rw-r--r--doc/lispref/ChangeLog51
-rw-r--r--doc/lispref/elisp.texi4
-rw-r--r--doc/lispref/macros.texi2
-rw-r--r--doc/lispref/minibuf.texi147
-rw-r--r--doc/lispref/modes.texi689
-rw-r--r--doc/lispref/processes.texi87
-rw-r--r--doc/lispref/syntax.texi499
-rw-r--r--doc/lispref/variables.texi2
-rw-r--r--doc/lispref/vol1.texi4
-rw-r--r--doc/lispref/vol2.texi4
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/smtpmail.texi211
-rw-r--r--etc/NEWS53
-rw-r--r--lisp/ChangeLog23
-rw-r--r--lisp/calendar/cal-hebrew.el2
-rw-r--r--lisp/custom.el6
-rw-r--r--lisp/gnus/ChangeLog14
-rw-r--r--lisp/gnus/gnus-start.el4
-rw-r--r--lisp/gnus/shr.el5
-rw-r--r--lisp/mail/smtpmail.el12
-rw-r--r--lisp/minibuffer.el8
-rw-r--r--lisp/shell.el5
-rw-r--r--src/ChangeLog10
-rw-r--r--src/eval.c49
-rw-r--r--src/image.c2
34 files changed, 1266 insertions, 971 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index f2c572cfd17..ec0107dc110 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -7,7 +7,7 @@ Check cross-references between the manuals (eg from emacs to elisp)
7are correct. You can use something like the following in the info 7are correct. You can use something like the following in the info
8directory in the Emacs build tree: 8directory in the Emacs build tree:
9 9
10emacs -Q --eval "(setq Info-default-directory-list '(\".\"))" \ 10emacs -Q --eval "(progn (require 'info) (setq Info-directory-list '(\".\")))" \
11 -f info-xref-check-all 11 -f info-xref-check-all
12 12
13make emacs.dvi, elisp.dvi, and deal with any errors (undefined 13make emacs.dvi, elisp.dvi, and deal with any errors (undefined
@@ -61,11 +61,6 @@ sk Miroslav Vaško
61 61
62* BUGS 62* BUGS
63 63
64** rms: gnus-dired.el is a mistake. Those features should not
65be part of Gnus. They should be moved to some other part of Emacs.
66rsteib: Gnus dependencies in `gnus-dired.el' (and `mailcap.el') have been
67minimized. I don't know what is left to do here.
68
69** Check for modes which bind M-s that conflicts with a new global binding M-s 64** Check for modes which bind M-s that conflicts with a new global binding M-s
70and change key bindings where necessary. The current list of modes: 65and change key bindings where necessary. The current list of modes:
71 66
@@ -131,13 +126,13 @@ arevert-xtra.texi cyd
131basic.texi cyd 126basic.texi cyd
132buffers.texi cyd 127buffers.texi cyd
133building.texi cyd 128building.texi cyd
134calendar.texi 129calendar.texi rgm
135cal-xtra.texi 130cal-xtra.texi
136cmdargs.texi cyd 131cmdargs.texi cyd
137commands.texi cyd 132commands.texi cyd
138custom.texi cyd 133custom.texi cyd
139dired.texi cyd 134dired.texi cyd
140dired-xtra.texi 135dired-xtra.texi rgm
141display.texi cyd 136display.texi cyd
142emacs.texi 137emacs.texi
143emacs-xtra.texi 138emacs-xtra.texi
@@ -145,7 +140,7 @@ emerge-xtra.texi
145entering.texi cyd 140entering.texi cyd
146files.texi cyd 141files.texi cyd
147fixit.texi cyd 142fixit.texi cyd
148fortran-xtra.texi 143fortran-xtra.texi rgm
149frames.texi cyd 144frames.texi cyd
150glossary.texi 145glossary.texi
151help.texi cyd 146help.texi cyd
@@ -225,14 +220,14 @@ sequences.texi cyd
225streams.texi cyd 220streams.texi cyd
226strings.texi cyd 221strings.texi cyd
227symbols.texi cyd 222symbols.texi cyd
228syntax.texi 223syntax.texi cyd
229text.texi 224text.texi
230tips.texi 225tips.texi
231variables.texi cyd 226variables.texi cyd
232windows.texi 227windows.texi
233 228
234* PLANNED ADDITIONS 229* PLANNED ADDITIONS
235* pov-mode (probably not for Emacs-23: waiting for a Free POV-Ray). 230* pov-mode (waiting for a Free POV-Ray)
236** gas-mode ? 231** gas-mode ?
237 232
238 233
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b24c6946281..036059ec15c 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,27 @@
12012-02-17 Glenn Morris <rgm@gnu.org>
2
3 * ack.texi (Acknowledgments): Mention Gnulib.
4
5 * ack.texi, calendar.texi, cal-xtra.texi: Use "Bahá'í".
6
7 * calendar.texi: Misc small changes, including updating the dates
8 of examples.
9
102012-02-16 Glenn Morris <rgm@gnu.org>
11
12 * calendar.texi: Misc small changes.
13
14 * vc1-xtra.texi (VC Delete/Rename, CVS Options):
15 * cal-xtra.texi (Diary Display): Fix TeX cross-refs to other manuals.
16
17 * dired-xtra.texi (Subdir Switches): Small fixes.
18
19 * fortran-xtra.texi: Tiny changes and some adjustments to line breaks.
20
212012-02-15 Glenn Morris <rgm@gnu.org>
22
23 * sending.texi (Mail Sending): smtpmail-auth-credentials was removed.
24
12012-02-12 Glenn Morris <rgm@gnu.org> 252012-02-12 Glenn Morris <rgm@gnu.org>
2 26
3 * ack.texi (Acknowledgments): 27 * ack.texi (Acknowledgments):
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index 5afbb9b1442..8bb4c4a780a 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -287,6 +287,11 @@ John Eaton and Kurt Hornik wrote Octave mode.
287Rolf Ebert co-wrote Ada mode. 287Rolf Ebert co-wrote Ada mode.
288 288
289@item 289@item
290Paul Eggert integrated the Gnulib portability library, and made many
291other portability fixes to the C code; as well as his contributions
292to VC and the calendar.
293
294@item
290Stephen Eglen wrote @file{mspools.el}, which tells you which Procmail 295Stephen Eglen wrote @file{mspools.el}, which tells you which Procmail
291folders have mail waiting in them; and @file{iswitchb.el}, a feature 296folders have mail waiting in them; and @file{iswitchb.el}, a feature
292for incremental reading and completion of buffer names. 297for incremental reading and completion of buffer names.
@@ -1250,7 +1255,7 @@ Daiki Ueno wrote @file{starttls.el}, support for Transport Layer
1250Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with 1255Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with
1251Kenichi Okada), and @file{sasl.el}, support for Simple Authentication 1256Kenichi Okada), and @file{sasl.el}, support for Simple Authentication
1252and Security Layer (SASL); @file{plstore.el} for secure storage of 1257and Security Layer (SASL); @file{plstore.el} for secure storage of
1253propery lists; and the EasyPG (and its predecessor PGG) 1258property lists; and the EasyPG (and its predecessor PGG)
1254package, for GnuPG and PGP support. 1259package, for GnuPG and PGP support.
1255 1260
1256@item 1261@item
@@ -1330,7 +1335,7 @@ mode for editing VHDL source code.
1330John Wiegley wrote @file{align.el}, a set of commands for aligning text 1335John Wiegley wrote @file{align.el}, a set of commands for aligning text
1331according to regular-expression based rules; @file{isearchb.el} for fast 1336according to regular-expression based rules; @file{isearchb.el} for fast
1332buffer switching; @file{timeclock.el}, a package for keeping track of 1337buffer switching; @file{timeclock.el}, a package for keeping track of
1333time spent on projects; the Baha'i calendar support; 1338time spent on projects; the Bahá'í calendar support;
1334@file{pcomplete.el}, a programmable completion facility; 1339@file{pcomplete.el}, a programmable completion facility;
1335@file{remember.el}, a mode for jotting down things to remember; 1340@file{remember.el}, a mode for jotting down things to remember;
1336@file{eudcb-mab.el}, an address book backend for the Emacs Unified 1341@file{eudcb-mab.el}, an address book backend for the Emacs Unified
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
index 4d37672b6ca..cce8d9481ce 100644
--- a/doc/emacs/cal-xtra.texi
+++ b/doc/emacs/cal-xtra.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual. -*- coding: iso-latin-1 -*-
2@c Copyright (C) 2004-2012 Free Software Foundation, Inc. 2@c Copyright (C) 2004-2012 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@c 4@c
5@c This file is included either in emacs-xtra.texi (when producing the 5@c This file is included either in emacs-xtra.texi (when producing the
@@ -95,7 +95,7 @@ The lists of holidays that Emacs uses are for
95general holidays (@code{holiday-general-holidays}), 95general holidays (@code{holiday-general-holidays}),
96local holidays (@code{holiday-local-holidays}), 96local holidays (@code{holiday-local-holidays}),
97sun- and moon-related holidays (@code{holiday-solar-holidays}), 97sun- and moon-related holidays (@code{holiday-solar-holidays}),
98Baha'i holidays (@code{holiday-bahai-holidays}), 98Bahá'í holidays (@code{holiday-bahai-holidays}),
99Christian holidays (@code{holiday-christian-holidays}), 99Christian holidays (@code{holiday-christian-holidays}),
100Hebrew (Jewish) holidays (@code{holiday-hebrew-holidays}), 100Hebrew (Jewish) holidays (@code{holiday-hebrew-holidays}),
101Islamic (Muslim) holidays (@code{holiday-islamic-holidays}), 101Islamic (Muslim) holidays (@code{holiday-islamic-holidays}),
@@ -202,7 +202,7 @@ the month (1 specifies the first occurrence, 2 the second occurrence,
202@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and 202@minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
203so on). 203so on).
204 204
205 You can specify holidays that occur on fixed days of the Baha'i, 205 You can specify holidays that occur on fixed days of the Bahá'í,
206Chinese, Hebrew, Islamic, and Julian calendars too. For example, 206Chinese, Hebrew, Islamic, and Julian calendars too. For example,
207 207
208@smallexample 208@smallexample
@@ -419,7 +419,7 @@ the fourth pattern.
419@subsection Diary Entries Using non-Gregorian Calendars 419@subsection Diary Entries Using non-Gregorian Calendars
420 420
421 As well as entries based on the standard Gregorian calendar, your 421 As well as entries based on the standard Gregorian calendar, your
422diary can have entries based on Baha'i, Hebrew, or Islamic dates. 422diary can have entries based on Bahá'í, Hebrew, or Islamic dates.
423Recognition of such entries can be time-consuming, however, and since 423Recognition of such entries can be time-consuming, however, and since
424most people don't use them, you must explicitly enable their use. If 424most people don't use them, you must explicitly enable their use. If
425you want the diary to recognize Hebrew-date diary entries, for example, 425you want the diary to recognize Hebrew-date diary entries, for example,
@@ -439,7 +439,7 @@ you must do this:
439@end smallexample 439@end smallexample
440 440
441@noindent 441@noindent
442Similarly, for Islamic and Baha'i entries, add 442Similarly, for Islamic and Bahá'í entries, add
443@code{diary-islamic-list-entries} and @code{diary-islamic-mark-entries}, or 443@code{diary-islamic-list-entries} and @code{diary-islamic-mark-entries}, or
444@code{diary-bahai-list-entries} and @code{diary-bahai-mark-entries}. 444@code{diary-bahai-list-entries} and @code{diary-bahai-mark-entries}.
445 445
@@ -448,7 +448,7 @@ Similarly, for Islamic and Baha'i entries, add
448@vindex diary-islamic-entry-symbol 448@vindex diary-islamic-entry-symbol
449 These diary entries have the same formats as Gregorian-date diary 449 These diary entries have the same formats as Gregorian-date diary
450entries; except that @code{diary-bahai-entry-symbol} (default @samp{B}) 450entries; except that @code{diary-bahai-entry-symbol} (default @samp{B})
451must precede a Baha'i date, @code{diary-hebrew-entry-symbol} (default 451must precede a Bahá'í date, @code{diary-hebrew-entry-symbol} (default
452@samp{H}) a Hebrew date, and @code{diary-islamic-entry-symbol} (default 452@samp{H}) a Hebrew date, and @code{diary-islamic-entry-symbol} (default
453@samp{I}) an Islamic date. Moreover, non-Gregorian month names may not 453@samp{I}) an Islamic date. Moreover, non-Gregorian month names may not
454be abbreviated (because the first three letters are often not unique). 454be abbreviated (because the first three letters are often not unique).
@@ -475,7 +475,7 @@ nonmarking if preceded by @code{diary-nonmarking-symbol} (default
475 475
476 Here is a table of commands used in the calendar to create diary 476 Here is a table of commands used in the calendar to create diary
477entries that match the selected date and other dates that are similar in 477entries that match the selected date and other dates that are similar in
478the Baha'i, Hebrew, or Islamic calendars: 478the Bahá'í, Hebrew, or Islamic calendars:
479 479
480@table @kbd 480@table @kbd
481@item i h d 481@item i h d
@@ -538,7 +538,13 @@ are no diary entries, even if that day is a holiday. If you want such
538days to be shown in the fancy diary buffer, set the variable 538days to be shown in the fancy diary buffer, set the variable
539@code{diary-list-include-blanks} to @code{t}.@refill 539@code{diary-list-include-blanks} to @code{t}.@refill
540 540
541 The fancy diary buffer enables View mode (@pxref{View Mode}). 541 The fancy diary buffer enables View mode
542@iftex
543(@pxref{View Mode,,, emacs, the Emacs Manual}).
544@end iftex
545@ifnottex
546(@pxref{View Mode}).
547@end ifnottex
542 548
543 The alternative display method @code{diary-simple-display} shows the 549 The alternative display method @code{diary-simple-display} shows the
544actual diary buffer, and uses invisible text to hide entries that don't 550actual diary buffer, and uses invisible text to hide entries that don't
@@ -569,7 +575,13 @@ display, the other irrelevant entries are really absent, not just
569hidden. After preparing the buffer, it runs the hook 575hidden. After preparing the buffer, it runs the hook
570@code{diary-print-entries-hook}. The default value of this hook sends 576@code{diary-print-entries-hook}. The default value of this hook sends
571the data directly to the printer with the command @code{lpr-buffer} 577the data directly to the printer with the command @code{lpr-buffer}
572(@pxref{Printing}). If you want to use a different command to do the 578@iftex
579(@pxref{Printing,,, emacs, the Emacs Manual}).
580@end iftex
581@ifnottex
582(@pxref{Printing}).
583@end ifnottex
584If you want to use a different command to do the
573printing, just change the value of this hook. Other uses might include, 585printing, just change the value of this hook. Other uses might include,
574for example, rearranging the lines into order by day and time. 586for example, rearranging the lines into order by day and time.
575 587
@@ -838,7 +850,7 @@ Make a diary entry with today's equivalent Julian calendar date.
838@item %%(diary-astro-day-number) 850@item %%(diary-astro-day-number)
839Make a diary entry with today's equivalent astronomical (Julian) day number. 851Make a diary entry with today's equivalent astronomical (Julian) day number.
840@item %%(diary-bahai-date) 852@item %%(diary-bahai-date)
841Make a diary entry with today's equivalent Baha'i calendar date. 853Make a diary entry with today's equivalent Bahá'í calendar date.
842@item %%(diary-chinese-date) 854@item %%(diary-chinese-date)
843Make a diary entry with today's equivalent Chinese calendar date. 855Make a diary entry with today's equivalent Chinese calendar date.
844@item %%(diary-coptic-date) 856@item %%(diary-coptic-date)
diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi
index 495828d6d8a..c2851d4abd3 100644
--- a/doc/emacs/calendar.texi
+++ b/doc/emacs/calendar.texi
@@ -1,4 +1,4 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual. -*- coding: iso-latin-1 -*-
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012 2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
@@ -143,8 +143,7 @@ arguments in Calendar mode even without the Meta modifier. For example,
143 143
144 A week (or month, or year) is not just a quantity of days; we think of 144 A week (or month, or year) is not just a quantity of days; we think of
145weeks (months, years) as starting on particular dates. So Calendar mode 145weeks (months, years) as starting on particular dates. So Calendar mode
146provides commands to move to the beginning or end of a week, month or 146provides commands to move to the start or end of a week, month or year:
147year:
148 147
149@table @kbd 148@table @kbd
150@kindex C-a @r{(Calendar mode)} 149@kindex C-a @r{(Calendar mode)}
@@ -246,12 +245,10 @@ Scroll calendar one month forward (@code{calendar-scroll-left}).
246Scroll calendar one month backward (@code{calendar-scroll-right}). 245Scroll calendar one month backward (@code{calendar-scroll-right}).
247@item C-v 246@item C-v
248@itemx @key{next} 247@itemx @key{next}
249Scroll calendar three months forward 248Scroll three months forward (@code{calendar-scroll-left-three-months}).
250(@code{calendar-scroll-left-three-months}).
251@item M-v 249@item M-v
252@itemx @key{prior} 250@itemx @key{prior}
253Scroll calendar three months backward 251Scroll three months backward (@code{calendar-scroll-right-three-months}).
254(@code{calendar-scroll-right-three-months}).
255@end table 252@end table
256 253
257@kindex > @r{(Calendar mode)} 254@kindex > @r{(Calendar mode)}
@@ -290,7 +287,8 @@ Display the number of days in the current region
290 287
291@kindex M-= @r{(Calendar mode)} 288@kindex M-= @r{(Calendar mode)}
292@findex calendar-count-days-region 289@findex calendar-count-days-region
293 To determine the number of days in the region, type @kbd{M-=} 290 To determine the number of days in a range, set the mark on one
291date using @kbd{C-SPC}, move point to another date, and type @kbd{M-=}
294(@code{calendar-count-days-region}). The numbers of days shown is 292(@code{calendar-count-days-region}). The numbers of days shown is
295@emph{inclusive}; that is, it includes the days specified by mark and 293@emph{inclusive}; that is, it includes the days specified by mark and
296point. 294point.
@@ -342,6 +340,8 @@ buries all buffers related to the calendar, selecting other buffers.
342calendar deletes or iconifies that frame depending on the value of 340calendar deletes or iconifies that frame depending on the value of
343@code{calendar-remove-frame-by-deleting}.) 341@code{calendar-remove-frame-by-deleting}.)
344 342
343@c FIXME this mentions holidays and diary entries, albeit briefly, so
344@c should it be moved after those sections? Or at least xref them.
345@node Writing Calendar Files 345@node Writing Calendar Files
346@section Writing Calendar Files 346@section Writing Calendar Files
347 347
@@ -427,7 +427,7 @@ Generate a Filofax-style calendar for one year
427 Some of these commands print the calendar sideways (in ``landscape 427 Some of these commands print the calendar sideways (in ``landscape
428mode''), so it can be wider than it is long. Some of them use Filofax 428mode''), so it can be wider than it is long. Some of them use Filofax
429paper size (3.75in x 6.75in). All of these commands accept a prefix 429paper size (3.75in x 6.75in). All of these commands accept a prefix
430argument which specifies how many days, weeks, months or years to print 430argument, which specifies how many days, weeks, months or years to print
431(starting always with the selected one). 431(starting always with the selected one).
432 432
433 If the variable @code{cal-tex-holidays} is non-@code{nil} (the default), 433 If the variable @code{cal-tex-holidays} is non-@code{nil} (the default),
@@ -452,11 +452,10 @@ to.
452and can display them. You can add your own holidays to the default list. 452and can display them. You can add your own holidays to the default list.
453 453
454@table @kbd 454@table @kbd
455@item h 455@item Mouse-3 Holidays
456@itemx h
456Display holidays for the selected date 457Display holidays for the selected date
457(@code{calendar-cursor-holidays}). 458(@code{calendar-cursor-holidays}).
458@item Mouse-3 Holidays
459Display any holidays for the date you click on.
460@item x 459@item x
461Mark holidays in the calendar window (@code{calendar-mark-holidays}). 460Mark holidays in the calendar window (@code{calendar-mark-holidays}).
462@item u 461@item u
@@ -519,7 +518,7 @@ holidays centered around a different month, use @kbd{C-u M-x
519holidays}, which prompts for the month and year. 518holidays}, which prompts for the month and year.
520 519
521 The holidays known to Emacs include United States holidays and the 520 The holidays known to Emacs include United States holidays and the
522major Baha'i, Chinese, Christian, Islamic, and Jewish holidays; also the 521major Bahá'í, Chinese, Christian, Islamic, and Jewish holidays; also the
523solstices and equinoxes. 522solstices and equinoxes.
524 523
525@findex list-holidays 524@findex list-holidays
@@ -541,11 +540,10 @@ practice}, not historical fact. For example Veteran's Day began in
541times of sunrise and sunset for any date. 540times of sunrise and sunset for any date.
542 541
543@table @kbd 542@table @kbd
544@item S 543@item Mouse-3 Sunrise/sunset
544@itemx S
545Display times of sunrise and sunset for the selected date 545Display times of sunrise and sunset for the selected date
546(@code{calendar-sunrise-sunset}). 546(@code{calendar-sunrise-sunset}).
547@item Mouse-3 Sunrise/sunset
548Display times of sunrise and sunset for the date you click on.
549@item M-x sunrise-sunset 547@item M-x sunrise-sunset
550Display times of sunrise and sunset for today's date. 548Display times of sunrise and sunset for today's date.
551@item C-u M-x sunrise-sunset 549@item C-u M-x sunrise-sunset
@@ -615,9 +613,8 @@ for how daylight saving time is determined.
615 613
616 As a user, you might find it convenient to set the calendar location 614 As a user, you might find it convenient to set the calendar location
617variables for your usual physical location in your @file{.emacs} file. 615variables for your usual physical location in your @file{.emacs} file.
618And when you install Emacs on a machine, you can create a 616If you are a system administrator, you may want to set these variables
619@file{default.el} file which sets them properly for the typical location 617for all users in a @file{default.el} file. @xref{Init File}.
620of most users of that machine. @xref{Init File}.
621 618
622@node Lunar Phases 619@node Lunar Phases
623@section Phases of the Moon 620@section Phases of the Moon
@@ -666,8 +663,8 @@ sixteenth century and was not widely used before the eighteenth century;
666it did not fully displace the Julian calendar and gain universal 663it did not fully displace the Julian calendar and gain universal
667acceptance until the early twentieth century. The Emacs calendar can 664acceptance until the early twentieth century. The Emacs calendar can
668display any month since January, year 1 of the current era, but the 665display any month since January, year 1 of the current era, but the
669calendar displayed is the Gregorian, even for a date at which the 666calendar displayed is always the Gregorian, even for a date at which
670Gregorian calendar did not exist. 667the Gregorian calendar did not exist.
671 668
672 While Emacs cannot display other calendars, it can convert dates to 669 While Emacs cannot display other calendars, it can convert dates to
673and from several other calendars. 670and from several other calendars.
@@ -680,11 +677,13 @@ and from several other calendars.
680* Mayan Calendar:: Moving to a date specified in a Mayan calendar. 677* Mayan Calendar:: Moving to a date specified in a Mayan calendar.
681@end menu 678@end menu
682 679
680@c FIXME perhaps most of the details should be moved to cal-xtra.
681@c Just list the major supported systems here?
683@node Calendar Systems 682@node Calendar Systems
684@subsection Supported Calendar Systems 683@subsection Supported Calendar Systems
685 684
686@cindex ISO commercial calendar 685@cindex ISO commercial calendar
687 The ISO commercial calendar is used largely in Europe. 686 The ISO commercial calendar is often used in business.
688 687
689@cindex Julian calendar 688@cindex Julian calendar
690 The Julian calendar, named after Julius Caesar, was the one used in Europe 689 The Julian calendar, named after Julius Caesar, was the one used in Europe
@@ -745,7 +744,8 @@ championed by Birashk, based on a 2,820-year cycle. It differs from
745the astronomical Persian calendar, which is based on astronomical 744the astronomical Persian calendar, which is based on astronomical
746events. As of this writing the first future discrepancy is projected 745events. As of this writing the first future discrepancy is projected
747to occur on March 20, 2025. It is currently not clear what the 746to occur on March 20, 2025. It is currently not clear what the
748official calendar of Iran will be that far into the future. 747official calendar of Iran will be at that time.
748@c FIXME not so far in the future now.
749 749
750@cindex Chinese calendar 750@cindex Chinese calendar
751 The Chinese calendar is a complicated system of lunar months arranged 751 The Chinese calendar is a complicated system of lunar months arranged
@@ -756,8 +756,8 @@ days are named by combining one of ten ``celestial stems'' with one of
756twelve ``terrestrial branches'' for a total of sixty names that are 756twelve ``terrestrial branches'' for a total of sixty names that are
757repeated in a cycle of sixty. 757repeated in a cycle of sixty.
758 758
759@cindex Baha'i calendar 759@cindex Bahá'í calendar
760 The Baha'i calendar system is based on a solar cycle of 19 months with 760 The Bahá'í calendar system is based on a solar cycle of 19 months with
76119 days each. The four remaining ``intercalary'' days are placed 76119 days each. The four remaining ``intercalary'' days are placed
762between the 18th and 19th months. 762between the 18th and 19th months.
763 763
@@ -768,11 +768,10 @@ between the 18th and 19th months.
768in various other calendar systems: 768in various other calendar systems:
769 769
770@table @kbd 770@table @kbd
771@item Mouse-3 Other calendars
772Display the date that you click on, expressed in various other calendars.
773@kindex p @r{(Calendar mode)} 771@kindex p @r{(Calendar mode)}
774@findex calendar-print-other-dates 772@findex calendar-print-other-dates
775@item p o 773@item Mouse-3 Other calendars
774@itemx p o
776Display the selected date in various other calendars. 775Display the selected date in various other calendars.
777(@code{calendar-print-other-dates}). 776(@code{calendar-print-other-dates}).
778@findex calendar-iso-print-date 777@findex calendar-iso-print-date
@@ -798,7 +797,7 @@ Display French Revolutionary date for selected day
798(@code{calendar-french-print-date}). 797(@code{calendar-french-print-date}).
799@findex calendar-bahai-print-date 798@findex calendar-bahai-print-date
800@item p b 799@item p b
801Display Baha'i date for selected day 800Display Bahá'í date for selected day
802(@code{calendar-bahai-print-date}). 801(@code{calendar-bahai-print-date}).
803@findex calendar-chinese-print-date 802@findex calendar-chinese-print-date
804@item p C 803@item p C
@@ -821,18 +820,16 @@ Display Persian date for selected day
821Display Mayan date for selected day (@code{calendar-mayan-print-date}). 820Display Mayan date for selected day (@code{calendar-mayan-print-date}).
822@end table 821@end table
823 822
824 If you are using a graphic display, the easiest way to translate a
825date into other calendars is to click on it with @kbd{Mouse-3}, then
826choose @kbd{Other calendars} from the menu that appears. This displays
827the equivalent forms of the date in all the calendars Emacs understands,
828in the form of a menu. (Choosing an alternative from this menu doesn't
829actually do anything---the menu is used only for display.)
830
831 Otherwise, move point to the date you want to convert, then type the 823 Otherwise, move point to the date you want to convert, then type the
832appropriate command starting with @kbd{p} from the table above. The 824appropriate command starting with @kbd{p} from the table above. The
833prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the 825prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the
834equivalent date in the echo area. @kbd{p o} displays the 826equivalent date in the echo area. @kbd{p o} displays the
835date in all forms known to Emacs. 827date in all forms known to Emacs. You can also use @kbd{Mouse-3} and
828then choose @kbd{Other calendars} from the menu that appears. This
829displays the equivalent forms of the date in all the calendars Emacs
830understands, in the form of a menu. (Choosing an alternative from
831this menu doesn't actually do anything---the menu is used only for
832display.)
836 833
837@node From Other Calendar 834@node From Other Calendar
838@subsection Converting From Other Calendars 835@subsection Converting From Other Calendars
@@ -868,7 +865,7 @@ Move to a date specified in the Julian calendar
868Move to a date specified with an astronomical (Julian) day number 865Move to a date specified with an astronomical (Julian) day number
869(@code{calendar-astro-goto-day-number}). 866(@code{calendar-astro-goto-day-number}).
870@item g b 867@item g b
871Move to a date specified in the Baha'i calendar 868Move to a date specified in the Bahá'í calendar
872(@code{calendar-bahai-goto-date}). 869(@code{calendar-bahai-goto-date}).
873@item g h 870@item g h
874Move to a date specified in the Hebrew calendar 871Move to a date specified in the Hebrew calendar
@@ -903,7 +900,7 @@ Islamic, or French names.
903@c FIXME move? 900@c FIXME move?
904@findex calendar-hebrew-list-yahrzeits 901@findex calendar-hebrew-list-yahrzeits
905@cindex yahrzeits 902@cindex yahrzeits
906 One common question concerning the Hebrew calendar is the computation 903 One common issue concerning the Hebrew calendar is the computation
907of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs 904of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs
908calendar includes a facility for such calculations. If you are in the 905calendar includes a facility for such calculations. If you are in the
909calendar, the command @kbd{M-x calendar-hebrew-list-yahrzeits} asks you for 906calendar, the command @kbd{M-x calendar-hebrew-list-yahrzeits} asks you for
@@ -912,6 +909,7 @@ years for the date given by point. If you are not in the calendar,
912this command first asks you for the date of death and the range of 909this command first asks you for the date of death and the range of
913years, and then displays the list of yahrzeit dates. 910years, and then displays the list of yahrzeit dates.
914 911
912@c FIXME move to emacs-xtra.
915@node Mayan Calendar 913@node Mayan Calendar
916@subsection Converting from the Mayan Calendar 914@subsection Converting from the Mayan Calendar
917 915
@@ -974,7 +972,7 @@ to go to the next occurrence of a tzolkin date.
974@findex calendar-mayan-next-haab-date 972@findex calendar-mayan-next-haab-date
975@cindex Mayan haab calendar 973@cindex Mayan haab calendar
976 The Mayan haab calendar is a cycle of 365 days arranged as 18 months 974 The Mayan haab calendar is a cycle of 365 days arranged as 18 months
977of 20 days each, followed a 5-day monthless period. Like the tzolkin 975of 20 days each, followed by a 5-day monthless period. Like the tzolkin
978cycle, this cycle repeats endlessly, and there are commands to move 976cycle, this cycle repeats endlessly, and there are commands to move
979backward and forward to the previous or next point in the cycle. Type 977backward and forward to the previous or next point in the cycle. Type
980@kbd{g m p h} to go to the previous haab date; Emacs asks you for a haab 978@kbd{g m p h} to go to the previous haab date; Emacs asks you for a haab
@@ -1014,7 +1012,7 @@ date.
1014showing what that file looks like: 1012showing what that file looks like:
1015 1013
1016@example 1014@example
101712/22/1988 Twentieth wedding anniversary!! 101512/22/2012 Twentieth wedding anniversary!!
1018&1/1. Happy New Year! 1016&1/1. Happy New Year!
101910/22 Ruth's birthday. 101710/22 Ruth's birthday.
1020* 21, *: Payday 1018* 21, *: Payday
@@ -1023,15 +1021,15 @@ Tuesday--weekly meeting with grad students at 10am
10231/13/89 Friday the thirteenth!! 10211/13/89 Friday the thirteenth!!
1024&thu 4pm squash game with Lloyd. 1022&thu 4pm squash game with Lloyd.
1025mar 16 Dad's birthday 1023mar 16 Dad's birthday
1026April 15, 1989 Income tax due. 1024April 15, 2013 Income tax due.
1027&* 15 time cards due. 1025&* 15 time cards due.
1028@end example 1026@end example
1029 1027
1030@noindent 1028@noindent
1031This format is essentially the same as the one used by the system's 1029This format is essentially the same as the one used by the separate
1032@command{calendar} utility. This example uses extra spaces to align 1030@command{calendar} utility that is present on some Unix systems. This
1033the event descriptions of most of the entries. Such formatting is 1031example uses extra spaces to align the event descriptions of most of
1034purely a matter of taste. 1032the entries. Such formatting is purely a matter of taste.
1035 1033
1036 Although you probably will start by creating a diary manually, Emacs 1034 Although you probably will start by creating a diary manually, Emacs
1037provides a number of commands to let you view, add, and change diary 1035provides a number of commands to let you view, add, and change diary
@@ -1053,11 +1051,10 @@ it. You can also view today's events outside of Calendar mode. In the
1053following, key bindings refer to the Calendar buffer. 1051following, key bindings refer to the Calendar buffer.
1054 1052
1055@table @kbd 1053@table @kbd
1056@item d 1054@item Mouse-3 Diary
1055@itemx d
1057Display all diary entries for the selected date 1056Display all diary entries for the selected date
1058(@code{diary-view-entries}). 1057(@code{diary-view-entries}).
1059@item Mouse-3 Diary
1060Display all diary entries for the date you click on.
1061@item s 1058@item s
1062Display the entire diary file (@code{diary-show-all-entries}). 1059Display the entire diary file (@code{diary-show-all-entries}).
1063@item m 1060@item m
@@ -1111,8 +1108,8 @@ a different face.
1111@xref{Calendar Customizing, diary-entry-marker}. 1108@xref{Calendar Customizing, diary-entry-marker}.
1112@end ifnottex 1109@end ifnottex
1113 1110
1114 The command applies both to the currently visible months and to 1111 This command applies both to the months that are currently visible
1115other months that subsequently become visible by scrolling. To turn 1112and to those that subsequently become visible after scrolling. To turn
1116marking off and erase the current marks, type @kbd{u}, which also 1113marking off and erase the current marks, type @kbd{u}, which also
1117turns off holiday marks (@pxref{Holidays}). If the variable 1114turns off holiday marks (@pxref{Holidays}). If the variable
1118@code{calendar-mark-diary-entries-flag} is non-@code{nil}, creating or 1115@code{calendar-mark-diary-entries-flag} is non-@code{nil}, creating or
@@ -1136,13 +1133,13 @@ how many days to include.
1136@end ifnottex 1133@end ifnottex
1137 1134
1138 If you put @code{(diary)} in your @file{.emacs} file, this 1135 If you put @code{(diary)} in your @file{.emacs} file, this
1139automatically displays a window with the day's diary entries, when you 1136automatically displays a window with the day's diary entries when you
1140enter Emacs. 1137start Emacs.
1141 1138
1142@findex diary-mail-entries 1139@findex diary-mail-entries
1143@vindex diary-mail-days 1140@vindex diary-mail-days
1144 Many users like to receive notice of events in their diary as email. 1141 Some people like to receive email notifications of events in their
1145To send such mail to yourself, use the command @kbd{M-x 1142diary. To send such mail to yourself, use the command @kbd{M-x
1146diary-mail-entries}. A prefix argument specifies how many days 1143diary-mail-entries}. A prefix argument specifies how many days
1147(starting with today) to check; otherwise, the variable 1144(starting with today) to check; otherwise, the variable
1148@code{diary-mail-days} says how many days. 1145@code{diary-mail-days} says how many days.
@@ -1173,7 +1170,7 @@ consists only of the date or day name (with no following blanks or
1173punctuation). For example: 1170punctuation). For example:
1174 1171
1175@example 1172@example
117602/11/1989 117302/11/2012
1177 Bill B. visits Princeton today 1174 Bill B. visits Princeton today
1178 2pm Cognitive Studies Committee meeting 1175 2pm Cognitive Studies Committee meeting
1179 2:30-5:30 Liz at Lawrenceville 1176 2:30-5:30 Liz at Lawrenceville
@@ -1198,10 +1195,11 @@ for more than one day's entries.
1198 1195
1199@vindex diary-nonmarking-symbol 1196@vindex diary-nonmarking-symbol
1200 You can inhibit the marking of certain diary entries in the calendar 1197 You can inhibit the marking of certain diary entries in the calendar
1201window; to do this, insert an ampersand @code{diary-nonmarking-symbol} 1198window; to do this, insert the string that
1202(default @samp{&}) at the beginning of the entry, before the date. This 1199@code{diary-nonmarking-symbol} specifies (default @samp{&}) at the
1203has no effect on display of the entry in the diary window; it affects 1200beginning of the entry, before the date. This
1204only marks on dates in the calendar window. Nonmarking entries are 1201has no effect on display of the entry in the diary window; it only
1202affects marks on dates in the calendar window. Nonmarking entries are
1205especially useful for generic entries that would otherwise mark many 1203especially useful for generic entries that would otherwise mark many
1206different dates. 1204different dates.
1207 1205
@@ -1214,14 +1212,14 @@ formatting a date. The examples all show dates in American order
1214month, year) and ISO order (year, month, day) as options. 1212month, year) and ISO order (year, month, day) as options.
1215 1213
1216@example 1214@example
12174/20/93 Switch-over to new tabulation system 12154/20/12 Switch-over to new tabulation system
1218apr. 25 Start tabulating annual results 1216apr. 25 Start tabulating annual results
12194/30 Results for April are due 12174/30 Results for April are due
1220*/25 Monthly cycle finishes 1218*/25 Monthly cycle finishes
1221Friday Don't leave without backing up files 1219Friday Don't leave without backing up files
1222@end example 1220@end example
1223 1221
1224 The first entry appears only once, on April 20, 1993. The second and 1222 The first entry appears only once, on April 20, 2012. The second and
1225third appear every year on the specified dates, and the fourth uses a 1223third appear every year on the specified dates, and the fourth uses a
1226wildcard (asterisk) for the month, so it appears on the 25th of every 1224wildcard (asterisk) for the month, so it appears on the 25th of every
1227month. The final entry appears every week on Friday. 1225month. The final entry appears every week on Friday.
@@ -1231,7 +1229,7 @@ month. The final entry appears every week on Friday.
1231This must be followed by a nondigit. In the date itself, @var{month} 1229This must be followed by a nondigit. In the date itself, @var{month}
1232and @var{day} are numbers of one or two digits. The optional @var{year} 1230and @var{day} are numbers of one or two digits. The optional @var{year}
1233is also a number, and may be abbreviated to the last two digits; that 1231is also a number, and may be abbreviated to the last two digits; that
1234is, you can use @samp{11/12/1989} or @samp{11/12/89}. 1232is, you can use @samp{11/12/2012} or @samp{11/12/12}.
1235 1233
1236 Dates can also have the form @samp{@var{monthname} @var{day}} or 1234 Dates can also have the form @samp{@var{monthname} @var{day}} or
1237@samp{@var{monthname} @var{day}, @var{year}}, where the month's name can 1235@samp{@var{monthname} @var{day}, @var{year}}, where the month's name can
@@ -1245,7 +1243,7 @@ letters of a name as its abbreviation. Case is not significant.
1245 A date may be @dfn{generic}; that is, partially unspecified. Then the 1243 A date may be @dfn{generic}; that is, partially unspecified. Then the
1246entry applies to all dates that match the specification. If the date 1244entry applies to all dates that match the specification. If the date
1247does not contain a year, it is generic and applies to any year. 1245does not contain a year, it is generic and applies to any year.
1248Alternatively, @var{month}, @var{day}, or @var{year} can be a @samp{*}; 1246Alternatively, @var{month}, @var{day}, or @var{year} can be @samp{*};
1249this matches any month, day, or year, respectively. Thus, a diary entry 1247this matches any month, day, or year, respectively. Thus, a diary entry
1250@samp{3/*/*} matches any day in March of any year; so does @samp{march 1248@samp{3/*/*} matches any day in March of any year; so does @samp{march
1251*}. 1249*}.
@@ -1311,7 +1309,7 @@ command, and type the rest of the entry. Similarly, you can insert a
1311yearly diary entry with the @kbd{i y} command. 1309yearly diary entry with the @kbd{i y} command.
1312 1310
1313 All of the above commands make marking diary entries by default. To 1311 All of the above commands make marking diary entries by default. To
1314make a nonmarking diary entry, give a numeric argument to the command. 1312make a nonmarking diary entry, give a prefix argument to the command.
1315For example, @kbd{C-u i w} makes a nonmarking weekly diary entry. 1313For example, @kbd{C-u i w} makes a nonmarking weekly diary entry.
1316 1314
1317 When you modify the diary file, be sure to save the file before 1315 When you modify the diary file, be sure to save the file before
@@ -1368,15 +1366,15 @@ diary functions can use it to calculate the number of elapsed years.
1368 1366
1369 A @dfn{block} diary entry applies to a specified range of consecutive 1367 A @dfn{block} diary entry applies to a specified range of consecutive
1370dates. Here is a block diary entry that applies to all dates from June 1368dates. Here is a block diary entry that applies to all dates from June
137124, 1990 through July 10, 1990: 136924, 2012 through July 10, 2012:
1372 1370
1373@findex diary-block 1371@findex diary-block
1374@example 1372@example
1375%%(diary-block 6 24 1990 7 10 1990) Vacation 1373%%(diary-block 6 24 2012 7 10 2012) Vacation
1376@end example 1374@end example
1377 1375
1378@noindent 1376@noindent
1379The @samp{6 24 1990} indicates the starting date and the @samp{7 10 1990} 1377The @samp{6 24 2012} indicates the starting date and the @samp{7 10 2012}
1380indicates the stopping date. (Again, if you are using the European or ISO 1378indicates the stopping date. (Again, if you are using the European or ISO
1381calendar style, the input order of month, day and year is different.) 1379calendar style, the input order of month, day and year is different.)
1382 1380
@@ -1396,23 +1394,23 @@ which looks like this:
1396 1394
1397@findex diary-cyclic 1395@findex diary-cyclic
1398@example 1396@example
1399%%(diary-cyclic 50 3 1 1990) Renew medication 1397%%(diary-cyclic 50 3 1 2012) Renew medication
1400@end example 1398@end example
1401 1399
1402@noindent 1400@noindent
1403This entry applies to March 1, 1990 and every 50th day following; 1401This entry applies to March 1, 2012 and every 50th day following;
1404@samp{3 1 1990} specifies the starting date. (If you are using the 1402@samp{3 1 2012} specifies the starting date. (If you are using the
1405European or ISO calendar style, the input order of month, day and year 1403European or ISO calendar style, the input order of month, day and year
1406is different.) 1404is different.)
1407 1405
1408 All three of these commands make marking diary entries. To insert a 1406 All three of these commands make marking diary entries. To insert a
1409nonmarking entry, give a numeric argument to the command. For example, 1407nonmarking entry, give a prefix argument to the command. For example,
1410@kbd{C-u i a} makes a nonmarking anniversary diary entry. 1408@kbd{C-u i a} makes a nonmarking anniversary diary entry.
1411 1409
1412 Marking sexp diary entries in the calendar is @emph{extremely} 1410 Marking sexp diary entries in the calendar can be time-consuming,
1413time-consuming, since every date visible in the calendar window must be 1411since every date visible in the calendar window must be individually
1414individually checked. So it's a good idea to make sexp diary entries 1412checked. So it's a good idea to make sexp diary entries nonmarking
1415nonmarking (with @samp{&}) when possible. 1413(with @samp{&}) when possible.
1416 1414
1417 Another sophisticated kind of sexp entry, a @dfn{floating} diary entry, 1415 Another sophisticated kind of sexp entry, a @dfn{floating} diary entry,
1418specifies a regularly occurring event by offsets specified in days, 1416specifies a regularly occurring event by offsets specified in days,
@@ -1454,8 +1452,8 @@ can perform arbitrary computations to determine when they apply.
1454@vindex appt-audible 1452@vindex appt-audible
1455@vindex appt-display-mode-line 1453@vindex appt-display-mode-line
1456 If you have a diary entry for an appointment, and that diary entry 1454 If you have a diary entry for an appointment, and that diary entry
1457begins with a recognizable time of day, Emacs can warn you several 1455begins with a recognizable time of day, Emacs can warn you in advance
1458minutes beforehand that that appointment is pending. Emacs alerts you 1456that an appointment is pending. Emacs alerts you
1459to the appointment by displaying a message in your chosen format, as 1457to the appointment by displaying a message in your chosen format, as
1460specified by the variable @code{appt-display-format}. If the value of 1458specified by the variable @code{appt-display-format}. If the value of
1461@code{appt-audible} is non-@code{nil}, the warning includes an audible 1459@code{appt-audible} is non-@code{nil}, the warning includes an audible
@@ -1542,6 +1540,7 @@ diary-from-outlook} to import the entry. You can make this command
1542recognize additional appointment message formats by customizing the 1540recognize additional appointment message formats by customizing the
1543variable @code{diary-outlook-formats}. 1541variable @code{diary-outlook-formats}.
1544 1542
1543@c FIXME the name of the RFC is hardly very relevant.
1545@cindex iCalendar support 1544@cindex iCalendar support
1546 The icalendar package allows you to transfer data between your Emacs 1545 The icalendar package allows you to transfer data between your Emacs
1547diary file and iCalendar files, which are defined in ``RFC 1546diary file and iCalendar files, which are defined in ``RFC
@@ -1556,7 +1555,7 @@ diary file and iCalendar files, which are defined in ``RFC
1556 1555
1557@findex icalendar-import-buffer 1556@findex icalendar-import-buffer
1558 The command @code{icalendar-import-buffer} extracts 1557 The command @code{icalendar-import-buffer} extracts
1559iCalendar data from the current buffer and adds it to your (default) 1558iCalendar data from the current buffer and adds it to your
1560diary file. This function is also suitable for automatic extraction of 1559diary file. This function is also suitable for automatic extraction of
1561iCalendar data; for example with the Rmail mail client one could use: 1560iCalendar data; for example with the Rmail mail client one could use:
1562 1561
@@ -1588,7 +1587,7 @@ to the main diary file, if these are different files.
1588 Use @code{icalendar-export-file} to interactively export an entire 1587 Use @code{icalendar-export-file} to interactively export an entire
1589Emacs diary file to iCalendar format. To export only a part of a diary 1588Emacs diary file to iCalendar format. To export only a part of a diary
1590file, mark the relevant area, and call @code{icalendar-export-region}. 1589file, mark the relevant area, and call @code{icalendar-export-region}.
1591In both cases the result is appended to the target file. 1590In both cases, Emacs appends the result to the target file.
1592 1591
1593@node Daylight Saving 1592@node Daylight Saving
1594@section Daylight Saving Time 1593@section Daylight Saving Time
@@ -1694,7 +1693,7 @@ workday in the mode line, either customize the
1694@vindex timeclock-ask-before-exiting 1693@vindex timeclock-ask-before-exiting
1695 Terminating the current Emacs session might or might not mean that 1694 Terminating the current Emacs session might or might not mean that
1696you have stopped working on the project and, by default, Emacs asks 1695you have stopped working on the project and, by default, Emacs asks
1697you. You can, however, set customize the value of the variable 1696you. You can, however, customize the value of the variable
1698@code{timeclock-ask-before-exiting} to @code{nil} to avoid the question; 1697@code{timeclock-ask-before-exiting} to @code{nil} to avoid the question;
1699then, only an explicit @kbd{M-x timeclock-out} or @kbd{M-x 1698then, only an explicit @kbd{M-x timeclock-out} or @kbd{M-x
1700timeclock-change} will tell Emacs that the current interval is over. 1699timeclock-change} will tell Emacs that the current interval is over.
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi
index bc141650b4a..81de9a800f9 100644
--- a/doc/emacs/dired-xtra.texi
+++ b/doc/emacs/dired-xtra.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 2004-2012 Free Software Foundation, Inc. 2@c Copyright (C) 2004-2012 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@c 4@c
5@c This file is included either in emacs-xtra.texi (when producing the 5@c This file is included either in emacs-xtra.texi (when producing the
@@ -9,12 +9,19 @@
9 9
10You can insert subdirectories with specified @command{ls} switches in 10You can insert subdirectories with specified @command{ls} switches in
11Dired buffers using @kbd{C-u i}. You can change the @command{ls} 11Dired buffers using @kbd{C-u i}. You can change the @command{ls}
12switches of an already inserted subdirectory using @kbd{C-u l}. 12switches of an already inserted subdirectory at point using @kbd{C-u l}.
13 13
14Dired preserves the switches if you revert the buffer. Deleting a 14Dired preserves the switches if you revert the buffer. Deleting a
15subdirectory forgets about its switches. 15subdirectory forgets about its switches.
16 16
17Using @code{dired-undo} (@pxref{Marks vs Flags}) to reinsert or delete 17Using @code{dired-undo}
18@iftex
19(@pxref{Marks vs Flags,,, emacs, the Emacs Manual})
20@end iftex
21@ifnottex
22(@pxref{Marks vs Flags})
23@end ifnottex
24to reinsert or delete
18subdirectories that were inserted with explicit switches can bypass 25subdirectories that were inserted with explicit switches can bypass
19Dired's machinery for remembering (or forgetting) switches. Deleting 26Dired's machinery for remembering (or forgetting) switches. Deleting
20a subdirectory using @code{dired-undo} does not forget its switches. 27a subdirectory using @code{dired-undo} does not forget its switches.
diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi
index 5fc20fae8a3..0dc99034ae6 100644
--- a/doc/emacs/fortran-xtra.texi
+++ b/doc/emacs/fortran-xtra.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 2004-2012 Free Software Foundation, Inc. 2@c Copyright (C) 2004-2012 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@c 4@c
5@c This file is included either in emacs-xtra.texi (when producing the 5@c This file is included either in emacs-xtra.texi (when producing the
@@ -70,11 +70,10 @@ command runs the hook @code{fortran-mode-hook}.
70@subsection Motion Commands 70@subsection Motion Commands
71 71
72 In addition to the normal commands for moving by and operating on 72 In addition to the normal commands for moving by and operating on
73``defuns'' (Fortran subprograms---functions and subroutines, using the 73``defuns'' (Fortran subprograms---functions and subroutines, as well
74commands @code{fortran-beginning-of-subprogram} and 74as modules for F90 mode, using the commands @code{fortran-end-of-subprogram}
75@code{fortran-end-of-subprogram}; as well as modules for F90 mode), 75and @code{fortran-beginning-of-subprogram}), Fortran mode provides
76Fortran mode provides special commands to move by statements and other 76special commands to move by statements and other program units.
77program units.
78 77
79@table @kbd 78@table @kbd
80@kindex C-c C-n @r{(Fortran mode)} 79@kindex C-c C-n @r{(Fortran mode)}
@@ -97,16 +96,15 @@ statement in the buffer), move to the start of the buffer.
97@findex f90-next-block 96@findex f90-next-block
98@item C-c C-e 97@item C-c C-e
99Move point forward to the start of the next code block, or the end of 98Move point forward to the start of the next code block, or the end of
100the current block, whichever is encountered first. 99the current one, whichever comes first (@code{f90-next-block}).
101(@code{f90-next-block}). A code block is a subroutine, 100A code block is a subroutine, @code{if}--@code{endif} statement, and
102@code{if}--@code{endif} statement, and so forth. This command exists 101so forth. This command exists for F90 mode only, not Fortran mode.
103for F90 mode only, not Fortran mode. With a numeric argument, this 102With a numeric argument, it moves forward that many blocks.
104moves forward that many blocks.
105 103
106@kindex C-c C-a @r{(F90 mode)} 104@kindex C-c C-a @r{(F90 mode)}
107@findex f90-previous-block 105@findex f90-previous-block
108@item C-c C-a 106@item C-c C-a
109Move point backward to the previous code block 107Move point backward to the previous block
110(@code{f90-previous-block}). This is like @code{f90-next-block}, but 108(@code{f90-previous-block}). This is like @code{f90-next-block}, but
111moves backwards. 109moves backwards.
112 110
@@ -163,7 +161,7 @@ Break the current line at point and set up a continuation line
163@item M-^ 161@item M-^
164Join this line to the previous line (@code{fortran-join-line}). 162Join this line to the previous line (@code{fortran-join-line}).
165@item C-M-q 163@item C-M-q
166Indent all the lines of the subprogram point is in 164Indent all the lines of the subprogram that point is in
167(@code{fortran-indent-subprogram}). 165(@code{fortran-indent-subprogram}).
168@item M-q 166@item M-q
169Fill a comment block or statement (using @code{fortran-fill-paragraph} 167Fill a comment block or statement (using @code{fortran-fill-paragraph}
@@ -239,17 +237,17 @@ to the continuation style.
239 The setting of continuation style affects several other aspects of 237 The setting of continuation style affects several other aspects of
240editing in Fortran mode. In fixed form mode, the minimum column 238editing in Fortran mode. In fixed form mode, the minimum column
241number for the body of a statement is 6. Lines inside of Fortran 239number for the body of a statement is 6. Lines inside of Fortran
242blocks that are indented to larger column numbers always use only the 240blocks that are indented to larger column numbers must use only the
243space character for whitespace. In tab format mode, the minimum 241space character for whitespace. In tab format mode, the minimum
244column number for the statement body is 8, and the whitespace before 242column number for the statement body is 8, and the whitespace before
245column 8 must always consist of one tab character. 243column 8 must consist of one tab character.
246 244
247@node ForIndent Num 245@node ForIndent Num
248@subsubsection Line Numbers 246@subsubsection Line Numbers
249 247
250 If a number is the first non-whitespace in the line, Fortran 248 If a number is the first non-whitespace in the line, Fortran
251indentation assumes it is a line number and moves it to columns 0 249indentation assumes it is a line number and moves it to columns 0
252through 4. (Columns always count from 0 in GNU Emacs.) 250through 4. (Columns always count from 0 in Emacs.)
253 251
254@vindex fortran-line-number-indent 252@vindex fortran-line-number-indent
255 Line numbers of four digits or less are normally indented one space. 253 Line numbers of four digits or less are normally indented one space.
@@ -329,7 +327,7 @@ non-@code{nil} value, indenting any numbered statement must check for a
329@samp{do} that ends there. If you always end @samp{do} statements with 327@samp{do} that ends there. If you always end @samp{do} statements with
330a @samp{continue} line (or if you use the more modern @samp{enddo}), 328a @samp{continue} line (or if you use the more modern @samp{enddo}),
331then you can speed up indentation by setting this variable to 329then you can speed up indentation by setting this variable to
332@code{nil}. The default is @code{nil}. 330@code{nil} (the default).
333 331
334@item fortran-blink-matching-if 332@item fortran-blink-matching-if
335If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} 333If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
@@ -338,17 +336,17 @@ statement moves the cursor momentarily to the matching @samp{if} (or
338 336
339@item fortran-minimum-statement-indent-fixed 337@item fortran-minimum-statement-indent-fixed
340Minimum indentation for Fortran statements when using fixed form 338Minimum indentation for Fortran statements when using fixed form
341continuation line style. Statement bodies are never indented less than 339continuation line style. Statement bodies are never indented by less than
342this much. The default is 6. 340this. The default is 6.
343 341
344@item fortran-minimum-statement-indent-tab 342@item fortran-minimum-statement-indent-tab
345Minimum indentation for Fortran statements for tab format continuation line 343Minimum indentation for Fortran statements for tab format continuation line
346style. Statement bodies are never indented less than this much. The 344style. Statement bodies are never indented by less than this. The
347default is 8. 345default is 8.
348@end table 346@end table
349 347
350The variables controlling the indentation of comments are described in 348The following section describes the variables controlling the
351the following section. 349indentation of comments.
352 350
353@node Fortran Comments 351@node Fortran Comments
354@subsection Fortran Comments 352@subsection Fortran Comments
@@ -364,7 +362,7 @@ comments start with @samp{!} and can follow other text. Because only
364some Fortran 77 compilers accept this syntax, Fortran mode will not 362some Fortran 77 compilers accept this syntax, Fortran mode will not
365insert such comments unless you have said in advance to do so. To do 363insert such comments unless you have said in advance to do so. To do
366this, set the variable @code{fortran-comment-line-start} to @samp{"!"}. 364this, set the variable @code{fortran-comment-line-start} to @samp{"!"}.
367If you use an unusual value, you may also need to adjust 365If you use an unusual value, you may need to change
368@code{fortran-comment-line-start-skip}. 366@code{fortran-comment-line-start-skip}.
369 367
370 368
@@ -373,7 +371,7 @@ If you use an unusual value, you may also need to adjust
373Align comment or insert new comment (@code{comment-dwim}). 371Align comment or insert new comment (@code{comment-dwim}).
374 372
375@item C-x ; 373@item C-x ;
376Applies to nonstandard @samp{!} comments only. 374Applies to nonstandard @samp{!} comments only (@code{comment-set-column}).
377 375
378@item C-c ; 376@item C-c ;
379Turn all lines of the region into comments, or (with argument) turn them back 377Turn all lines of the region into comments, or (with argument) turn them back
@@ -406,10 +404,10 @@ Align the text at a fixed column, which is the sum of
406@code{fortran-comment-line-extra-indent} and the minimum statement 404@code{fortran-comment-line-extra-indent} and the minimum statement
407indentation. This is the default. 405indentation. This is the default.
408 406
409The minimum statement indentation is 407The minimum indentation is
410@code{fortran-minimum-statement-indent-fixed} for fixed form 408@code{fortran-minimum-statement-indent-tab} for tab format
411continuation line style and @code{fortran-minimum-statement-indent-tab} 409continuation line style and @code{fortran-minimum-statement-indent-fixed}
412for tab format style. 410for fixed form style.
413 411
414@item relative 412@item relative
415Align the text as if it were a line of code, but with an additional 413Align the text as if it were a line of code, but with an additional
@@ -434,17 +432,17 @@ never be indented at all, no matter what the value of
434lines are directives. Matching lines are never indented, and receive 432lines are directives. Matching lines are never indented, and receive
435distinctive font-locking. 433distinctive font-locking.
436 434
437 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If 435 The normal Emacs comment command @kbd{C-x ;} (@code{comment-set-column})
438you use @samp{!} comments, this command can be used with them. Otherwise 436has not been redefined. If you use @samp{!} comments, this command
439it is useless in Fortran mode. 437can be used with them. Otherwise it is useless in Fortran mode.
440 438
441@kindex C-c ; @r{(Fortran mode)} 439@kindex C-c ; @r{(Fortran mode)}
442@findex fortran-comment-region 440@findex fortran-comment-region
443@vindex fortran-comment-region 441@vindex fortran-comment-region
444 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the 442 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
445lines of the region into comments by inserting the string @samp{C$$$} at 443lines of the region into comments by inserting the string @samp{c$$$} at
446the front of each one. With a numeric argument, it turns the region 444the front of each one. With a numeric argument, it turns the region
447back into live code by deleting @samp{C$$$} from the front of each line 445back into live code by deleting @samp{c$$$} from the front of each line
448in it. The string used for these comments can be controlled by setting 446in it. The string used for these comments can be controlled by setting
449the variable @code{fortran-comment-region}. Note that here we have an 447the variable @code{fortran-comment-region}. Note that here we have an
450example of a command and a variable with the same name; these two uses 448example of a command and a variable with the same name; these two uses
@@ -507,8 +505,7 @@ Display a ``column ruler'' momentarily above the current line
507Split the current window horizontally temporarily so that it is 505Split the current window horizontally temporarily so that it is
508@code{fortran-line-length} columns wide 506@code{fortran-line-length} columns wide
509(@code{fortran-window-create-momentarily}). This may help you avoid 507(@code{fortran-window-create-momentarily}). This may help you avoid
510making lines longer than the character limit imposed by your Fortran 508making lines longer than the limit imposed by your Fortran compiler.
511compiler.
512@item C-u C-c C-w 509@item C-u C-c C-w
513Split the current window horizontally so that it is 510Split the current window horizontally so that it is
514@code{fortran-line-length} columns wide (@code{fortran-window-create}). 511@code{fortran-line-length} columns wide (@code{fortran-window-create}).
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
index 6f154ce2af6..a2cb5d9f8f2 100644
--- a/doc/emacs/sending.texi
+++ b/doc/emacs/sending.texi
@@ -377,8 +377,8 @@ sending mail via @code{smtpmail-send-it} (see below).
377Send mail using the through an external mail host, such as your 377Send mail using the through an external mail host, such as your
378Internet service provider's outgoing SMTP mail server. If you have 378Internet service provider's outgoing SMTP mail server. If you have
379not told Emacs how to contact the SMTP server, it prompts for this 379not told Emacs how to contact the SMTP server, it prompts for this
380information, which is saved in the variables 380information, which is saved in the @code{smtpmail-smtp-server} variable
381@code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}. 381and the file @file{~/.authinfo}.
382@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}. 382@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}.
383 383
384@item sendmail-send-it 384@item sendmail-send-it
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 48b902f18c1..cd5ed206dd6 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -123,7 +123,7 @@ working tree, and schedule the renaming for committing.
123it via the version control system. The file is removed from the 123it via the version control system. The file is removed from the
124working tree, and in the VC Directory buffer 124working tree, and in the VC Directory buffer
125@iftex 125@iftex
126(@pxref{VC Directory Mode}), 126(@pxref{VC Directory Mode,,, emacs, the Emacs Manual}),
127@end iftex 127@end iftex
128@ifnottex 128@ifnottex
129(@pxref{VC Directory Mode}), 129(@pxref{VC Directory Mode}),
@@ -438,4 +438,10 @@ difference is that the ``manual'' version backups made by @kbd{C-x v
438locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; 438locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature;
439see the CVS documentation for details. If that case, you can use 439see the CVS documentation for details. If that case, you can use
440@kbd{C-x v v} in Emacs to toggle locking, as you would for a 440@kbd{C-x v v} in Emacs to toggle locking, as you would for a
441locking-based version control system (@pxref{VC With A Locking VCS}). 441locking-based version control system
442@iftex
443(@pxref{VC With A Locking VCS,,,emacs, the Emacs Manual}).
444@end iftex
445@ifnottex
446(@pxref{VC With A Locking VCS}).
447@end ifnottex
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index baab5113057..5e67238726e 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,54 @@
12012-02-16 Chong Yidong <cyd@gnu.org>
2
3 * syntax.texi (Syntax Tables, Syntax Descriptors)
4 (Syntax Table Functions): Copyedits.
5 (Syntax Basics): Don't repeat the material in the preceding node.
6 (Syntax Class Table): Use a table.
7 (Syntax Properties): Document syntax-propertize-function and
8 syntax-propertize-extend-region-functions.
9 (Motion via Parsing): Clarify scan-lists. Fix indentation.
10 (Parser State): Update for the new "c" comment style. Fix
11 description of item 7 (comment style).
12
13 * modes.texi (Minor Modes): Update how mode commands should treat
14 arguments now.
15 (Mode Line Basics): Clarify force-mode-line-update.
16 (Mode Line Top): Note that the example is not realistic.
17 (Mode Line Variables, Mode Line Data, %-Constructs, Header Lines)
18 (Emulating Mode Line): Use "mode line" instead of "mode-line", and
19 "mode line construct" instead of "mode line specification".
20 (Syntactic Font Lock): Remove mention of obsolete variable
21 font-lock-syntactic-keywords.
22 (Setting Syntax Properties): Node deleted.
23 (Font Lock Mode): Note that Font Lock mode is a minor mode.
24 (Font Lock Basics): Note that syntactic fontification falls back
25 on `syntax-table'.
26 (Search-based Fontification): Emphasize that font-lock-keywords
27 should not be set directly.
28 (Faces for Font Lock): Avoid some confusing terminology.
29 (Syntactic Font Lock): Minor clarifications. Add xref to
30 Syntactic Font Lock node.
31
322012-02-15 Chong Yidong <cyd@gnu.org>
33
34 * minibuf.texi (Basic Completion): Define "completion table".
35 Move completion-in-region to Completion in Buffers node.
36 (Completion Commands): Use "completion table" terminology.
37 (Completion in Buffers): New node.
38
39 * modes.texi (Hooks): add-hook can be used for abnormal hooks too.
40 (Setting Hooks): Update minor mode usage example.
41 (Major Mode Conventions): Note that completion-at-point-functions
42 should be altered locally. Add xref to Completion in Buffers.
43 Remove duplicate tip about auto-mode-alist.
44 (Minor Modes): Rewrite introduction.
45 (Minor Mode Conventions): Copyedits. Don't recommend
46 variable-only minor modes since few minor modes are like that.
47
482012-02-15 Glenn Morris <rgm@gnu.org>
49
50 * processes.texi (Network): Document open-network-stream :parameters.
51
12012-02-14 Chong Yidong <cyd@gnu.org> 522012-02-14 Chong Yidong <cyd@gnu.org>
2 53
3 * keymaps.texi (Format of Keymaps): The CACHE component of keymaps 54 * keymaps.texi (Format of Keymaps): The CACHE component of keymaps
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 42c3613dd0b..9efbcfb4b86 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -654,6 +654,7 @@ Completion
654 shell commands. 654 shell commands.
655* Completion Styles:: Specifying rules for performing completion. 655* Completion Styles:: Specifying rules for performing completion.
656* Programmed Completion:: Writing your own completion-function. 656* Programmed Completion:: Writing your own completion-function.
657* Completion in Buffers:: Completing text in ordinary buffers.
657 658
658Command Loop 659Command Loop
659 660
@@ -763,6 +764,7 @@ Major and Minor Modes
763* Mode Line Format:: Customizing the text that appears in the mode line. 764* Mode Line Format:: Customizing the text that appears in the mode line.
764* Imenu:: Providing a menu of definitions made in a buffer. 765* Imenu:: Providing a menu of definitions made in a buffer.
765* Font Lock Mode:: How modes can highlight text according to syntax. 766* Font Lock Mode:: How modes can highlight text according to syntax.
767* Auto-Indentation:: How to teach Emacs to indent for a major mode.
766* Desktop Save Mode:: How modes can have buffer state saved between 768* Desktop Save Mode:: How modes can have buffer state saved between
767 Emacs sessions. 769 Emacs sessions.
768 770
@@ -813,8 +815,6 @@ Font Lock Mode
813 contents can also specify how to fontify it. 815 contents can also specify how to fontify it.
814* Faces for Font Lock:: Special faces specifically for Font Lock. 816* Faces for Font Lock:: Special faces specifically for Font Lock.
815* Syntactic Font Lock:: Fontification based on syntax tables. 817* Syntactic Font Lock:: Fontification based on syntax tables.
816* Setting Syntax Properties:: Defining character syntax based on context
817 using the Font Lock mechanism.
818* Multiline Font Lock:: How to coerce Font Lock into properly 818* Multiline Font Lock:: How to coerce Font Lock into properly
819 highlighting multiline constructs. 819 highlighting multiline constructs.
820 820
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index dca88d2b7c7..de9e1c405f0 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -605,7 +605,7 @@ either.
605 605
606 Within a macro definition, you can use the @code{declare} form 606 Within a macro definition, you can use the @code{declare} form
607(@pxref{Defining Macros}) to specify how to @key{TAB} should indent 607(@pxref{Defining Macros}) to specify how to @key{TAB} should indent
608calls to the macro. An indentation specifiction is written like this: 608calls to the macro. An indentation specification is written like this:
609 609
610@example 610@example
611(declare (indent @var{indent-spec})) 611(declare (indent @var{indent-spec}))
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index a71138f5268..1224d80fdf8 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -633,6 +633,7 @@ for reading certain kinds of names with completion.
633 shell commands. 633 shell commands.
634* Completion Styles:: Specifying rules for performing completion. 634* Completion Styles:: Specifying rules for performing completion.
635* Programmed Completion:: Writing your own completion-function. 635* Programmed Completion:: Writing your own completion-function.
636* Completion in Buffers:: Completing text in ordinary buffers.
636@end menu 637@end menu
637 638
638@node Basic Completion 639@node Basic Completion
@@ -644,10 +645,12 @@ higher-level completion features that do use the minibuffer.
644 645
645@defun try-completion string collection &optional predicate 646@defun try-completion string collection &optional predicate
646This function returns the longest common substring of all possible 647This function returns the longest common substring of all possible
647completions of @var{string} in @var{collection}. The value of 648completions of @var{string} in @var{collection}.
648@var{collection} must be a list of strings, an alist whose keys are 649
649strings or symbols, an obarray, a hash table, or a completion function 650@cindex completion table
650(@pxref{Programmed Completion}). 651The @var{collection} argument is called the @dfn{completion table}.
652Its value must be a list of strings, an alist whose keys are strings
653or symbols, an obarray, a hash table, or a completion function.
651 654
652Completion compares @var{string} against each of the permissible 655Completion compares @var{string} against each of the permissible
653completions specified by @var{collection}. If no permissible 656completions specified by @var{collection}. If no permissible
@@ -678,13 +681,13 @@ Also, you cannot intern a given symbol in more than one obarray.
678If @var{collection} is a hash table, then the keys that are strings 681If @var{collection} is a hash table, then the keys that are strings
679are the possible completions. Other keys are ignored. 682are the possible completions. Other keys are ignored.
680 683
681You can also use a function as @var{collection}. 684You can also use a function as @var{collection}. Then the function is
682Then the function is solely responsible for performing completion; 685solely responsible for performing completion; @code{try-completion}
683@code{try-completion} returns whatever this function returns. The 686returns whatever this function returns. The function is called with
684function is called with three arguments: @var{string}, @var{predicate} 687three arguments: @var{string}, @var{predicate} and @code{nil} (the
685and @code{nil} (the reason for the third argument is so that the same 688reason for the third argument is so that the same function can be used
686function can be used in @code{all-completions} and do the appropriate 689in @code{all-completions} and do the appropriate thing in either
687thing in either case). @xref{Programmed Completion}. 690case). @xref{Programmed Completion}.
688 691
689If the argument @var{predicate} is non-@code{nil}, then it must be a 692If the argument @var{predicate} is non-@code{nil}, then it must be a
690function of one argument, unless @var{collection} is a hash table, in 693function of one argument, unless @var{collection} is a hash table, in
@@ -862,30 +865,13 @@ proper value is done the first time you do completion using @var{var}.
862It is done by calling @var{fun} with no arguments. The 865It is done by calling @var{fun} with no arguments. The
863value @var{fun} returns becomes the permanent value of @var{var}. 866value @var{fun} returns becomes the permanent value of @var{var}.
864 867
865Here is an example of use: 868Here is a usage example:
866 869
867@smallexample 870@smallexample
868(defvar foo (lazy-completion-table foo make-my-alist)) 871(defvar foo (lazy-completion-table foo make-my-alist))
869@end smallexample 872@end smallexample
870@end defmac 873@end defmac
871 874
872The function @code{completion-in-region} provides a convenient way to
873perform completion on an arbitrary stretch of text in an Emacs buffer:
874
875@defun completion-in-region start end collection &optional predicate
876This function completes the text in the current buffer between the
877positions @var{start} and @var{end}, using @var{collection}. The
878argument @var{collection} has the same meaning as in
879@code{try-completion} (@pxref{Basic Completion}).
880
881This function inserts the completion text directly into the current
882buffer. Unlike @code{completing-read} (@pxref{Minibuffer
883Completion}), it does not activate the minibuffer.
884
885For this function to work, point must be somewhere between @var{start}
886and @var{end}.
887@end defun
888
889@node Minibuffer Completion 875@node Minibuffer Completion
890@subsection Completion and the Minibuffer 876@subsection Completion and the Minibuffer
891@cindex minibuffer completion 877@cindex minibuffer completion
@@ -899,13 +885,14 @@ This function reads a string in the minibuffer, assisting the user by
899providing completion. It activates the minibuffer with prompt 885providing completion. It activates the minibuffer with prompt
900@var{prompt}, which must be a string. 886@var{prompt}, which must be a string.
901 887
902The actual completion is done by passing @var{collection} and 888The actual completion is done by passing the completion table
903@var{predicate} to the function @code{try-completion} (@pxref{Basic 889@var{collection} and the completion predicate @var{predicate} to the
904Completion}). This happens in certain commands bound in the local 890function @code{try-completion} (@pxref{Basic Completion}). This
905keymaps used for completion. Some of these commands also call 891happens in certain commands bound in the local keymaps used for
906@code{test-completion}. Thus, if @var{predicate} is non-@code{nil}, 892completion. Some of these commands also call @code{test-completion}.
907it should be compatible with @var{collection} and 893Thus, if @var{predicate} is non-@code{nil}, it should be compatible
908@code{completion-ignore-case}. @xref{Definition of test-completion}. 894with @var{collection} and @code{completion-ignore-case}.
895@xref{Definition of test-completion}.
909 896
910The value of the optional argument @var{require-match} determines how 897The value of the optional argument @var{require-match} determines how
911the user may exit the minibuffer: 898the user may exit the minibuffer:
@@ -1005,10 +992,11 @@ They are described in the following section.
1005in the minibuffer to do completion. 992in the minibuffer to do completion.
1006 993
1007@defvar minibuffer-completion-table 994@defvar minibuffer-completion-table
1008The value of this variable is the collection used for completion in 995The value of this variable is the completion table used for completion
1009the minibuffer. This is the global variable that contains what 996in the minibuffer. This is the global variable that contains what
1010@code{completing-read} passes to @code{try-completion}. It is used by 997@code{completing-read} passes to @code{try-completion}. It is used by
1011minibuffer completion commands such as @code{minibuffer-complete-word}. 998minibuffer completion commands such as
999@code{minibuffer-complete-word}.
1012@end defvar 1000@end defvar
1013 1001
1014@defvar minibuffer-completion-predicate 1002@defvar minibuffer-completion-predicate
@@ -1717,6 +1705,87 @@ completion via the variable @code{minibuffer-completion-table}
1717(@pxref{Completion Commands}). 1705(@pxref{Completion Commands}).
1718@end defvar 1706@end defvar
1719 1707
1708@node Completion in Buffers
1709@subsection Completion in Ordinary Buffers
1710@cindex inline completion
1711
1712@findex completion-at-point
1713 Although completion is usually done in the minibuffer, the
1714completion facility can also be used on the text in ordinary Emacs
1715buffers. In many major modes, in-buffer completion is performed by
1716the @kbd{C-M-i} or @kbd{M-@key{TAB}} command, bound to
1717@code{completion-at-point}. @xref{Symbol Completion,,, emacs, The GNU
1718Emacs Manual}. This command uses the abnormal hook variable
1719@code{completion-at-point-functions}:
1720
1721@defvar completion-at-point-functions
1722The value of this abnormal hook should be a list of functions, which
1723are used to compute a completion table for completing the text at
1724point. It can be used by major modes to provide mode-specific
1725completion tables (@pxref{Major Mode Conventions}).
1726
1727When the command @code{completion-at-point} runs, it calls the
1728functions in the list one by one, without any argument. Each function
1729should return @code{nil} if it is unable to produce a completion table
1730for the text at point. Otherwise it should return a list of the form
1731
1732@example
1733(@var{start} @var{end} @var{collection} . @var{props})
1734@end example
1735
1736@noindent
1737@var{start} and @var{end} delimit the text to complete (which should
1738enclose point). @var{collection} is a completion table for completing
1739that text, in a form suitable for passing as the second argument to
1740@code{try-completion} (@pxref{Basic Completion}); completion
1741alternatives will be generated from this completion table in the usual
1742way, via the completion styles defined in @code{completion-styles}
1743(@pxref{Completion Styles}). @var{props} is a property list for
1744additional information; the following optional properties are
1745recognized:
1746
1747@table @code
1748@item :predicate
1749The value should be a predicate that completion candidates need to
1750satisfy.
1751
1752@item :exclusive
1753If the value is @code{no}, then if the completion table fails to match
1754the text at point, then @code{completion-at-point} moves on to the
1755next function in @code{completion-at-point-functions} instead of
1756reporting a completion failure.
1757@end table
1758
1759A function in @code{completion-at-point-functions} may also return a
1760function. In that case, that returned function is called, with no
1761argument, and it is entirely responsible for performing the
1762completion. We discourage this usage; it is intended to help convert
1763old code to using @code{completion-at-point}.
1764
1765The first function in @code{completion-at-point-functions} to return a
1766non-@code{nil} value is used by @code{completion-at-point}. The
1767remaining functions are not called. The exception to this is when
1768there is a @code{:exclusive} specification, as described above.
1769@end defvar
1770
1771 The following function provides a convenient way to perform
1772completion on an arbitrary stretch of text in an Emacs buffer:
1773
1774@defun completion-in-region start end collection &optional predicate
1775This function completes the text in the current buffer between the
1776positions @var{start} and @var{end}, using @var{collection}. The
1777argument @var{collection} has the same meaning as in
1778@code{try-completion} (@pxref{Basic Completion}).
1779
1780This function inserts the completion text directly into the current
1781buffer. Unlike @code{completing-read} (@pxref{Minibuffer
1782Completion}), it does not activate the minibuffer.
1783
1784For this function to work, point must be somewhere between @var{start}
1785and @var{end}.
1786@end defun
1787
1788
1720@node Yes-or-No Queries 1789@node Yes-or-No Queries
1721@section Yes-or-No Queries 1790@section Yes-or-No Queries
1722@cindex asking the user questions 1791@cindex asking the user questions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 0b020bee0b0..3c5fbfb22c9 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -48,17 +48,16 @@ you it is normal. We try to make all hooks normal, as much as
48possible, so that you can use them in a uniform way. 48possible, so that you can use them in a uniform way.
49 49
50 Every major mode command is supposed to run a normal hook called the 50 Every major mode command is supposed to run a normal hook called the
51@dfn{mode hook} as the one of the last steps of initialization. This 51@dfn{mode hook} as one of the last steps of initialization. This makes
52makes it easy for a user to customize the behavior of the mode, by 52it easy for a user to customize the behavior of the mode, by overriding
53overriding the buffer-local variable assignments already made by the 53the buffer-local variable assignments already made by the mode. Most
54mode. Most minor mode functions also run a mode hook at the end. But 54minor mode functions also run a mode hook at the end. But hooks are
55hooks are used in other contexts too. For example, the hook 55used in other contexts too. For example, the hook @code{suspend-hook}
56@code{suspend-hook} runs just before Emacs suspends itself 56runs just before Emacs suspends itself (@pxref{Suspending Emacs}).
57(@pxref{Suspending Emacs}). 57
58 58 The recommended way to add a hook function to a hook is by calling
59 The recommended way to add a hook function to a normal hook is by 59@code{add-hook} (@pxref{Setting Hooks}). The hook functions may be any
60calling @code{add-hook} (see below). The hook functions may be any of 60of the valid kinds of functions that @code{funcall} accepts (@pxref{What
61the valid kinds of functions that @code{funcall} accepts (@pxref{What
62Is a Function}). Most normal hook variables are initially void; 61Is a Function}). Most normal hook variables are initially void;
63@code{add-hook} knows how to deal with this. You can add hooks either 62@code{add-hook} knows how to deal with this. You can add hooks either
64globally or buffer-locally with @code{add-hook}. 63globally or buffer-locally with @code{add-hook}.
@@ -178,7 +177,7 @@ calls @code{wrap-function} with arguments @code{fun} and @code{args}.
178in Lisp Interaction mode: 177in Lisp Interaction mode:
179 178
180@example 179@example
181(add-hook 'lisp-interaction-mode-hook 'turn-on-auto-fill) 180(add-hook 'lisp-interaction-mode-hook 'auto-fill-mode)
182@end example 181@end example
183 182
184@defun add-hook hook function &optional append local 183@defun add-hook hook function &optional append local
@@ -202,13 +201,13 @@ If @var{function} has a non-@code{nil} property
202changing major modes) won't delete it from the hook variable's local 201changing major modes) won't delete it from the hook variable's local
203value. 202value.
204 203
205It is best to design your hook functions so that the order in which 204For a normal hook, hook functions should be designed so that the order
206they are executed does not matter. Any dependence on the order is 205in which they are executed does not matter. Any dependence on the order
207asking for trouble. However, the order is predictable: normally, 206is asking for trouble. However, the order is predictable: normally,
208@var{function} goes at the front of the hook list, so it will be 207@var{function} goes at the front of the hook list, so it is executed
209executed first (barring another @code{add-hook} call). If the 208first (barring another @code{add-hook} call). If the optional argument
210optional argument @var{append} is non-@code{nil}, the new hook 209@var{append} is non-@code{nil}, the new hook function goes at the end of
211function goes at the end of the hook list and will be executed last. 210the hook list and is executed last.
212 211
213@code{add-hook} can handle the cases where @var{hook} is void or its 212@code{add-hook} can handle the cases where @var{hook} is void or its
214value is a single function; it sets or changes the value to a list of 213value is a single function; it sets or changes the value to a list of
@@ -302,8 +301,8 @@ initialization, function and variable names, and hooks.
302 301
303 If you use the @code{define-derived-mode} macro, it will take care of 302 If you use the @code{define-derived-mode} macro, it will take care of
304many of these conventions automatically. @xref{Derived Modes}. Note 303many of these conventions automatically. @xref{Derived Modes}. Note
305also that fundamental mode is an exception to many of these conventions, 304also that Fundamental mode is an exception to many of these conventions,
306because its definition is to present the global state of Emacs. 305because it represents the default state of Emacs.
307 306
308 The following list of conventions is only partial. Each major mode 307 The following list of conventions is only partial. Each major mode
309should aim for consistency in general with other Emacs major modes, as 308should aim for consistency in general with other Emacs major modes, as
@@ -460,13 +459,9 @@ The mode can specify a local value for
460this mode. 459this mode.
461 460
462@item 461@item
463The mode can specify how to complete various keywords by adding 462The mode can specify how to complete various keywords by adding one or
464to the special hook @code{completion-at-point-functions}. 463more buffer-local entries to the special hook
465 464@code{completion-at-point-functions}. @xref{Completion in Buffers}.
466@item
467Use @code{defvar} or @code{defcustom} to set mode-related variables, so
468that they are not reinitialized if they already have a value. (Such
469reinitialization could discard customizations made by the user.)
470 465
471@item 466@item
472@cindex buffer-local variables in modes 467@cindex buffer-local variables in modes
@@ -546,25 +541,22 @@ not autoload the mode command, it is sufficient to add the element in
546the file that contains the mode definition. 541the file that contains the mode definition.
547 542
548@item 543@item
549In the comments that document the file, you should provide a sample
550@code{autoload} form and an example of how to add to
551@code{auto-mode-alist}, that users can include in their init files
552(@pxref{Init File}).
553
554@item
555@cindex mode loading 544@cindex mode loading
556The top-level forms in the file defining the mode should be written so 545The top-level forms in the file defining the mode should be written so
557that they may be evaluated more than once without adverse consequences. 546that they may be evaluated more than once without adverse consequences.
558Even if you never load the file more than once, someone else will. 547For instance, use @code{defvar} or @code{defcustom} to set mode-related
548variables, so that they are not reinitialized if they already have a
549value (@pxref{Defining Variables}).
550
559@end itemize 551@end itemize
560 552
561@node Auto Major Mode 553@node Auto Major Mode
562@subsection How Emacs Chooses a Major Mode 554@subsection How Emacs Chooses a Major Mode
563@cindex major mode, automatic selection 555@cindex major mode, automatic selection
564 556
565 Based on information in the file name or in the file itself, Emacs 557 When Emacs visits a file, it automatically selects a major mode for
566automatically selects a major mode for the new buffer when a file is 558the buffer based on information in the file name or in the file itself.
567visited. It also processes local variables specified in the file text. 559It also processes local variables specified in the file text.
568 560
569@deffn Command normal-mode &optional find-file 561@deffn Command normal-mode &optional find-file
570This function establishes the proper major mode and buffer-local variable 562This function establishes the proper major mode and buffer-local variable
@@ -1202,27 +1194,20 @@ if that value is non-nil."
1202@section Minor Modes 1194@section Minor Modes
1203@cindex minor mode 1195@cindex minor mode
1204 1196
1205 A @dfn{minor mode} provides features that users may enable or disable 1197 A @dfn{minor mode} provides optional features that users may enable or
1206independently of the choice of major mode. Minor modes can be enabled 1198disable independently of the choice of major mode. Minor modes can be
1207individually or in combination. Minor modes would be better named 1199enabled individually or in combination.
1208``generally available, optional feature modes,'' except that such a name
1209would be unwieldy.
1210
1211 A minor mode is not usually meant as a variation of a single major mode.
1212Usually they are general and can apply to many major modes. For
1213example, Auto Fill mode works with any major mode that permits text
1214insertion. To be general, a minor mode must be effectively independent
1215of the things major modes do.
1216 1200
1217 A minor mode is often much more difficult to implement than a major 1201 Most minor modes implement features that are independent of the major
1218mode. One reason is that you should be able to activate and deactivate 1202mode, and can thus be used with most major modes. For example, Auto
1219minor modes in any order. A minor mode should be able to have its 1203Fill mode works with any major mode that permits text insertion. A few
1220desired effect regardless of the major mode and regardless of the other 1204minor modes, however, are specific to a particular major mode. For
1221minor modes in effect. 1205example, Diff Auto Refine mode is a minor mode that is intended to be
1206used only with Diff mode.
1222 1207
1223 Often the biggest problem in implementing a minor mode is finding a 1208 Ideally, a minor mode should have its desired effect regardless of the
1224way to insert the necessary hook into the rest of Emacs. Minor mode 1209other minor modes in effect. It should be possible to activate and
1225keymaps make this easier than it used to be. 1210deactivate minor modes in any order.
1226 1211
1227@defvar minor-mode-list 1212@defvar minor-mode-list
1228The value of this variable is a list of all minor mode commands. 1213The value of this variable is a list of all minor mode commands.
@@ -1240,60 +1225,76 @@ The value of this variable is a list of all minor mode commands.
1240@cindex conventions for writing minor modes 1225@cindex conventions for writing minor modes
1241 1226
1242 There are conventions for writing minor modes just as there are for 1227 There are conventions for writing minor modes just as there are for
1243major modes. Several of the major mode conventions apply to minor 1228major modes. These conventions are described below. The easiest way to
1244modes as well: those regarding the name of the mode initialization 1229follow them is to use the macro @code{define-minor-mode}.
1245function, the names of global symbols, the use of a hook at the end of 1230@xref{Defining Minor Modes}.
1246the initialization function, and the use of keymaps and other tables.
1247
1248 In addition, there are several conventions that are specific to
1249minor modes. (The easiest way to follow all the conventions is to use
1250the macro @code{define-minor-mode}; @ref{Defining Minor Modes}.)
1251 1231
1252@itemize @bullet 1232@itemize @bullet
1253@item 1233@item
1254@cindex mode variable 1234@cindex mode variable
1255Make a variable whose name ends in @samp{-mode} to control the minor 1235Define a variable whose name ends in @samp{-mode}. We call this the
1256mode. We call this the @dfn{mode variable}. The minor mode command 1236@dfn{mode variable}. The minor mode command should set this variable.
1257should set this variable (@code{nil} to disable; anything else to 1237The value will be @code{nil} is the mode is disabled, and non-@code{nil}
1258enable). 1238if the mode is enabled. The variable should be buffer-local if the
1259 1239minor mode is buffer-local.
1260If possible, implement the mode so that setting the variable
1261automatically enables or disables the mode. Then the minor mode command
1262does not need to do anything except set the variable.
1263 1240
1264This variable is used in conjunction with the @code{minor-mode-alist} to 1241This variable is used in conjunction with the @code{minor-mode-alist} to
1265display the minor mode name in the mode line. It can also enable 1242display the minor mode name in the mode line. It also determines
1266or disable a minor mode keymap. Individual commands or hooks can also 1243whether the minor mode keymap is active, via @code{minor-mode-map-alist}
1267check the variable's value. 1244(@pxref{Controlling Active Maps}). Individual commands or hooks can
1268 1245also check its value.
1269If you want the minor mode to be enabled separately in each buffer,
1270make the variable buffer-local.
1271 1246
1272@item 1247@item
1273Define a command whose name is the same as the mode variable. 1248Define a command, called the @dfn{mode command}, whose name is the same
1274Its job is to enable and disable the mode by setting the variable. 1249as the mode variable. Its job is to set the value of the mode variable,
1250plus anything else that needs to be done to actually enable or disable
1251the mode's features.
1275 1252
1276The command should accept one optional argument. If the argument is 1253The mode command should accept one optional argument. If called
1277@code{nil}, it should toggle the mode (turn it on if it is off, and 1254interactively with no prefix argument, it should toggle the mode
1278off if it is on). It should turn the mode on if the argument is a 1255(i.e.@: enable if it is disabled, and disable if it is enabled). If
1279positive integer, the symbol @code{t}, or a list whose @sc{car} is one 1256called interactively with a prefix argument, it should enable the mode
1280of those. It should turn the mode off if the argument is a negative 1257if the argument is positive and disable it otherwise.
1281integer or zero, the symbol @code{-}, or a list whose @sc{car} is a
1282negative integer or zero. The meaning of other arguments is not
1283specified.
1284 1258
1285Here is an example taken from the definition of @code{transient-mark-mode}. 1259If the mode command is called from Lisp (i.e.@: non-interactively), it
1286It shows the use of @code{transient-mark-mode} as a variable that enables or 1260should enable the mode if the argument is omitted or @code{nil}; it
1287disables the mode's behavior, and also shows the proper way to toggle, 1261should toggle the mode if the argument is the symbol @code{toggle};
1288enable or disable the minor mode based on the raw prefix argument value. 1262otherwise it should treat the argument in the same way as for an
1263interactive call with a numeric prefix argument, as described above.
1289 1264
1290@smallexample 1265The following example shows how to implement this behavior (it is
1291@group 1266similar to the code generated by the @code{define-minor-mode} macro):
1292(setq transient-mark-mode 1267
1293 (if (null arg) (not transient-mark-mode) 1268@example
1294 (> (prefix-numeric-value arg) 0))) 1269(interactive (list (or current-prefix-arg 'toggle)))
1295@end group 1270(let ((enable (if (eq arg 'toggle)
1296@end smallexample 1271 (not foo-mode) ; @r{this mode's mode variable}
1272 (> (prefix-numeric-value arg) 0))))
1273 (if enable
1274 @var{do-enable}
1275 @var{do-disable}))
1276@end example
1277
1278The reason for this somewhat complex behavior is that it lets users
1279easily toggle the minor mode interactively, and also lets the minor mode
1280be easily enabled in a mode hook, like this:
1281
1282@example
1283(add-hook 'text-mode-hook 'foo-mode)
1284@end example
1285
1286@noindent
1287This behaves correctly whether or not @code{foo-mode} was already
1288enabled, since the @code{foo-mode} mode command unconditionally enables
1289the minor mode when it is called from Lisp with no argument. Disabling
1290a minor mode in a mode hook is a little uglier:
1291
1292@example
1293(add-hook 'text-mode-hook (lambda () (foo-mode -1)))
1294@end example
1295
1296@noindent
1297However, this is not very commonly done.
1297 1298
1298@item 1299@item
1299Add an element to @code{minor-mode-alist} for each minor mode 1300Add an element to @code{minor-mode-alist} for each minor mode
@@ -1316,8 +1317,7 @@ check for an existing element, to avoid duplication. For example:
1316@smallexample 1317@smallexample
1317@group 1318@group
1318(unless (assq 'leif-mode minor-mode-alist) 1319(unless (assq 'leif-mode minor-mode-alist)
1319 (setq minor-mode-alist 1320 (push '(leif-mode " Leif") minor-mode-alist))
1320 (cons '(leif-mode " Leif") minor-mode-alist)))
1321@end group 1321@end group
1322@end smallexample 1322@end smallexample
1323 1323
@@ -1331,25 +1331,24 @@ or like this, using @code{add-to-list} (@pxref{List Variables}):
1331@end smallexample 1331@end smallexample
1332@end itemize 1332@end itemize
1333 1333
1334 Global minor modes distributed with Emacs should if possible support 1334 In addition, several major mode conventions apply to minor modes as
1335enabling and disabling via Custom (@pxref{Customization}). To do this, 1335well: those regarding the names of global symbols, the use of a hook at
1336the first step is to define the mode variable with @code{defcustom}, and 1336the end of the initialization function, and the use of keymaps and other
1337specify @code{:type 'boolean}. 1337tables.
1338 1338
1339 If just setting the variable is not sufficient to enable the mode, you 1339 The minor mode should, if possible, support enabling and disabling via
1340Custom (@pxref{Customization}). To do this, the mode variable should be
1341defined with @code{defcustom}, usually with @code{:type 'boolean}. If
1342just setting the variable is not sufficient to enable the mode, you
1340should also specify a @code{:set} method which enables the mode by 1343should also specify a @code{:set} method which enables the mode by
1341invoking the mode command. Note in the variable's documentation string that 1344invoking the mode command. Note in the variable's documentation string
1342setting the variable other than via Custom may not take effect. 1345that setting the variable other than via Custom may not take effect.
1343 1346Also, mark the definition with an autoload cookie (@pxref{autoload
1344 Also mark the definition with an autoload cookie (@pxref{autoload cookie}), 1347cookie}), and specify a @code{:require} so that customizing the variable
1345and specify a @code{:require} so that customizing the variable will load 1348will load the library that defines the mode. For example:
1346the library that defines the mode. This will copy suitable definitions
1347into @file{loaddefs.el} so that users can use @code{customize-option} to
1348enable the mode. For example:
1349 1349
1350@smallexample 1350@smallexample
1351@group 1351@group
1352
1353;;;###autoload 1352;;;###autoload
1354(defcustom msb-mode nil 1353(defcustom msb-mode nil
1355 "Toggle msb-mode. 1354 "Toggle msb-mode.
@@ -1579,7 +1578,7 @@ mode's hook.
1579 1578
1580 1579
1581@node Mode Line Format 1580@node Mode Line Format
1582@section Mode-Line Format 1581@section Mode Line Format
1583@cindex mode line 1582@cindex mode line
1584 1583
1585 Each Emacs window (aside from minibuffer windows) typically has a mode 1584 Each Emacs window (aside from minibuffer windows) typically has a mode
@@ -1609,61 +1608,59 @@ minor modes.
1609@node Mode Line Basics 1608@node Mode Line Basics
1610@subsection Mode Line Basics 1609@subsection Mode Line Basics
1611 1610
1612 @code{mode-line-format} is a buffer-local variable that holds a 1611 The contents of each mode line are specified by the buffer-local
1613@dfn{mode line construct}, a kind of template, which controls what is 1612variable @code{mode-line-format} (@pxref{Mode Line Top}). This variable
1614displayed on the mode line of the current buffer. The value of 1613holds a @dfn{mode line construct}: a template that controls what is
1615@code{header-line-format} specifies the buffer's header line in the 1614displayed on the buffer's mode line. The value of
1616same way. All windows for the same buffer use the same 1615@code{header-line-format} specifies the buffer's header line in the same
1616way. All windows for the same buffer use the same
1617@code{mode-line-format} and @code{header-line-format}. 1617@code{mode-line-format} and @code{header-line-format}.
1618 1618
1619 For efficiency, Emacs does not continuously recompute the mode 1619 For efficiency, Emacs does not continuously recompute each window's
1620line and header line of a window. It does so when circumstances 1620mode line and header line. It does so when circumstances appear to call
1621appear to call for it---for instance, if you change the window 1621for it---for instance, if you change the window configuration, switch
1622configuration, switch buffers, narrow or widen the buffer, scroll, or 1622buffers, narrow or widen the buffer, scroll, or modify the buffer. If
1623change the buffer's modification status. If you modify any of the 1623you alter any of the variables referenced by @code{mode-line-format} or
1624variables referenced by @code{mode-line-format} (@pxref{Mode Line 1624@code{header-line-format} (@pxref{Mode Line Variables}), or any other
1625Variables}), or any other variables and data structures that affect 1625data structures that affect how text is displayed (@pxref{Display}), you
1626how text is displayed (@pxref{Display}), you may want to force an 1626should use the function @code{force-mode-line-update} to update the
1627update of the mode line so as to display the new information or 1627display.
1628display it in the new way.
1629 1628
1630@defun force-mode-line-update &optional all 1629@defun force-mode-line-update &optional all
1631Force redisplay of the current buffer's mode line and header line. 1630This function forces Emacs to update the current buffer's mode line and
1632The next redisplay will update the mode line and header line based on 1631header line, based on the latest values of all relevant variables,
1633the latest values of all relevant variables. With optional 1632during its next redisplay cycle. If the optional argument @var{all} is
1634non-@code{nil} @var{all}, force redisplay of all mode lines and header 1633non-@code{nil}, it forces an update for all mode lines and header lines.
1635lines. 1634
1636 1635This function also forces an update of the menu bar and frame title.
1637This function also forces recomputation of the menu bar menus
1638and the frame title.
1639@end defun 1636@end defun
1640 1637
1641 The selected window's mode line is usually displayed in a different 1638 The selected window's mode line is usually displayed in a different
1642color using the face @code{mode-line}. Other windows' mode lines 1639color using the face @code{mode-line}. Other windows' mode lines appear
1643appear in the face @code{mode-line-inactive} instead. @xref{Faces}. 1640in the face @code{mode-line-inactive} instead. @xref{Faces}.
1644 1641
1645@node Mode Line Data 1642@node Mode Line Data
1646@subsection The Data Structure of the Mode Line 1643@subsection The Data Structure of the Mode Line
1647@cindex mode-line construct 1644@cindex mode line construct
1648 1645
1649 The mode-line contents are controlled by a data structure called a 1646 The mode line contents are controlled by a data structure called a
1650@dfn{mode-line construct}, made up of lists, strings, symbols, and 1647@dfn{mode line construct}, made up of lists, strings, symbols, and
1651numbers kept in buffer-local variables. Each data type has a specific 1648numbers kept in buffer-local variables. Each data type has a specific
1652meaning for the mode-line appearance, as described below. The same 1649meaning for the mode line appearance, as described below. The same data
1653data structure is used for constructing frame titles (@pxref{Frame 1650structure is used for constructing frame titles (@pxref{Frame Titles})
1654Titles}) and header lines (@pxref{Header Lines}). 1651and header lines (@pxref{Header Lines}).
1655 1652
1656 A mode-line construct may be as simple as a fixed string of text, 1653 A mode line construct may be as simple as a fixed string of text,
1657but it usually specifies how to combine fixed strings with variables' 1654but it usually specifies how to combine fixed strings with variables'
1658values to construct the text. Many of these variables are themselves 1655values to construct the text. Many of these variables are themselves
1659defined to have mode-line constructs as their values. 1656defined to have mode line constructs as their values.
1660 1657
1661 Here are the meanings of various data types as mode-line constructs: 1658 Here are the meanings of various data types as mode line constructs:
1662 1659
1663@table @code 1660@table @code
1664@cindex percent symbol in mode line 1661@cindex percent symbol in mode line
1665@item @var{string} 1662@item @var{string}
1666A string as a mode-line construct appears verbatim except for 1663A string as a mode line construct appears verbatim except for
1667@dfn{@code{%}-constructs} in it. These stand for substitution of 1664@dfn{@code{%}-constructs} in it. These stand for substitution of
1668other data; see @ref{%-Constructs}. 1665other data; see @ref{%-Constructs}.
1669 1666
@@ -1676,8 +1673,8 @@ default, in the face @code{mode-line} or @code{mode-line-inactive}
1676special meanings. @xref{Properties in Mode}. 1673special meanings. @xref{Properties in Mode}.
1677 1674
1678@item @var{symbol} 1675@item @var{symbol}
1679A symbol as a mode-line construct stands for its value. The value of 1676A symbol as a mode line construct stands for its value. The value of
1680@var{symbol} is used as a mode-line construct, in place of @var{symbol}. 1677@var{symbol} is used as a mode line construct, in place of @var{symbol}.
1681However, the symbols @code{t} and @code{nil} are ignored, as is any 1678However, the symbols @code{t} and @code{nil} are ignored, as is any
1682symbol whose value is void. 1679symbol whose value is void.
1683 1680
@@ -1686,17 +1683,17 @@ displayed verbatim: the @code{%}-constructs are not recognized.
1686 1683
1687Unless @var{symbol} is marked as ``risky'' (i.e., it has a 1684Unless @var{symbol} is marked as ``risky'' (i.e., it has a
1688non-@code{nil} @code{risky-local-variable} property), all text 1685non-@code{nil} @code{risky-local-variable} property), all text
1689properties specified in @var{symbol}'s value are ignored. This 1686properties specified in @var{symbol}'s value are ignored. This includes
1690includes the text properties of strings in @var{symbol}'s value, as 1687the text properties of strings in @var{symbol}'s value, as well as all
1691well as all @code{:eval} and @code{:propertize} forms in it. (The 1688@code{:eval} and @code{:propertize} forms in it. (The reason for this
1692reason for this is security: non-risky variables could be set 1689is security: non-risky variables could be set automatically from file
1693automatically from file variables without prompting the user.) 1690variables without prompting the user.)
1694 1691
1695@item (@var{string} @var{rest}@dots{}) 1692@item (@var{string} @var{rest}@dots{})
1696@itemx (@var{list} @var{rest}@dots{}) 1693@itemx (@var{list} @var{rest}@dots{})
1697A list whose first element is a string or list means to process all the 1694A list whose first element is a string or list means to process all the
1698elements recursively and concatenate the results. This is the most 1695elements recursively and concatenate the results. This is the most
1699common form of mode-line construct. 1696common form of mode line construct.
1700 1697
1701@item (:eval @var{form}) 1698@item (:eval @var{form})
1702A list whose first element is the symbol @code{:eval} says to evaluate 1699A list whose first element is the symbol @code{:eval} says to evaluate
@@ -1706,24 +1703,24 @@ recursion.
1706 1703
1707@item (:propertize @var{elt} @var{props}@dots{}) 1704@item (:propertize @var{elt} @var{props}@dots{})
1708A list whose first element is the symbol @code{:propertize} says to 1705A list whose first element is the symbol @code{:propertize} says to
1709process the mode-line construct @var{elt} recursively, then add the text 1706process the mode line construct @var{elt} recursively, then add the text
1710properties specified by @var{props} to the result. The argument 1707properties specified by @var{props} to the result. The argument
1711@var{props} should consist of zero or more pairs @var{text-property} 1708@var{props} should consist of zero or more pairs @var{text-property}
1712@var{value}. (This feature is new as of Emacs 22.1.) 1709@var{value}.
1713 1710
1714@item (@var{symbol} @var{then} @var{else}) 1711@item (@var{symbol} @var{then} @var{else})
1715A list whose first element is a symbol that is not a keyword specifies 1712A list whose first element is a symbol that is not a keyword specifies
1716a conditional. Its meaning depends on the value of @var{symbol}. If 1713a conditional. Its meaning depends on the value of @var{symbol}. If
1717@var{symbol} has a non-@code{nil} value, the second element, 1714@var{symbol} has a non-@code{nil} value, the second element,
1718@var{then}, is processed recursively as a mode-line element. 1715@var{then}, is processed recursively as a mode line element.
1719Otherwise, the third element, @var{else}, is processed recursively. 1716Otherwise, the third element, @var{else}, is processed recursively.
1720You may omit @var{else}; then the mode-line element displays nothing 1717You may omit @var{else}; then the mode line element displays nothing
1721if the value of @var{symbol} is @code{nil} or void. 1718if the value of @var{symbol} is @code{nil} or void.
1722 1719
1723@item (@var{width} @var{rest}@dots{}) 1720@item (@var{width} @var{rest}@dots{})
1724A list whose first element is an integer specifies truncation or 1721A list whose first element is an integer specifies truncation or
1725padding of the results of @var{rest}. The remaining elements 1722padding of the results of @var{rest}. The remaining elements
1726@var{rest} are processed recursively as mode-line constructs and 1723@var{rest} are processed recursively as mode line constructs and
1727concatenated together. When @var{width} is positive, the result is 1724concatenated together. When @var{width} is positive, the result is
1728space filled on the right if its width is less than @var{width}. When 1725space filled on the right if its width is less than @var{width}. When
1729@var{width} is negative, the result is truncated on the right to 1726@var{width} is negative, the result is truncated on the right to
@@ -1740,12 +1737,12 @@ the top of the window is to use a list like this: @code{(-3 "%p")}.
1740@code{mode-line-format}. 1737@code{mode-line-format}.
1741 1738
1742@defopt mode-line-format 1739@defopt mode-line-format
1743The value of this variable is a mode-line construct that controls the 1740The value of this variable is a mode line construct that controls the
1744contents of the mode-line. It is always buffer-local in all buffers. 1741contents of the mode-line. It is always buffer-local in all buffers.
1745 1742
1746If you set this variable to @code{nil} in a buffer, that buffer does 1743If you set this variable to @code{nil} in a buffer, that buffer does not
1747not have a mode line. (A window that is just one line tall never 1744have a mode line. (A window that is just one line tall also does not
1748displays a mode line.) 1745display a mode line.)
1749@end defopt 1746@end defopt
1750 1747
1751 The default value of @code{mode-line-format} is designed to use the 1748 The default value of @code{mode-line-format} is designed to use the
@@ -1763,9 +1760,9 @@ the information in another fashion. This way, customizations made by
1763the user or by Lisp programs (such as @code{display-time} and major 1760the user or by Lisp programs (such as @code{display-time} and major
1764modes) via changes to those variables remain effective. 1761modes) via changes to those variables remain effective.
1765 1762
1766 Here is an example of a @code{mode-line-format} that might be 1763 Here is a hypothetical example of a @code{mode-line-format} that might
1767useful for @code{shell-mode}, since it contains the host name and default 1764be useful for Shell mode (in reality, Shell mode does not set
1768directory. 1765@code{mode-line-format}):
1769 1766
1770@example 1767@example
1771@group 1768@group
@@ -1778,7 +1775,7 @@ directory.
1778@end group 1775@end group
1779@group 1776@group
1780 ;; @r{Note that this is evaluated while making the list.} 1777 ;; @r{Note that this is evaluated while making the list.}
1781 ;; @r{It makes a mode-line construct which is just a string.} 1778 ;; @r{It makes a mode line construct which is just a string.}
1782 (getenv "HOST") 1779 (getenv "HOST")
1783@end group 1780@end group
1784 ":" 1781 ":"
@@ -1795,8 +1792,7 @@ directory.
1795 '(which-func-mode ("" which-func-format "--")) 1792 '(which-func-mode ("" which-func-format "--"))
1796 '(line-number-mode "L%l--") 1793 '(line-number-mode "L%l--")
1797 '(column-number-mode "C%c--") 1794 '(column-number-mode "C%c--")
1798 '(-3 "%p") 1795 '(-3 "%p")))
1799 "-%-"))
1800@end group 1796@end group
1801@end example 1797@end example
1802 1798
@@ -1808,23 +1804,23 @@ these variable names are also the minor mode command names.)
1808@node Mode Line Variables 1804@node Mode Line Variables
1809@subsection Variables Used in the Mode Line 1805@subsection Variables Used in the Mode Line
1810 1806
1811 This section describes variables incorporated by the standard value 1807 This section describes variables incorporated by the standard value of
1812of @code{mode-line-format} into the text of the mode line. There is 1808@code{mode-line-format} into the text of the mode line. There is
1813nothing inherently special about these variables; any other variables 1809nothing inherently special about these variables; any other variables
1814could have the same effects on the mode line if 1810could have the same effects on the mode line if the value of
1815@code{mode-line-format}'s value were changed to use them. However, 1811@code{mode-line-format} is changed to use them. However, various parts
1816various parts of Emacs set these variables on the understanding that 1812of Emacs set these variables on the understanding that they will control
1817they will control parts of the mode line; therefore, practically 1813parts of the mode line; therefore, practically speaking, it is essential
1818speaking, it is essential for the mode line to use them. 1814for the mode line to use them.
1819 1815
1820@defvar mode-line-mule-info 1816@defvar mode-line-mule-info
1821This variable holds the value of the mode-line construct that displays 1817This variable holds the value of the mode line construct that displays
1822information about the language environment, buffer coding system, and 1818information about the language environment, buffer coding system, and
1823current input method. @xref{Non-ASCII Characters}. 1819current input method. @xref{Non-ASCII Characters}.
1824@end defvar 1820@end defvar
1825 1821
1826@defvar mode-line-modified 1822@defvar mode-line-modified
1827This variable holds the value of the mode-line construct that displays 1823This variable holds the value of the mode line construct that displays
1828whether the current buffer is modified. Its default value displays 1824whether the current buffer is modified. Its default value displays
1829@samp{**} if the buffer is modified, @samp{--} if the buffer is not 1825@samp{**} if the buffer is modified, @samp{--} if the buffer is not
1830modified, @samp{%%} if the buffer is read only, and @samp{%*} if the 1826modified, @samp{%%} if the buffer is read only, and @samp{%*} if the
@@ -1887,7 +1883,7 @@ identify the mode name in the mode line, use @code{format-mode-line}
1887@end defvar 1883@end defvar
1888 1884
1889@defvar mode-line-process 1885@defvar mode-line-process
1890This buffer-local variable contains the mode-line information on process 1886This buffer-local variable contains the mode line information on process
1891status in modes used for communicating with subprocesses. It is 1887status in modes used for communicating with subprocesses. It is
1892displayed immediately following the major mode name, with no intervening 1888displayed immediately following the major mode name, with no intervening
1893space. For example, its value in the @samp{*shell*} buffer is 1889space. For example, its value in the @samp{*shell*} buffer is
@@ -1906,12 +1902,12 @@ the @code{minor-mode-alist} should be a two-element list:
1906(@var{minor-mode-variable} @var{mode-line-string}) 1902(@var{minor-mode-variable} @var{mode-line-string})
1907@end example 1903@end example
1908 1904
1909More generally, @var{mode-line-string} can be any mode-line spec. It 1905More generally, @var{mode-line-string} can be any mode line construct.
1910appears in the mode line when the value of @var{minor-mode-variable} 1906It appears in the mode line when the value of @var{minor-mode-variable}
1911is non-@code{nil}, and not otherwise. These strings should begin with 1907is non-@code{nil}, and not otherwise. These strings should begin with
1912spaces so that they don't run together. Conventionally, the 1908spaces so that they don't run together. Conventionally, the
1913@var{minor-mode-variable} for a specific mode is set to a 1909@var{minor-mode-variable} for a specific mode is set to a non-@code{nil}
1914non-@code{nil} value when that minor mode is activated. 1910value when that minor mode is activated.
1915 1911
1916@code{minor-mode-alist} itself is not buffer-local. Each variable 1912@code{minor-mode-alist} itself is not buffer-local. Each variable
1917mentioned in the alist should be buffer-local if its minor mode can be 1913mentioned in the alist should be buffer-local if its minor mode can be
@@ -1919,12 +1915,12 @@ enabled separately in each buffer.
1919@end defvar 1915@end defvar
1920 1916
1921@defvar global-mode-string 1917@defvar global-mode-string
1922This variable holds a mode-line spec that, by default, appears in the 1918This variable holds a mode line construct that, by default, appears in
1923mode line just after the @code{which-func-mode} minor mode if set, 1919the mode line just after the @code{which-func-mode} minor mode if set,
1924else after @code{mode-line-modes}. The command @code{display-time} 1920else after @code{mode-line-modes}. The command @code{display-time} sets
1925sets @code{global-mode-string} to refer to the variable 1921@code{global-mode-string} to refer to the variable
1926@code{display-time-string}, which holds a string containing the time 1922@code{display-time-string}, which holds a string containing the time and
1927and load information. 1923load information.
1928 1924
1929The @samp{%M} construct substitutes the value of 1925The @samp{%M} construct substitutes the value of
1930@code{global-mode-string}, but that is obsolete, since the variable is 1926@code{global-mode-string}, but that is obsolete, since the variable is
@@ -1958,7 +1954,7 @@ specifies addition of text properties.
1958@node %-Constructs 1954@node %-Constructs
1959@subsection @code{%}-Constructs in the Mode Line 1955@subsection @code{%}-Constructs in the Mode Line
1960 1956
1961 Strings used as mode-line constructs can use certain 1957 Strings used as mode line constructs can use certain
1962@code{%}-constructs to substitute various kinds of data. Here is a 1958@code{%}-constructs to substitute various kinds of data. Here is a
1963list of the defined @code{%}-constructs, and what they mean. In any 1959list of the defined @code{%}-constructs, and what they mean. In any
1964construct except @samp{%%}, you can add a decimal integer after the 1960construct except @samp{%%}, you can add a decimal integer after the
@@ -2004,8 +2000,8 @@ of the buffer.
2004 2000
2005@item %p 2001@item %p
2006The percentage of the buffer text above the @strong{top} of window, or 2002The percentage of the buffer text above the @strong{top} of window, or
2007@samp{Top}, @samp{Bottom} or @samp{All}. Note that the default 2003@samp{Top}, @samp{Bottom} or @samp{All}. Note that the default mode
2008mode-line specification truncates this to three characters. 2004line construct truncates this to three characters.
2009 2005
2010@item %P 2006@item %P
2011The percentage of the buffer text that is above the @strong{bottom} of 2007The percentage of the buffer text that is above the @strong{bottom} of
@@ -2085,11 +2081,11 @@ line:
2085 2081
2086@enumerate 2082@enumerate
2087@item 2083@item
2088Put a string with a text property directly into the mode-line data 2084Put a string with a text property directly into the mode line data
2089structure. 2085structure.
2090 2086
2091@item 2087@item
2092Put a text property on a mode-line %-construct such as @samp{%12b}; then 2088Put a text property on a mode line %-construct such as @samp{%12b}; then
2093the expansion of the %-construct will have that same text property. 2089the expansion of the %-construct will have that same text property.
2094 2090
2095@item 2091@item
@@ -2097,7 +2093,7 @@ Use a @code{(:propertize @var{elt} @var{props}@dots{})} construct to
2097give @var{elt} a text property specified by @var{props}. 2093give @var{elt} a text property specified by @var{props}.
2098 2094
2099@item 2095@item
2100Use a list containing @code{:eval @var{form}} in the mode-line data 2096Use a list containing @code{:eval @var{form}} in the mode line data
2101structure, and make @var{form} evaluate to a string that has a text 2097structure, and make @var{form} evaluate to a string that has a text
2102property. 2098property.
2103@end enumerate 2099@end enumerate
@@ -2119,10 +2115,10 @@ local variables.
2119@cindex header line (of a window) 2115@cindex header line (of a window)
2120@cindex window header line 2116@cindex window header line
2121 2117
2122 A window can have a @dfn{header line} at the 2118 A window can have a @dfn{header line} at the top, just as it can have
2123top, just as it can have a mode line at the bottom. The header line 2119a mode line at the bottom. The header line feature works just like the
2124feature works just like the mode-line feature, except that it's 2120mode line feature, except that it's controlled by
2125controlled by different variables. 2121@code{header-line-format}:
2126 2122
2127@defvar header-line-format 2123@defvar header-line-format
2128This variable, local in every buffer, specifies how to display the 2124This variable, local in every buffer, specifies how to display the
@@ -2137,11 +2133,11 @@ header line at once; if it has a mode line, then it does not display a
2137header line. 2133header line.
2138 2134
2139@node Emulating Mode Line 2135@node Emulating Mode Line
2140@subsection Emulating Mode-Line Formatting 2136@subsection Emulating Mode Line Formatting
2141 2137
2142 You can use the function @code{format-mode-line} to compute 2138 You can use the function @code{format-mode-line} to compute the text
2143the text that would appear in a mode line or header line 2139that would appear in a mode line or header line based on a certain
2144based on a certain mode-line specification. 2140mode line construct.
2145 2141
2146@defun format-mode-line format &optional face window buffer 2142@defun format-mode-line format &optional face window buffer
2147This function formats a line of text according to @var{format} as if it 2143This function formats a line of text according to @var{format} as if it
@@ -2375,12 +2371,12 @@ Setting this variable makes it buffer-local in the current buffer.
2375@section Font Lock Mode 2371@section Font Lock Mode
2376@cindex Font Lock mode 2372@cindex Font Lock mode
2377 2373
2378 @dfn{Font Lock mode} is a feature that automatically attaches 2374 @dfn{Font Lock mode} is a buffer-local minor mode that automatically
2379@code{face} properties to certain parts of the buffer based on their 2375attaches @code{face} properties to certain parts of the buffer based on
2380syntactic role. How it parses the buffer depends on the major mode; 2376their syntactic role. How it parses the buffer depends on the major
2381most major modes define syntactic criteria for which faces to use in 2377mode; most major modes define syntactic criteria for which faces to use
2382which contexts. This section explains how to customize Font Lock for a 2378in which contexts. This section explains how to customize Font Lock for
2383particular major mode. 2379a particular major mode.
2384 2380
2385 Font Lock mode finds text to highlight in two ways: through 2381 Font Lock mode finds text to highlight in two ways: through
2386syntactic parsing based on the syntax table, and through searching 2382syntactic parsing based on the syntax table, and through searching
@@ -2399,8 +2395,6 @@ Search-based fontification happens second.
2399 contents can also specify how to fontify it. 2395 contents can also specify how to fontify it.
2400* Faces for Font Lock:: Special faces specifically for Font Lock. 2396* Faces for Font Lock:: Special faces specifically for Font Lock.
2401* Syntactic Font Lock:: Fontification based on syntax tables. 2397* Syntactic Font Lock:: Fontification based on syntax tables.
2402* Setting Syntax Properties:: Defining character syntax based on context
2403 using the Font Lock mechanism.
2404* Multiline Font Lock:: How to coerce Font Lock into properly 2398* Multiline Font Lock:: How to coerce Font Lock into properly
2405 highlighting multiline constructs. 2399 highlighting multiline constructs.
2406@end menu 2400@end menu
@@ -2415,12 +2409,12 @@ variable. The value assigned to this variable is used, if and when Font
2415Lock mode is enabled, to set all the other variables. 2409Lock mode is enabled, to set all the other variables.
2416 2410
2417@defvar font-lock-defaults 2411@defvar font-lock-defaults
2418This variable is set by major modes, as a buffer-local variable, to 2412This variable is set by major modes to specify how to fontify text in
2419specify how to fontify text in that mode. It automatically becomes 2413that mode. It automatically becomes buffer-local when set. If its
2420buffer-local when you set it. If its value is @code{nil}, Font-Lock 2414value is @code{nil}, Font Lock mode does no highlighting, and you can
2421mode does no highlighting, and you can use the @samp{Faces} menu 2415use the @samp{Faces} menu (under @samp{Edit} and then @samp{Text
2422(under @samp{Edit} and then @samp{Text Properties} in the menu bar) to 2416Properties} in the menu bar) to assign faces explicitly to text in the
2423assign faces explicitly to text in the buffer. 2417buffer.
2424 2418
2425If non-@code{nil}, the value should look like this: 2419If non-@code{nil}, the value should look like this:
2426 2420
@@ -2443,19 +2437,20 @@ value. @xref{Levels of Font Lock}.
2443The second element, @var{keywords-only}, specifies the value of the 2437The second element, @var{keywords-only}, specifies the value of the
2444variable @code{font-lock-keywords-only}. If this is omitted or 2438variable @code{font-lock-keywords-only}. If this is omitted or
2445@code{nil}, syntactic fontification (of strings and comments) is also 2439@code{nil}, syntactic fontification (of strings and comments) is also
2446performed. If this is non-@code{nil}, such fontification is not 2440performed. If this is non-@code{nil}, syntactic fontification is not
2447performed. @xref{Syntactic Font Lock}. 2441performed. @xref{Syntactic Font Lock}.
2448 2442
2449The third element, @var{case-fold}, specifies the value of 2443The third element, @var{case-fold}, specifies the value of
2450@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil}, 2444@code{font-lock-keywords-case-fold-search}. If it is non-@code{nil},
2451Font Lock mode ignores case when searching as directed by 2445Font Lock mode ignores case during search-based fontification.
2452@code{font-lock-keywords}.
2453 2446
2454If the fourth element, @var{syntax-alist}, is non-@code{nil}, it 2447If the fourth element, @var{syntax-alist}, is non-@code{nil}, it should
2455should be a list of cons cells of the form @code{(@var{char-or-string} 2448be a list of cons cells of the form @code{(@var{char-or-string}
2456. @var{string})}. These are used to set up a syntax table for 2449. @var{string})}. These are used to set up a syntax table for syntactic
2457syntactic fontification (@pxref{Syntax Table Functions}). The 2450fontification; the resulting syntax table is stored in
2458resulting syntax table is stored in @code{font-lock-syntax-table}. 2451@code{font-lock-syntax-table}. If @var{syntax-alist} is omitted or
2452@code{nil}, syntactic fontification uses the syntax table returned by
2453the @code{syntax-table} function. @xref{Syntax Table Functions}.
2459 2454
2460The fifth element, @var{syntax-begin}, specifies the value of 2455The fifth element, @var{syntax-begin}, specifies the value of
2461@code{font-lock-beginning-of-syntax-function}. We recommend setting 2456@code{font-lock-beginning-of-syntax-function}. We recommend setting
@@ -2481,15 +2476,17 @@ fontification for other parts of the text.
2481@node Search-based Fontification 2476@node Search-based Fontification
2482@subsection Search-based Fontification 2477@subsection Search-based Fontification
2483 2478
2484 The most important variable for customizing Font Lock mode is 2479 The variable which directly controls search-based fontification is
2485@code{font-lock-keywords}. It specifies the search criteria for 2480@code{font-lock-keywords}, which is typically specified via the
2486search-based fontification. You should specify the value of this 2481@var{keywords} element in @code{font-lock-defaults}.
2487variable with @var{keywords} in @code{font-lock-defaults}.
2488 2482
2489@defvar font-lock-keywords 2483@defvar font-lock-keywords
2490This variable's value is a list of the keywords to highlight. Be 2484The value of this variable is a list of the keywords to highlight. Lisp
2491careful when composing regular expressions for this list; a poorly 2485programs should not set this variable directly. Normally, the value is
2492written pattern can dramatically slow things down! 2486automatically set by Font Lock mode, using the @var{keywords} element in
2487@code{font-lock-defaults}. The value can also be altered using the
2488functions @code{font-lock-add-keywords} and
2489@code{font-lock-remove-keywords} (@pxref{Customizing Keywords}).
2493@end defvar 2490@end defvar
2494 2491
2495 Each element of @code{font-lock-keywords} specifies how to find 2492 Each element of @code{font-lock-keywords} specifies how to find
@@ -2514,9 +2511,10 @@ Highlight all matches for @var{regexp} using
2514"\\<foo\\>" 2511"\\<foo\\>"
2515@end example 2512@end example
2516 2513
2517The function @code{regexp-opt} (@pxref{Regexp Functions}) is useful 2514Be careful when composing these regular expressions; a poorly written
2518for calculating optimal regular expressions to match a number of 2515pattern can dramatically slow things down! The function
2519different keywords. 2516@code{regexp-opt} (@pxref{Regexp Functions}) is useful for calculating
2517optimal regular expressions to match several keywords.
2520 2518
2521@item @var{function} 2519@item @var{function}
2522Find text by calling @var{function}, and highlight the matches 2520Find text by calling @var{function}, and highlight the matches
@@ -2741,7 +2739,7 @@ highlighting patterns. See the variables
2741@code{c-font-lock-extra-types}, @code{c++-font-lock-extra-types}, 2739@code{c-font-lock-extra-types}, @code{c++-font-lock-extra-types},
2742and @code{java-font-lock-extra-types}, for example. 2740and @code{java-font-lock-extra-types}, for example.
2743 2741
2744@strong{Warning:} major mode commands must not call 2742@strong{Warning:} Major mode commands must not call
2745@code{font-lock-add-keywords} under any circumstances, either directly 2743@code{font-lock-add-keywords} under any circumstances, either directly
2746or indirectly, except through their mode hooks. (Doing so would lead to 2744or indirectly, except through their mode hooks. (Doing so would lead to
2747incorrect behavior for some minor modes.) They should set up their 2745incorrect behavior for some minor modes.) They should set up their
@@ -2757,7 +2755,10 @@ command name or @code{nil}. All the caveats and requirements for
2757@code{font-lock-add-keywords} apply here too. 2755@code{font-lock-add-keywords} apply here too.
2758@end defun 2756@end defun
2759 2757
2760 For example, this code 2758 For example, the following code adds two fontification patterns for C
2759mode: one to fontify the word @samp{FIXME}, even in comments, and
2760another to fontify the words @samp{and}, @samp{or} and @samp{not} as
2761keywords.
2761 2762
2762@smallexample 2763@smallexample
2763(font-lock-add-keywords 'c-mode 2764(font-lock-add-keywords 'c-mode
@@ -2766,13 +2767,8 @@ command name or @code{nil}. All the caveats and requirements for
2766@end smallexample 2767@end smallexample
2767 2768
2768@noindent 2769@noindent
2769adds two fontification patterns for C mode: one to fontify the word 2770This example affects only C mode proper. To add the same patterns to C
2770@samp{FIXME}, even in comments, and another to fontify the words 2771mode @emph{and} all modes derived from it, do this instead:
2771@samp{and}, @samp{or} and @samp{not} as keywords.
2772
2773@noindent
2774That example affects only C mode proper. To add the same patterns to
2775C mode @emph{and} all modes derived from it, do this instead:
2776 2772
2777@smallexample 2773@smallexample
2778(add-hook 'c-mode-hook 2774(add-hook 'c-mode-hook
@@ -2859,13 +2855,13 @@ function using @code{jit-lock-register}, this function unregisters it.
2859@node Levels of Font Lock 2855@node Levels of Font Lock
2860@subsection Levels of Font Lock 2856@subsection Levels of Font Lock
2861 2857
2862 Many major modes offer three different levels of fontification. You 2858 Some major modes offer three different levels of fontification. You
2863can define multiple levels by using a list of symbols for @var{keywords} 2859can define multiple levels by using a list of symbols for @var{keywords}
2864in @code{font-lock-defaults}. Each symbol specifies one level of 2860in @code{font-lock-defaults}. Each symbol specifies one level of
2865fontification; it is up to the user to choose one of these levels, 2861fontification; it is up to the user to choose one of these levels,
2866normally by setting @code{font-lock-maximum-decoration} (@pxref{Font 2862normally by setting @code{font-lock-maximum-decoration} (@pxref{Font
2867Lock,,, emacs, the GNU Emacs Manual}). The chosen level's symbol 2863Lock,,, emacs, the GNU Emacs Manual}). The chosen level's symbol value
2868value is used to initialize @code{font-lock-keywords}. 2864is used to initialize @code{font-lock-keywords}.
2869 2865
2870 Here are the conventions for how to define the levels of 2866 Here are the conventions for how to define the levels of
2871fontification: 2867fontification:
@@ -2913,10 +2909,10 @@ the normal Font Lock machinery, it should not set the variable
2913@cindex font lock faces 2909@cindex font lock faces
2914 2910
2915 Font Lock mode can highlight using any face, but Emacs defines several 2911 Font Lock mode can highlight using any face, but Emacs defines several
2916faces specifically for syntactic highlighting. These @dfn{Font Lock 2912faces specifically for Font Lock to use to highlight text. These
2917faces} are listed below. They can also be used by major modes for 2913@dfn{Font Lock faces} are listed below. They can also be used by major
2918syntactic highlighting outside of Font Lock mode (@pxref{Major Mode 2914modes for syntactic highlighting outside of Font Lock mode (@pxref{Major
2919Conventions}). 2915Mode Conventions}).
2920 2916
2921 Each of these symbols is both a face name, and a variable whose 2917 Each of these symbols is both a face name, and a variable whose
2922default value is the symbol itself. Thus, the default value of 2918default value is the symbol itself. Thus, the default value of
@@ -2991,128 +2987,66 @@ for easily-overlooked negation characters.
2991@subsection Syntactic Font Lock 2987@subsection Syntactic Font Lock
2992@cindex syntactic font lock 2988@cindex syntactic font lock
2993 2989
2994Syntactic fontification uses the syntax table to find comments and 2990Syntactic fontification uses a syntax table (@pxref{Syntax Tables}) to
2995string constants (@pxref{Syntax Tables}). It highlights them using 2991find and highlight syntactically relevant text. If enabled, it runs
2996@code{font-lock-comment-face} and @code{font-lock-string-face} 2992prior to search-based fontification. The variable
2997(@pxref{Faces for Font Lock}), or whatever 2993@code{font-lock-syntactic-face-function}, documented below, determines
2998@code{font-lock-syntactic-face-function} chooses. There are several 2994which syntactic constructs to highlight. There are several variables
2999variables that affect syntactic fontification; you should set them by 2995that affect syntactic fontification; you should set them by means of
3000means of @code{font-lock-defaults} (@pxref{Font Lock Basics}). 2996@code{font-lock-defaults} (@pxref{Font Lock Basics}).
2997
2998 Whenever Font Lock mode performs syntactic fontification on a stretch
2999of text, it first calls the function specified by
3000@code{syntax-propertize-function}. Major modes can use this to apply
3001@code{syntax-table} text properties to override the buffer's syntax
3002table in special cases. @xref{Syntax Properties}.
3001 3003
3002@defvar font-lock-keywords-only 3004@defvar font-lock-keywords-only
3003Non-@code{nil} means Font Lock should not do syntactic fontification; 3005If the value of this variable is non-@code{nil}, Font Lock does not do
3004it should only fontify based on @code{font-lock-keywords}. The normal 3006syntactic fontification, only search-based fontification based on
3005way for a mode to set this variable to @code{t} is with 3007@code{font-lock-keywords}. It is normally set by Font Lock mode based
3006@var{keywords-only} in @code{font-lock-defaults}. 3008on the @var{keywords-only} element in @code{font-lock-defaults}.
3007@end defvar 3009@end defvar
3008 3010
3009@defvar font-lock-syntax-table 3011@defvar font-lock-syntax-table
3010This variable holds the syntax table to use for fontification of 3012This variable holds the syntax table to use for fontification of
3011comments and strings. Specify it using @var{syntax-alist} in 3013comments and strings. It is normally set by Font Lock mode based on the
3012@code{font-lock-defaults}. If this is @code{nil}, fontification uses 3014@var{syntax-alist} element in @code{font-lock-defaults}. If this value
3013the buffer's syntax table. 3015is @code{nil}, syntactic fontification uses the buffer's syntax table
3016(the value returned by the function @code{syntax-table}; @pxref{Syntax
3017Table Functions}).
3014@end defvar 3018@end defvar
3015 3019
3016@defvar font-lock-beginning-of-syntax-function 3020@defvar font-lock-beginning-of-syntax-function
3017If this variable is non-@code{nil}, it should be a function to move 3021If this variable is non-@code{nil}, it should be a function to move
3018point back to a position that is syntactically at ``top level'' and 3022point back to a position that is syntactically at ``top level'' and
3019outside of strings or comments. Font Lock uses this when necessary 3023outside of strings or comments. The value is normally set through an
3020to get the right results for syntactic fontification. 3024@var{other-vars} element in @code{font-lock-defaults}. If it is
3021 3025@code{nil}, Font Lock uses @code{syntax-begin-function} to move back
3022This function is called with no arguments. It should leave point at 3026outside of any comment, string, or sexp (@pxref{Position Parse}).
3023the beginning of any enclosing syntactic block. Typical values are 3027
3024@code{beginning-of-line} (used when the start of the line is known to 3028This variable is semi-obsolete; we usually recommend setting
3025be outside a syntactic block), or @code{beginning-of-defun} for 3029@code{syntax-begin-function} instead. One of its uses is to tune the
3030behavior of syntactic fontification, e.g.@: to ensure that different
3031kinds of strings or comments are highlighted differently.
3032
3033The specified function is called with no arguments. It should leave
3034point at the beginning of any enclosing syntactic block. Typical values
3035are @code{beginning-of-line} (used when the start of the line is known
3036to be outside a syntactic block), or @code{beginning-of-defun} for
3026programming modes, or @code{backward-paragraph} for textual modes. 3037programming modes, or @code{backward-paragraph} for textual modes.
3027
3028If the value is @code{nil}, Font Lock uses
3029@code{syntax-begin-function} to move back outside of any comment,
3030string, or sexp. This variable is semi-obsolete; we recommend setting
3031@code{syntax-begin-function} instead.
3032
3033Specify this variable using @var{syntax-begin} in
3034@code{font-lock-defaults}.
3035@end defvar 3038@end defvar
3036 3039
3037@defvar font-lock-syntactic-face-function 3040@defvar font-lock-syntactic-face-function
3038A function to determine which face to use for a given syntactic 3041If this variable is non-@code{nil}, it should be a function to determine
3039element (a string or a comment). The function is called with one 3042which face to use for a given syntactic element (a string or a comment).
3040argument, the parse state at point returned by 3043The value is normally set through an @var{other-vars} element in
3041@code{parse-partial-sexp}, and should return a face. The default
3042value returns @code{font-lock-comment-face} for comments and
3043@code{font-lock-string-face} for strings.
3044
3045This can be used to highlighting different kinds of strings or
3046comments differently. It is also sometimes abused together with
3047@code{font-lock-syntactic-keywords} to highlight constructs that span
3048multiple lines, but this is too esoteric to document here.
3049
3050Specify this variable using @var{other-vars} in
3051@code{font-lock-defaults}. 3044@code{font-lock-defaults}.
3052@end defvar
3053
3054@node Setting Syntax Properties
3055@subsection Setting Syntax Properties
3056
3057 Font Lock mode can be used to update @code{syntax-table} properties
3058automatically (@pxref{Syntax Properties}). This is useful in
3059languages for which a single syntax table by itself is not sufficient.
3060
3061@defvar font-lock-syntactic-keywords
3062This variable enables and controls updating @code{syntax-table}
3063properties by Font Lock. Its value should be a list of elements of
3064this form:
3065
3066@example
3067(@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch})
3068@end example
3069
3070The parts of this element have the same meanings as in the corresponding
3071sort of element of @code{font-lock-keywords},
3072 3045
3073@example 3046The function is called with one argument, the parse state at point
3074(@var{matcher} @var{subexp} @var{facespec} @var{override} @var{laxmatch}) 3047returned by @code{parse-partial-sexp}, and should return a face. The
3075@end example 3048default value returns @code{font-lock-comment-face} for comments and
3076 3049@code{font-lock-string-face} for strings (@pxref{Faces for Font Lock}).
3077However, instead of specifying the value @var{facespec} to use for the
3078@code{face} property, it specifies the value @var{syntax} to use for
3079the @code{syntax-table} property. Here, @var{syntax} can be a string
3080(as taken by @code{modify-syntax-entry}), a syntax table, a cons cell
3081(as returned by @code{string-to-syntax}), or an expression whose value
3082is one of those two types. @var{override} cannot be @code{prepend} or
3083@code{append}.
3084
3085For example, an element of the form:
3086
3087@example
3088("\\$\\(#\\)" 1 ".")
3089@end example
3090
3091highlights syntactically a hash character when following a dollar
3092character, with a SYNTAX of @code{"."} (meaning punctuation syntax).
3093Assuming that the buffer syntax table specifies hash characters to
3094have comment start syntax, the element will only highlight hash
3095characters that do not follow dollar characters as comments
3096syntactically.
3097
3098An element of the form:
3099
3100@example
3101 ("\\('\\).\\('\\)"
3102 (1 "\"")
3103 (2 "\""))
3104@end example
3105
3106highlights syntactically both single quotes which surround a single
3107character, with a SYNTAX of @code{"\""} (meaning string quote syntax).
3108Assuming that the buffer syntax table does not specify single quotes
3109to have quote syntax, the element will only highlight single quotes of
3110the form @samp{'@var{c}'} as strings syntactically. Other forms, such
3111as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as
3112strings.
3113
3114Major modes normally set this variable with @var{other-vars} in
3115@code{font-lock-defaults}.
3116@end defvar 3050@end defvar
3117 3051
3118@node Multiline Font Lock 3052@node Multiline Font Lock
@@ -3221,18 +3155,17 @@ easy to add the @code{font-lock-multiline} property by hand.
3221 3155
3222 The @code{font-lock-multiline} property is meant to ensure proper 3156 The @code{font-lock-multiline} property is meant to ensure proper
3223refontification; it does not automatically identify new multiline 3157refontification; it does not automatically identify new multiline
3224constructs. Identifying the requires that Font-Lock operate on large 3158constructs. Identifying the requires that Font Lock mode operate on
3225enough chunks at a time. This will happen by accident on many cases, 3159large enough chunks at a time. This will happen by accident on many
3226which may give the impression that multiline constructs magically work. 3160cases, which may give the impression that multiline constructs magically
3227If you set the @code{font-lock-multiline} variable non-@code{nil}, 3161work. If you set the @code{font-lock-multiline} variable
3228this impression will be even stronger, since the highlighting of those 3162non-@code{nil}, this impression will be even stronger, since the
3229constructs which are found will be properly updated from then on. 3163highlighting of those constructs which are found will be properly
3230But that does not work reliably. 3164updated from then on. But that does not work reliably.
3231 3165
3232 To find multiline constructs reliably, you must either manually 3166 To find multiline constructs reliably, you must either manually place
3233place the @code{font-lock-multiline} property on the text before 3167the @code{font-lock-multiline} property on the text before Font Lock
3234Font-Lock looks at it, or use 3168mode looks at it, or use @code{font-lock-fontify-region-function}.
3235@code{font-lock-fontify-region-function}.
3236 3169
3237@node Region to Refontify 3170@node Region to Refontify
3238@subsubsection Region to Fontify after a Buffer Change 3171@subsubsection Region to Fontify after a Buffer Change
@@ -3247,8 +3180,8 @@ earlier line.
3247the following variable: 3180the following variable:
3248 3181
3249@defvar font-lock-extend-after-change-region-function 3182@defvar font-lock-extend-after-change-region-function
3250This buffer-local variable is either @code{nil} or a function for 3183This buffer-local variable is either @code{nil} or a function for Font
3251Font-Lock to call to determine the region to scan and fontify. 3184Lock mode to call to determine the region to scan and fontify.
3252 3185
3253The function is given three parameters, the standard @var{beg}, 3186The function is given three parameters, the standard @var{beg},
3254@var{end}, and @var{old-len} from @code{after-change-functions} 3187@var{end}, and @var{old-len} from @code{after-change-functions}
@@ -3264,7 +3197,7 @@ reasonably fast.
3264@end defvar 3197@end defvar
3265 3198
3266@node Auto-Indentation 3199@node Auto-Indentation
3267@section Auto-indentation of code 3200@section Automatic Indentation of code
3268 3201
3269For programming languages, an important feature of a major mode is to 3202For programming languages, an important feature of a major mode is to
3270provide automatic indentation. This is controlled in Emacs by 3203provide automatic indentation. This is controlled in Emacs by
@@ -3287,7 +3220,7 @@ for a compiler, but on the other hand, the parser embedded in the
3287indentation code will want to be somewhat friendly to syntactically 3220indentation code will want to be somewhat friendly to syntactically
3288incorrect code. 3221incorrect code.
3289 3222
3290Good maintainable indentation functions usually fall into 2 categories: 3223Good maintainable indentation functions usually fall into two categories:
3291either parsing forward from some ``safe'' starting point until the 3224either parsing forward from some ``safe'' starting point until the
3292position of interest, or parsing backward from the position of interest. 3225position of interest, or parsing backward from the position of interest.
3293Neither of the two is a clearly better choice than the other: parsing 3226Neither of the two is a clearly better choice than the other: parsing
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 4cfc954cd1f..d91800fcb80 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1939,9 +1939,13 @@ queued but input may be lost. You can use the function
1939@code{process-command} to determine whether a network connection or 1939@code{process-command} to determine whether a network connection or
1940server is stopped; a non-@code{nil} value means yes. 1940server is stopped; a non-@code{nil} value means yes.
1941 1941
1942@defun open-network-stream name buffer-or-name host service 1942@cindex network connection, encrypted
1943This function opens a TCP connection, and returns a process object 1943@cindex encrypted network connections
1944that represents the connection. 1944@cindex TLS network connections
1945@cindex STARTTLS network connections
1946@defun open-network-stream name buffer-or-name host service &rest parameters
1947This function opens a TCP connection, with optional encryption, and
1948returns a process object that represents the connection.
1945 1949
1946The @var{name} argument specifies the name for the process object. It 1950The @var{name} argument specifies the name for the process object. It
1947is modified as necessary to make it unique. 1951is modified as necessary to make it unique.
@@ -1955,6 +1959,83 @@ associated with any buffer.
1955The arguments @var{host} and @var{service} specify where to connect to; 1959The arguments @var{host} and @var{service} specify where to connect to;
1956@var{host} is the host name (a string), and @var{service} is the name of 1960@var{host} is the host name (a string), and @var{service} is the name of
1957a defined network service (a string) or a port number (an integer). 1961a defined network service (a string) or a port number (an integer).
1962
1963@c FIXME? Is this too lengthy for the printed manual?
1964The remaining arguments @var{parameters} are keyword/argument pairs
1965that are mainly relevant to encrypted connections:
1966
1967@table @code
1968
1969@item :nowait @var{boolean}
1970If non-@code{nil}, try to make an asynchronous connection.
1971
1972@item :type @var{type}
1973The type of connection. Options are:
1974
1975@table @code
1976@item plain
1977An ordinary, unencrypted connection.
1978@item tls
1979@itemx ssl
1980A TLS (``Transport Layer Security'') connection.
1981@item nil
1982@itemx network
1983Start with a plain connection, and if parameters @samp{:success}
1984and @samp{:capability-command} are supplied, try to upgrade to an encrypted
1985connection via STARTTLS. If that fails, retain the unencrypted connection.
1986@item starttls
1987As for @code{nil}, but if STARTTLS fails drop the connection.
1988@item shell
1989A shell connection.
1990@end table
1991
1992@item :always-query-capabilities @var{boolean}
1993If non-@code{nil}, always ask for the server's capabilities, even when
1994doing a @samp{plain} connection.
1995
1996@item :capability-command @var{capability-command}
1997Command string to query the host capabilities.
1998
1999@item :end-of-command @var{regexp}
2000@itemx :end-of-capability @var{regexp}
2001Regular expression matching the end of a command, or the end of the
2002command @var{capability-command}. The latter defaults to the former.
2003
2004@item :starttls-function @var{function}
2005Function of one argument (the response to @var{capability-command}),
2006which returns either @code{nil}, or the command to activate STARTTLS
2007if supported.
2008
2009@item :success @var{regexp}
2010Regular expression matching a successful STARTTLS negotiation.
2011
2012@item :use-starttls-if-possible @var{boolean}
2013If non-@code{nil}, do opportunistic STARTTLS upgrades even if Emacs
2014doesn't have built-in TLS support.
2015
2016@item :client-certificate @var{list-or-t}
2017Either a list of the form @code{(@var{key-file} @var{cert-file})},
2018naming the certificate key file and certificate file itself, or
2019@code{t}, meaning to query @code{auth-source} for this information
2020(@pxref{Top,,auth-source, auth, Emacs auth-source Library}).
2021Only used for TLS or STARTTLS.
2022
2023@item :return-list @var{cons-or-nil}
2024The return value of this function. If omitted or @code{nil}, return a
2025process object. Otherwise, a cons of the form @code{(@var{process-object}
2026. @var{plist})}, where @var{plist} has keywords:
2027
2028@table @code
2029@item :greeting @var{string-or-nil}
2030If non-@code{nil}, the greeting string returned by the host.
2031@item :capabilities @var{string-or-nil}
2032If non-@code{nil}, the host's capability string.
2033@item :type @var{symbol}
2034The connection type: @samp{plain} or @samp{tls}.
2035@end table
2036
2037@end table
2038
1958@end defun 2039@end defun
1959 2040
1960@node Network Servers 2041@node Network Servers
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index 3d153e43b2d..dbfa4ca9045 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -10,17 +10,15 @@
10@cindex syntax table 10@cindex syntax table
11@cindex text parsing 11@cindex text parsing
12 12
13 A @dfn{syntax table} specifies the syntactic textual function of each 13 A @dfn{syntax table} specifies the syntactic role of each character
14character. This information is used by the @dfn{parsing functions}, the 14in a buffer. It can be used to determine where words, symbols, and
15complex movement commands, and others to determine where words, symbols, 15other syntactic constructs begin and end. This information is used by
16and other syntactic constructs begin and end. The current syntax table 16many Emacs facilities, including Font Lock mode (@pxref{Font Lock
17controls the meaning of the word motion functions (@pxref{Word Motion}) 17Mode}) and the various complex movement commands (@pxref{Motion}).
18and the list motion functions (@pxref{List Motion}), as well as the
19functions in this chapter.
20 18
21@menu 19@menu
22* Basics: Syntax Basics. Basic concepts of syntax tables. 20* Basics: Syntax Basics. Basic concepts of syntax tables.
23* Desc: Syntax Descriptors. How characters are classified. 21* Syntax Descriptors:: How characters are classified.
24* Syntax Table Functions:: How to create, examine and alter syntax tables. 22* Syntax Table Functions:: How to create, examine and alter syntax tables.
25* Syntax Properties:: Overriding syntax with text properties. 23* Syntax Properties:: Overriding syntax with text properties.
26* Motion and Syntax:: Moving over characters with certain syntaxes. 24* Motion and Syntax:: Moving over characters with certain syntaxes.
@@ -34,17 +32,6 @@ functions in this chapter.
34@node Syntax Basics 32@node Syntax Basics
35@section Syntax Table Concepts 33@section Syntax Table Concepts
36 34
37@ifnottex
38 A @dfn{syntax table} provides Emacs with the information that
39determines the syntactic use of each character in a buffer. This
40information is used by the parsing commands, the complex movement
41commands, and others to determine where words, symbols, and other
42syntactic constructs begin and end. The current syntax table controls
43the meaning of the word motion functions (@pxref{Word Motion}) and the
44list motion functions (@pxref{List Motion}) as well as the functions in
45this chapter.
46@end ifnottex
47
48 A syntax table is a char-table (@pxref{Char-Tables}). The element at 35 A syntax table is a char-table (@pxref{Char-Tables}). The element at
49index @var{c} describes the character with code @var{c}. The element's 36index @var{c} describes the character with code @var{c}. The element's
50value should be a list that encodes the syntax of the character in 37value should be a list that encodes the syntax of the character in
@@ -57,16 +44,15 @@ provide ways to redefine the read syntax, but we decided to leave this
57feature out of Emacs Lisp for simplicity.) 44feature out of Emacs Lisp for simplicity.)
58 45
59 Each buffer has its own major mode, and each major mode has its own 46 Each buffer has its own major mode, and each major mode has its own
60idea of the syntactic class of various characters. For example, in Lisp 47idea of the syntactic class of various characters. For example, in
61mode, the character @samp{;} begins a comment, but in C mode, it 48Lisp mode, the character @samp{;} begins a comment, but in C mode, it
62terminates a statement. To support these variations, Emacs makes the 49terminates a statement. To support these variations, Emacs makes the
63choice of syntax table local to each buffer. Typically, each major 50syntax table local to each buffer. Typically, each major mode has its
64mode has its own syntax table and installs that table in each buffer 51own syntax table and installs that table in each buffer that uses that
65that uses that mode. Changing this table alters the syntax in all 52mode. Changing this table alters the syntax in all those buffers as
66those buffers as well as in any buffers subsequently put in that mode. 53well as in any buffers subsequently put in that mode. Occasionally
67Occasionally several similar modes share one syntax table. 54several similar modes share one syntax table. @xref{Example Major
68@xref{Example Major Modes}, for an example of how to set up a syntax 55Modes}, for an example of how to set up a syntax table.
69table.
70 56
71A syntax table can inherit the data for some characters from the 57A syntax table can inherit the data for some characters from the
72standard syntax table, while specifying other characters itself. The 58standard syntax table, while specifying other characters itself. The
@@ -82,30 +68,38 @@ This function returns @code{t} if @var{object} is a syntax table.
82@section Syntax Descriptors 68@section Syntax Descriptors
83@cindex syntax class 69@cindex syntax class
84 70
85 This section describes the syntax classes and flags that denote the 71 The syntactic role of a character is called its @dfn{syntax class}.
86syntax of a character, and how they are represented as a @dfn{syntax 72Each syntax table specifies the syntax class of each character. There
87descriptor}, which is a Lisp string that you pass to
88@code{modify-syntax-entry} to specify the syntax you want.
89
90 The syntax table specifies a syntax class for each character. There
91is no necessary relationship between the class of a character in one 73is no necessary relationship between the class of a character in one
92syntax table and its class in any other table. 74syntax table and its class in any other table.
93 75
94 Each class is designated by a mnemonic character, which serves as the 76 Each syntax class is designated by a mnemonic character, which
95name of the class when you need to specify a class. Usually the 77serves as the name of the class when you need to specify a class.
96designator character is one that is often assigned that class; however, 78Usually, this designator character is one that is often assigned that
97its meaning as a designator is unvarying and independent of what syntax 79class; however, its meaning as a designator is unvarying and
98that character currently has. Thus, @samp{\} as a designator character 80independent of what syntax that character currently has. Thus,
99always gives ``escape character'' syntax, regardless of what syntax 81@samp{\} as a designator character always means ``escape character''
100@samp{\} currently has. 82syntax, regardless of whether the @samp{\} character actually has that
83syntax in the current syntax table.
84@ifnottex
85@xref{Syntax Class Table}, for a list of syntax classes.
86@end ifnottex
101 87
102@cindex syntax descriptor 88@cindex syntax descriptor
103 A syntax descriptor is a Lisp string that specifies a syntax class, a 89 A @dfn{syntax descriptor} is a Lisp string that describes the syntax
104matching character (used only for the parenthesis classes) and flags. 90classes and other syntactic properties of a character. When you want
105The first character is the designator for a syntax class. The second 91to modify the syntax of a character, that is done by calling the
106character is the character to match; if it is unused, put a space there. 92function @code{modify-syntax-entry} and passing a syntax descriptor as
107Then come the characters for any desired flags. If no matching 93one of its arguments (@pxref{Syntax Table Functions}).
108character or flags are needed, one character is sufficient. 94
95 The first character in a syntax descriptor designates the syntax
96class. The second character specifies a matching character (e.g.@: in
97Lisp, the matching character for @samp{(} is @samp{)}); if there is no
98matching character, put a space there. Then come the characters for
99any desired flags.
100
101 If no matching character or flags are needed, only one character
102(specifying the syntax class) is sufficient.
109 103
110 For example, the syntax descriptor for the character @samp{*} in C 104 For example, the syntax descriptor for the character @samp{*} in C
111mode is @code{". 23"} (i.e., punctuation, matching character slot 105mode is @code{". 23"} (i.e., punctuation, matching character slot
@@ -122,70 +116,58 @@ comment-starter, second character of a comment-ender).
122@node Syntax Class Table 116@node Syntax Class Table
123@subsection Table of Syntax Classes 117@subsection Table of Syntax Classes
124 118
125 Here is a table of syntax classes, the characters that stand for them, 119 Here is a table of syntax classes, the characters that designate
126their meanings, and examples of their use. 120them, their meanings, and examples of their use.
127
128@deffn {Syntax class} @w{whitespace character}
129@dfn{Whitespace characters} (designated by @w{@samp{@ }} or @samp{-})
130separate symbols and words from each other. Typically, whitespace
131characters have no other syntactic significance, and multiple
132whitespace characters are syntactically equivalent to a single one.
133Space, tab, and formfeed are classified as whitespace in almost all
134major modes.
135@end deffn
136
137@deffn {Syntax class} @w{word constituent}
138@dfn{Word constituents} (designated by @samp{w}) are parts of words in
139human languages, and are typically used in variable and command names
140in programs. All upper- and lower-case letters, and the digits, are
141typically word constituents.
142@end deffn
143 121
144@deffn {Syntax class} @w{symbol constituent} 122@table @asis
145@dfn{Symbol constituents} (designated by @samp{_}) are the extra 123@item Whitespace characters: @samp{@ } or @samp{-}
146characters that are used in variable and command names along with word 124Characters that separate symbols and words from each other.
147constituents. For example, the symbol constituents class is used in 125Typically, whitespace characters have no other syntactic significance,
148Lisp mode to indicate that certain characters may be part of symbol 126and multiple whitespace characters are syntactically equivalent to a
149names even though they are not part of English words. These characters 127single one. Space, tab, and formfeed are classified as whitespace in
150are @samp{$&*+-_<>}. In standard C, the only non-word-constituent 128almost all major modes.
129
130This syntax class can be designated by either @w{@samp{@ }} or
131@samp{-}. Both designators are equivalent.
132
133@item Word constituents: @samp{w}
134Parts of words in human languages. These are typically used in
135variable and command names in programs. All upper- and lower-case
136letters, and the digits, are typically word constituents.
137
138@item Symbol constituents: @samp{_}
139Extra characters used in variable and command names along with word
140constituents. Examples include the characters @samp{$&*+-_<>} in Lisp
141mode, which may be part of a symbol name even though they are not part
142of English words. In standard C, the only non-word-constituent
151character that is valid in symbols is underscore (@samp{_}). 143character that is valid in symbols is underscore (@samp{_}).
152@end deffn
153
154@deffn {Syntax class} @w{punctuation character}
155@dfn{Punctuation characters} (designated by @samp{.}) are those
156characters that are used as punctuation in English, or are used in some
157way in a programming language to separate symbols from one another.
158Some programming language modes, such as Emacs Lisp mode, have no
159characters in this class since the few characters that are not symbol or
160word constituents all have other uses. Other programming language modes,
161such as C mode, use punctuation syntax for operators.
162@end deffn
163 144
164@deffn {Syntax class} @w{open parenthesis character} 145@item Punctuation characters: @samp{.}
165@deffnx {Syntax class} @w{close parenthesis character} 146Characters used as punctuation in a human language, or used in a
166@cindex parenthesis syntax 147programming language to separate symbols from one another. Some
167Open and close @dfn{parenthesis characters} are characters used in 148programming language modes, such as Emacs Lisp mode, have no
168dissimilar pairs to surround sentences or expressions. Such a grouping 149characters in this class since the few characters that are not symbol
169is begun with an open parenthesis character and terminated with a close. 150or word constituents all have other uses. Other programming language
170Each open parenthesis character matches a particular close parenthesis 151modes, such as C mode, use punctuation syntax for operators.
171character, and vice versa. Normally, Emacs indicates momentarily the 152
172matching open parenthesis when you insert a close parenthesis. 153@item Open parenthesis characters: @samp{(}
173@xref{Blinking}. 154@itemx Close parenthesis characters: @samp{)}
174 155Characters used in dissimilar pairs to surround sentences or
175The class of open parentheses is designated by @samp{(}, and that of 156expressions. Such a grouping is begun with an open parenthesis
176close parentheses by @samp{)}. 157character and terminated with a close. Each open parenthesis
177 158character matches a particular close parenthesis character, and vice
178In English text, and in C code, the parenthesis pairs are @samp{()}, 159versa. Normally, Emacs indicates momentarily the matching open
179@samp{[]}, and @samp{@{@}}. In Emacs Lisp, the delimiters for lists and 160parenthesis when you insert a close parenthesis. @xref{Blinking}.
180vectors (@samp{()} and @samp{[]}) are classified as parenthesis 161
181characters. 162In human languages, and in C code, the parenthesis pairs are
182@end deffn 163@samp{()}, @samp{[]}, and @samp{@{@}}. In Emacs Lisp, the delimiters
183 164for lists and vectors (@samp{()} and @samp{[]}) are classified as
184@deffn {Syntax class} @w{string quote} 165parenthesis characters.
185@dfn{String quote characters} (designated by @samp{"}) are used in 166
186many languages, including Lisp and C, to delimit string constants. The 167@item String quotes: @samp{"}
187same string quote character appears at the beginning and the end of a 168Characters used to delimit string constants. The same string quote
188string. Such quoted strings do not nest. 169character appears at the beginning and the end of a string. Such
170quoted strings do not nest.
189 171
190The parsing facilities of Emacs consider a string as a single token. 172The parsing facilities of Emacs consider a string as a single token.
191The usual syntactic meanings of the characters in the string are 173The usual syntactic meanings of the characters in the string are
@@ -197,94 +179,79 @@ is used in Common Lisp. C also has two string quote characters:
197double-quote for strings, and single-quote (@samp{'}) for character 179double-quote for strings, and single-quote (@samp{'}) for character
198constants. 180constants.
199 181
200English text has no string quote characters because English is not a 182Human text has no string quote characters. We do not want quotation
201programming language. Although quotation marks are used in English, 183marks to turn off the usual syntactic properties of other characters
202we do not want them to turn off the usual syntactic properties of 184in the quotation.
203other characters in the quotation.
204@end deffn
205 185
206@deffn {Syntax class} @w{escape-syntax character} 186@item Escape-syntax characters: @samp{\}
207An @dfn{escape character} (designated by @samp{\}) starts an escape 187Characters that start an escape sequence, such as is used in string
208sequence such as is used in C string and character constants. The 188and character constants. The character @samp{\} belongs to this class
209character @samp{\} belongs to this class in both C and Lisp. (In C, it 189in both C and Lisp. (In C, it is used thus only inside strings, but
210is used thus only inside strings, but it turns out to cause no trouble 190it turns out to cause no trouble to treat it this way throughout C
211to treat it this way throughout C code.) 191code.)
212 192
213Characters in this class count as part of words if 193Characters in this class count as part of words if
214@code{words-include-escapes} is non-@code{nil}. @xref{Word Motion}. 194@code{words-include-escapes} is non-@code{nil}. @xref{Word Motion}.
215@end deffn
216 195
217@deffn {Syntax class} @w{character quote} 196@item Character quotes: @samp{/}
218A @dfn{character quote character} (designated by @samp{/}) quotes the 197Characters used to quote the following character so that it loses its
219following character so that it loses its normal syntactic meaning. This 198normal syntactic meaning. This differs from an escape character in
220differs from an escape character in that only the character immediately 199that only the character immediately following is ever affected.
221following is ever affected.
222 200
223Characters in this class count as part of words if 201Characters in this class count as part of words if
224@code{words-include-escapes} is non-@code{nil}. @xref{Word Motion}. 202@code{words-include-escapes} is non-@code{nil}. @xref{Word Motion}.
225 203
226This class is used for backslash in @TeX{} mode. 204This class is used for backslash in @TeX{} mode.
227@end deffn
228
229@deffn {Syntax class} @w{paired delimiter}
230@dfn{Paired delimiter characters} (designated by @samp{$}) are like
231string quote characters except that the syntactic properties of the
232characters between the delimiters are not suppressed. Only @TeX{} mode
233uses a paired delimiter presently---the @samp{$} that both enters and
234leaves math mode.
235@end deffn
236
237@deffn {Syntax class} @w{expression prefix}
238An @dfn{expression prefix operator} (designated by @samp{'}) is used for
239syntactic operators that are considered as part of an expression if they
240appear next to one. In Lisp modes, these characters include the
241apostrophe, @samp{'} (used for quoting), the comma, @samp{,} (used in
242macros), and @samp{#} (used in the read syntax for certain data types).
243@end deffn
244 205
245@deffn {Syntax class} @w{comment starter} 206@item Paired delimiters: @samp{$}
246@deffnx {Syntax class} @w{comment ender} 207Similar to string quote characters, except that the syntactic
208properties of the characters between the delimiters are not
209suppressed. Only @TeX{} mode uses a paired delimiter presently---the
210@samp{$} that both enters and leaves math mode.
211
212@item Expression prefixes: @samp{'}
213Characters used for syntactic operators that are considered as part of
214an expression if they appear next to one. In Lisp modes, these
215characters include the apostrophe, @samp{'} (used for quoting), the
216comma, @samp{,} (used in macros), and @samp{#} (used in the read
217syntax for certain data types).
218
219@item Comment starters: @samp{<}
220@itemx Comment enders: @samp{>}
247@cindex comment syntax 221@cindex comment syntax
248The @dfn{comment starter} and @dfn{comment ender} characters are used in 222Characters used in various languages to delimit comments. Human text
249various languages to delimit comments. These classes are designated 223has no comment characters. In Lisp, the semicolon (@samp{;}) starts a
250by @samp{<} and @samp{>}, respectively. 224comment and a newline or formfeed ends one.
251 225
252English text has no comment characters. In Lisp, the semicolon 226@item Inherit standard syntax: @samp{@@}
253(@samp{;}) starts a comment and a newline or formfeed ends one. 227This syntax class does not specify a particular syntax. It says to
254@end deffn 228look in the standard syntax table to find the syntax of this
255 229character.
256@deffn {Syntax class} @w{inherit standard syntax}
257This syntax class does not specify a particular syntax. It says to look
258in the standard syntax table to find the syntax of this character. The
259designator for this syntax class is @samp{@@}.
260@end deffn
261 230
262@deffn {Syntax class} @w{generic comment delimiter} 231@item Generic comment delimiters: @samp{!}
263A @dfn{generic comment delimiter} (designated by @samp{!}) starts 232Characters that start or end a special kind of comment. @emph{Any}
264or ends a special kind of comment. @emph{Any} generic comment delimiter 233generic comment delimiter matches @emph{any} generic comment
265matches @emph{any} generic comment delimiter, but they cannot match 234delimiter, but they cannot match a comment starter or comment ender;
266a comment starter or comment ender; generic comment delimiters can only 235generic comment delimiters can only match each other.
267match each other.
268 236
269This syntax class is primarily meant for use with the 237This syntax class is primarily meant for use with the
270@code{syntax-table} text property (@pxref{Syntax Properties}). You can 238@code{syntax-table} text property (@pxref{Syntax Properties}). You
271mark any range of characters as forming a comment, by giving the first 239can mark any range of characters as forming a comment, by giving the
272and last characters of the range @code{syntax-table} properties 240first and last characters of the range @code{syntax-table} properties
273identifying them as generic comment delimiters. 241identifying them as generic comment delimiters.
274@end deffn
275 242
276@deffn {Syntax class} @w{generic string delimiter} 243@item Generic string delimiters: @samp{|}
277A @dfn{generic string delimiter} (designated by @samp{|}) starts or ends 244Characters that start or end a string. This class differs from the
278a string. This class differs from the string quote class in that @emph{any} 245string quote class in that @emph{any} generic string delimiter can
279generic string delimiter can match any other generic string delimiter; but 246match any other generic string delimiter; but they do not match
280they do not match ordinary string quote characters. 247ordinary string quote characters.
281 248
282This syntax class is primarily meant for use with the 249This syntax class is primarily meant for use with the
283@code{syntax-table} text property (@pxref{Syntax Properties}). You can 250@code{syntax-table} text property (@pxref{Syntax Properties}). You
284mark any range of characters as forming a string constant, by giving the 251can mark any range of characters as forming a string constant, by
285first and last characters of the range @code{syntax-table} properties 252giving the first and last characters of the range @code{syntax-table}
286identifying them as generic string delimiters. 253properties identifying them as generic string delimiters.
287@end deffn 254@end table
288 255
289@node Syntax Flags 256@node Syntax Flags
290@subsection Syntax Flags 257@subsection Syntax Flags
@@ -419,25 +386,23 @@ not a syntax table.
419 386
420@deffn Command modify-syntax-entry char syntax-descriptor &optional table 387@deffn Command modify-syntax-entry char syntax-descriptor &optional table
421This function sets the syntax entry for @var{char} according to 388This function sets the syntax entry for @var{char} according to
422@var{syntax-descriptor}. @var{char} can be a character, or a cons 389@var{syntax-descriptor}. @var{char} must be a character, or a cons
423cell of the form @code{(@var{min} . @var{max})}; in the latter case, 390cell of the form @code{(@var{min} . @var{max})}; in the latter case,
424the function sets the syntax entries for all characters in the range 391the function sets the syntax entries for all characters in the range
425between @var{min} and @var{max}, inclusive. 392between @var{min} and @var{max}, inclusive.
426 393
427The syntax is changed only for @var{table}, which defaults to the 394The syntax is changed only for @var{table}, which defaults to the
428current buffer's syntax table, and not in any other syntax table. The 395current buffer's syntax table, and not in any other syntax table.
429argument @var{syntax-descriptor} specifies the desired syntax; this is 396
430a string beginning with a class designator character, and optionally 397The argument @var{syntax-descriptor} is a syntax descriptor for the
431containing a matching character and flags as well. @xref{Syntax 398desired syntax (i.e.@: a string beginning with a class designator
432Descriptors}. 399character, and optionally containing a matching character and syntax
400flags). An error is signaled if the first character is not one of the
401seventeen syntax class designators. @xref{Syntax Descriptors}.
433 402
434This function always returns @code{nil}. The old syntax information in 403This function always returns @code{nil}. The old syntax information in
435the table for this character is discarded. 404the table for this character is discarded.
436 405
437An error is signaled if the first character of the syntax descriptor is not
438one of the seventeen syntax class designator characters. An error is also
439signaled if @var{char} is not a character.
440
441@example 406@example
442@group 407@group
443@exdent @r{Examples:} 408@exdent @r{Examples:}
@@ -534,23 +499,21 @@ execution starts. Other buffers are not affected.
534@kindex syntax-table @r{(text property)} 499@kindex syntax-table @r{(text property)}
535 500
536When the syntax table is not flexible enough to specify the syntax of 501When the syntax table is not flexible enough to specify the syntax of
537a language, you can use @code{syntax-table} text properties to 502a language, you can override the syntax table for specific character
538override the syntax table for specific character occurrences in the 503occurrences in the buffer, by applying a @code{syntax-table} text
539buffer. @xref{Text Properties}. You can use Font Lock mode to set 504property. @xref{Text Properties}, for how to apply text properties.
540@code{syntax-table} text properties. @xref{Setting Syntax
541Properties}.
542 505
543The valid values of @code{syntax-table} text property are: 506 The valid values of @code{syntax-table} text property are:
544 507
545@table @asis 508@table @asis
546@item @var{syntax-table} 509@item @var{syntax-table}
547If the property value is a syntax table, that table is used instead of 510If the property value is a syntax table, that table is used instead of
548the current buffer's syntax table to determine the syntax for this 511the current buffer's syntax table to determine the syntax for the
549occurrence of the character. 512underlying text character.
550 513
551@item @code{(@var{syntax-code} . @var{matching-char})} 514@item @code{(@var{syntax-code} . @var{matching-char})}
552A cons cell of this format specifies the syntax for this 515A cons cell of this format specifies the syntax for the underlying
553occurrence of the character. (@pxref{Syntax Table Internals}) 516text character. (@pxref{Syntax Table Internals})
554 517
555@item @code{nil} 518@item @code{nil}
556If the property is @code{nil}, the character's syntax is determined from 519If the property is @code{nil}, the character's syntax is determined from
@@ -558,9 +521,41 @@ the current syntax table in the usual way.
558@end table 521@end table
559 522
560@defvar parse-sexp-lookup-properties 523@defvar parse-sexp-lookup-properties
561If this is non-@code{nil}, the syntax scanning functions pay attention 524If this is non-@code{nil}, the syntax scanning functions, like
562to syntax text properties. Otherwise they use only the current syntax 525@code{forward-sexp}, pay attention to syntax text properties.
563table. 526Otherwise they use only the current syntax table.
527@end defvar
528
529@defvar syntax-propertize-function
530This variable, if non-@code{nil}, should store a function for applying
531@code{syntax-table} properties to a specified stretch of text. It is
532intended to be used by major modes to install a function which applies
533@code{syntax-table} properties in some mode-appropriate way.
534
535The function is called by @code{syntax-ppss} (@pxref{Position Parse}),
536and by Font Lock mode during syntactic fontification (@pxref{Syntactic
537Font Lock}). It is called with two arguments, @var{start} and
538@var{end}, which are the starting and ending positions of the text on
539which it should act. It is allowed to call @code{syntax-ppss} on any
540position before @var{end}. However, it should not call
541@code{syntax-ppss-flush-cache}; so, it is not allowed to call
542@code{syntax-ppss} on some position and later modify the buffer at an
543earlier position.
544@end defvar
545
546@defvar syntax-propertize-extend-region-functions
547This abnormal hook is run by the syntax parsing code prior to calling
548@code{syntax-propertize-function}. Its role is to help locate safe
549starting and ending buffer positions for passing to
550@code{syntax-propertize-function}. For example, a major mode can add
551a function to this hook to identify multi-line syntactic constructs,
552and ensure that the boundaries do not fall in the middle of one.
553
554Each function in this hook should accept two arguments, @var{start}
555and @var{end}. It should return either a cons cell of two adjusted
556buffer positions, @code{(@var{new-start} . @var{new-end})}, or
557@code{nil} if no adjustment is necessary. The hook functions are run
558in turn, repeatedly, until they all return @code{nil}.
564@end defvar 559@end defvar
565 560
566@node Motion and Syntax 561@node Motion and Syntax
@@ -611,8 +606,9 @@ following the terminology of Lisp, even though these functions can act
611on languages other than Lisp. Basically, a sexp is either a balanced 606on languages other than Lisp. Basically, a sexp is either a balanced
612parenthetical grouping, a string, or a ``symbol'' (i.e.@: a sequence 607parenthetical grouping, a string, or a ``symbol'' (i.e.@: a sequence
613of characters whose syntax is either word constituent or symbol 608of characters whose syntax is either word constituent or symbol
614constituent). However, characters whose syntax is expression prefix 609constituent). However, characters in the expression prefix syntax
615are treated as part of the sexp if they appear next to it. 610class (@pxref{Syntax Class Table}) are treated as part of the sexp if
611they appear next to it.
616 612
617 The syntax table controls the interpretation of characters, so these 613 The syntax table controls the interpretation of characters, so these
618functions can be used for Lisp expressions when in Lisp mode and for C 614functions can be used for Lisp expressions when in Lisp mode and for C
@@ -654,11 +650,13 @@ This function scans forward @var{count} balanced parenthetical groupings
654from position @var{from}. It returns the position where the scan stops. 650from position @var{from}. It returns the position where the scan stops.
655If @var{count} is negative, the scan moves backwards. 651If @var{count} is negative, the scan moves backwards.
656 652
657If @var{depth} is nonzero, parenthesis depth counting begins from that 653If @var{depth} is nonzero, assume that the starting point is already
658value. The only candidates for stopping are places where the depth in 654@var{depth} parentheses deep. This function counts out @var{count}
659parentheses becomes zero; @code{scan-lists} counts @var{count} such 655number of points where the parenthesis depth goes back to zero, then
660places and then stops. Thus, a positive value for @var{depth} means go 656stops. Thus, a positive value for @var{depth} has the effect of
661out @var{depth} levels of parenthesis. 657moving out @var{depth} levels of parenthesis, whereas a negative
658@var{depth} has the effect of moving deeper by @var{-depth} levels of
659parenthesis.
662 660
663Scanning ignores comments if @code{parse-sexp-ignore-comments} is 661Scanning ignores comments if @code{parse-sexp-ignore-comments} is
664non-@code{nil}. 662non-@code{nil}.
@@ -699,12 +697,12 @@ expected, with nothing except whitespace between them, it returns
699This function cannot tell whether the ``comments'' it traverses are 697This function cannot tell whether the ``comments'' it traverses are
700embedded within a string. If they look like comments, it treats them 698embedded within a string. If they look like comments, it treats them
701as comments. 699as comments.
702@end defun
703 700
704To move forward over all comments and whitespace following point, use 701To move forward over all comments and whitespace following point, use
705@code{(forward-comment (buffer-size))}. @code{(buffer-size)} is a good 702@code{(forward-comment (buffer-size))}. @code{(buffer-size)} is a
706argument to use, because the number of comments in the buffer cannot 703good argument to use, because the number of comments in the buffer
707exceed that many. 704cannot exceed that many.
705@end defun
708 706
709@node Position Parse 707@node Position Parse
710@subsection Finding the Parse State for a Position 708@subsection Finding the Parse State for a Position
@@ -714,22 +712,34 @@ thing is to compute the syntactic state corresponding to a given buffer
714position. This function does that conveniently. 712position. This function does that conveniently.
715 713
716@defun syntax-ppss &optional pos 714@defun syntax-ppss &optional pos
717This function returns the parser state (see next section) that the 715This function returns the parser state that the parser would reach at
718parser would reach at position @var{pos} starting from the beginning 716position @var{pos} starting from the beginning of the buffer.
719of the buffer. This is equivalent to @code{(parse-partial-sexp 717@iftex
720(point-min) @var{pos})}, except that @code{syntax-ppss} uses a cache 718See the next section for
721to speed up the computation. Due to this optimization, the 2nd value 719@end iftex
722(previous complete subexpression) and 6th value (minimum parenthesis 720@ifnottex
723depth) of the returned parser state are not meaningful. 721@xref{Parser State},
724@end defun 722@end ifnottex
725 723for a description of the parser state.
726 @code{syntax-ppss} automatically hooks itself to 724
727@code{before-change-functions} to keep its cache consistent. But 725The return value is the same as if you call the low-level parsing
728updating can fail if @code{syntax-ppss} is called while 726function @code{parse-partial-sexp} to parse from the beginning of the
727buffer to @var{pos} (@pxref{Low-Level Parsing}). However,
728@code{syntax-ppss} uses a cache to speed up the computation. Due to
729this optimization, the second value (previous complete subexpression)
730and sixth value (minimum parenthesis depth) in the returned parser
731state are not meaningful.
732
733This function has a side effect: it adds a buffer-local entry to
734@code{before-change-functions} (@pxref{Change Hooks}) for
735@code{syntax-ppss-flush-cache} (see below). This entry keeps the
736cache consistent as the buffer is modified. However, the cache might
737not be updated if @code{syntax-ppss} is called while
729@code{before-change-functions} is temporarily let-bound, or if the 738@code{before-change-functions} is temporarily let-bound, or if the
730buffer is modified without obeying the hook, such as when using 739buffer is modified without running the hook, such as when using
731@code{inhibit-modification-hooks}. For this reason, it is sometimes 740@code{inhibit-modification-hooks}. In those cases, it is necessary to
732necessary to flush the cache manually. 741call @code{syntax-ppss-flush-cache} explicitly.
742@end defun
733 743
734@defun syntax-ppss-flush-cache beg &rest ignored-args 744@defun syntax-ppss-flush-cache beg &rest ignored-args
735This function flushes the cache used by @code{syntax-ppss}, starting 745This function flushes the cache used by @code{syntax-ppss}, starting
@@ -754,18 +764,23 @@ optimize its computations, when the cache gives no help.
754@subsection Parser State 764@subsection Parser State
755@cindex parser state 765@cindex parser state
756 766
757 A @dfn{parser state} is a list of ten elements describing the final 767 A @dfn{parser state} is a list of ten elements describing the state
758state of parsing text syntactically as part of an expression. The 768of the syntactic parser, after it parses the text between a specified
759parsing functions in the following sections return a parser state as 769starting point and a specified end point in the buffer. Parsing
760the value, and in some cases accept one as an argument also, so that 770functions such as @code{syntax-ppss}
761you can resume parsing after it stops. Here are the meanings of the 771@ifnottex
762elements of the parser state: 772(@pxref{Position Parse})
773@end ifnottex
774return a parser state as the value. Some parsing functions accept a
775parser state as an argument, for resuming parsing.
776
777 Here are the meanings of the elements of the parser state:
763 778
764@enumerate 0 779@enumerate 0
765@item 780@item
766The depth in parentheses, counting from 0. @strong{Warning:} this can 781The depth in parentheses, counting from 0. @strong{Warning:} this can
767be negative if there are more close parens than open parens between 782be negative if there are more close parens than open parens between
768the start of the defun and point. 783the parser's starting point and end point.
769 784
770@item 785@item
771@cindex innermost containing parentheses 786@cindex innermost containing parentheses
@@ -785,22 +800,22 @@ string delimiter character should terminate it.
785 800
786@item 801@item
787@cindex inside comment 802@cindex inside comment
788@code{t} if inside a comment (of either style), 803@code{t} if inside a non-nestable comment (of any comment style;
789or the comment nesting level if inside a kind of comment 804@pxref{Syntax Flags}); or the comment nesting level if inside a
790that can be nested. 805comment that can be nested.
791 806
792@item 807@item
793@cindex quote character 808@cindex quote character
794@code{t} if point is just after a quote character. 809@code{t} if the end point is just after a quote character.
795 810
796@item 811@item
797The minimum parenthesis depth encountered during this scan. 812The minimum parenthesis depth encountered during this scan.
798 813
799@item 814@item
800What kind of comment is active: @code{nil} for a comment of style 815What kind of comment is active: @code{nil} if not in a comment or in a
801``a'' or when not inside a comment, @code{t} for a comment of style 816comment of style @samp{a}; 1 for a comment of style @samp{b}; 2 for a
802``b,'' and @code{syntax-table} for a comment that should be ended by a 817comment of style @samp{c}; and @code{syntax-table} for a comment that
803generic comment delimiter character. 818should be ended by a generic comment delimiter character.
804 819
805@item 820@item
806The string or comment start position. While inside a comment, this is 821The string or comment start position. While inside a comment, this is
@@ -816,8 +831,8 @@ as the @var{state} argument to another call.
816 831
817 Elements 1, 2, and 6 are ignored in a state which you pass as an 832 Elements 1, 2, and 6 are ignored in a state which you pass as an
818argument to continue parsing, and elements 8 and 9 are used only in 833argument to continue parsing, and elements 8 and 9 are used only in
819trivial cases. Those elements serve primarily to convey information 834trivial cases. Those elements are mainly used internally by the
820to the Lisp program which does the parsing. 835parser code.
821 836
822 One additional piece of useful information is available from a 837 One additional piece of useful information is available from a
823parser state using this function: 838parser state using this function:
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index ab3a4edc0ac..94e71c96d0a 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -303,7 +303,7 @@ If a variable is void, trying to evaluate the variable signals a
303 303
304 Under lexical binding rules, the value cell only holds the 304 Under lexical binding rules, the value cell only holds the
305variable's global value, i.e.@: the value outside of any lexical 305variable's global value, i.e.@: the value outside of any lexical
306binding contruct. When a variable is lexically bound, the local value 306binding construct. When a variable is lexically bound, the local value
307is determined by the lexical environment; the variable may have a 307is determined by the lexical environment; the variable may have a
308local value if its symbol's value cell is unassigned. 308local value if its symbol's value cell is unassigned.
309 309
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index cc96726745f..e8ef4f07683 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -675,6 +675,7 @@ Completion
675 shell commands. 675 shell commands.
676* Completion Styles:: Specifying rules for performing completion. 676* Completion Styles:: Specifying rules for performing completion.
677* Programmed Completion:: Writing your own completion-function. 677* Programmed Completion:: Writing your own completion-function.
678* Completion in Buffers:: Completing text in ordinary buffers.
678 679
679Command Loop 680Command Loop
680 681
@@ -784,6 +785,7 @@ Major and Minor Modes
784* Mode Line Format:: Customizing the text that appears in the mode line. 785* Mode Line Format:: Customizing the text that appears in the mode line.
785* Imenu:: Providing a menu of definitions made in a buffer. 786* Imenu:: Providing a menu of definitions made in a buffer.
786* Font Lock Mode:: How modes can highlight text according to syntax. 787* Font Lock Mode:: How modes can highlight text according to syntax.
788* Auto-Indentation:: How to teach Emacs to indent for a major mode.
787* Desktop Save Mode:: How modes can have buffer state saved between 789* Desktop Save Mode:: How modes can have buffer state saved between
788 Emacs sessions. 790 Emacs sessions.
789 791
@@ -834,8 +836,6 @@ Font Lock Mode
834 contents can also specify how to fontify it. 836 contents can also specify how to fontify it.
835* Faces for Font Lock:: Special faces specifically for Font Lock. 837* Faces for Font Lock:: Special faces specifically for Font Lock.
836* Syntactic Font Lock:: Fontification based on syntax tables. 838* Syntactic Font Lock:: Fontification based on syntax tables.
837* Setting Syntax Properties:: Defining character syntax based on context
838 using the Font Lock mechanism.
839* Multiline Font Lock:: How to coerce Font Lock into properly 839* Multiline Font Lock:: How to coerce Font Lock into properly
840 highlighting multiline constructs. 840 highlighting multiline constructs.
841 841
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 33246cb567d..b271deec8b6 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -674,6 +674,7 @@ Completion
674 shell commands. 674 shell commands.
675* Completion Styles:: Specifying rules for performing completion. 675* Completion Styles:: Specifying rules for performing completion.
676* Programmed Completion:: Writing your own completion-function. 676* Programmed Completion:: Writing your own completion-function.
677* Completion in Buffers:: Completing text in ordinary buffers.
677 678
678Command Loop 679Command Loop
679 680
@@ -783,6 +784,7 @@ Major and Minor Modes
783* Mode Line Format:: Customizing the text that appears in the mode line. 784* Mode Line Format:: Customizing the text that appears in the mode line.
784* Imenu:: Providing a menu of definitions made in a buffer. 785* Imenu:: Providing a menu of definitions made in a buffer.
785* Font Lock Mode:: How modes can highlight text according to syntax. 786* Font Lock Mode:: How modes can highlight text according to syntax.
787* Auto-Indentation:: How to teach Emacs to indent for a major mode.
786* Desktop Save Mode:: How modes can have buffer state saved between 788* Desktop Save Mode:: How modes can have buffer state saved between
787 Emacs sessions. 789 Emacs sessions.
788 790
@@ -833,8 +835,6 @@ Font Lock Mode
833 contents can also specify how to fontify it. 835 contents can also specify how to fontify it.
834* Faces for Font Lock:: Special faces specifically for Font Lock. 836* Faces for Font Lock:: Special faces specifically for Font Lock.
835* Syntactic Font Lock:: Fontification based on syntax tables. 837* Syntactic Font Lock:: Fontification based on syntax tables.
836* Setting Syntax Properties:: Defining character syntax based on context
837 using the Font Lock mechanism.
838* Multiline Font Lock:: How to coerce Font Lock into properly 838* Multiline Font Lock:: How to coerce Font Lock into properly
839 highlighting multiline constructs. 839 highlighting multiline constructs.
840 840
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index adad93ef89c..a88ac5f0bd4 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12012-02-15 Glenn Morris <rgm@gnu.org>
2
3 * smtpmail.texi (Emacs Speaks SMTP): General update for 24.1.
4 (Encryption): New chapter, split out from previous.
5
12012-02-13 Lars Ingebrigtsen <larsi@gnus.org> 62012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2 7
3 * gnus.texi (Customizing the IMAP Connection): Mention 8 * gnus.texi (Customizing the IMAP Connection): Mention
diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi
index af09783f445..4e4df3f0bbb 100644
--- a/doc/misc/smtpmail.texi
+++ b/doc/misc/smtpmail.texi
@@ -47,6 +47,7 @@ developing GNU and promoting software freedom.''
47* How Mail Works:: Brief introduction to mail concepts. 47* How Mail Works:: Brief introduction to mail concepts.
48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs. 48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs.
49* Authentication:: Authenticating yourself to the server. 49* Authentication:: Authenticating yourself to the server.
50* Encryption:: Protecting your connection to the server.
50* Queued delivery:: Sending mail without an internet connection. 51* Queued delivery:: Sending mail without an internet connection.
51* Server workarounds:: Mail servers with special requirements. 52* Server workarounds:: Mail servers with special requirements.
52* Debugging:: Tracking down problems. 53* Debugging:: Tracking down problems.
@@ -129,24 +130,37 @@ be useful if you don't have a MTA set up on your host, or if your
129machine is often disconnected from the internet. 130machine is often disconnected from the internet.
130 131
131 Sending mail via SMTP requires configuring your mail user agent 132 Sending mail via SMTP requires configuring your mail user agent
132(@pxref{Mail Methods,,,emacs}) to use the SMTP library. How to do 133(@pxref{Mail Methods,,,emacs}) to use the SMTP library. If you
133this should be described for each mail user agent; for the default 134have not configured anything, then in Emacs 24.1 and later the first
134mail user agent the variable @code{send-mail-function} (@pxref{Mail 135time you try to send a mail Emacs will ask how you want to send
135Sending,,,emacs}) is used; for the Message and Gnus user agents the 136mail. To use this library, answer @samp{smtp} when prompted. Emacs
136variable @code{message-send-mail-function} (@pxref{Mail 137then asks for the name of the SMTP server.
137Variables,,,message}) is used. 138
138 139 If you prefer, or if you are using a non-standard mail user agent,
139@example 140you can configure this yourself. The normal way to do this is to set
140;; If you use the default mail user agent. 141the variable @code{send-mail-function} (@pxref{Mail
142Sending,,,emacs}) to the value you want to use. To use this library:
143
144@smallexample
141(setq send-mail-function 'smtpmail-send-it) 145(setq send-mail-function 'smtpmail-send-it)
142;; If you use Message or Gnus. 146@end smallexample
143(setq message-send-mail-function 'smtpmail-send-it) 147
144@end example 148@noindent
149The default value for this variable is @code{sendmail-query-once},
150which interactively asks how you want to send mail.
151
152Your mail user agent might use a different variable for this purpose.
153It should inherit from @code{send-mail-function}, but if it does not,
154or if you prefer, you can set that variable directly. Consult your
155mail user agent's documentation for more details. For example,
156(@pxref{Mail Variables,,,message}).
145 157
146 Before using SMTP you must find out the hostname of the SMTP server 158 Before using SMTP you must find out the hostname of the SMTP server
147to use. Your system administrator should provide you with this 159to use. Your system administrator or mail service provider should
148information, but often it is the same as the server you receive mail 160supply this information. Often it is some variant of the server you
149from. 161receive mail from. If your email address is
162@samp{yourname@@example.com}, then the name of the SMTP server is
163may be something like @samp{smtp.example.com}.
150 164
151@table @code 165@table @code
152@item smtpmail-smtp-server 166@item smtpmail-smtp-server
@@ -201,101 +215,114 @@ The following example illustrates what you could put in
201@node Authentication 215@node Authentication
202@chapter Authentication 216@chapter Authentication
203 217
218@cindex password
219@cindex user name
220Most SMTP servers require clients to authenticate themselves before
221they are allowed to send mail. Authentication usually involves
222supplying a user name and password.
223
224If you have not configured anything, then the first time you try to
225send mail via a server, Emacs (version 24.1 and later) prompts you
226for the user name and password to use, and then offers to save the
227information. By default, Emacs stores authentication information in
228a file @file{~/.authinfo}.
229
230@cindex authinfo
231The basic format of the @file{~/.authinfo} file is one line for each
232set of credentials. Each line consists of pairs of variables and
233values. A simple example would be:
234
235@smallexample
236machine mail.example.org port 25 login myuser password mypassword
237@end smallexample
238
239@noindent
240This specifies that when using the SMTP server called @samp{mail.example.org}
241on port 25, Emacs should send the user name @samp{myuser} and the
242password @samp{mypassword}. Either or both of the login and password
243fields may be absent, in which case Emacs prompts for the information
244when you try to send mail. (This replaces the old
245@code{smtpmail-auth-credentials} variable used prior to Emacs 24.1.)
246
247@vindex smtpmail-smtp-user
248 When the SMTP library connects to a host on a certain port, it
249searches the @file{~/.authinfo} file for a matching entry. If an
250entry is found, the authentication process is invoked and the
251credentials are used. If the variable @code{smtpmail-smtp-user} is
252set to a non-@code{nil} value, then only entries for that user are
253considered. For more information on the @file{~/.authinfo}
254file, @pxref{Top,,auth-source, auth, Emacs auth-source Library}.
255
204@cindex SASL 256@cindex SASL
205@cindex CRAM-MD5 257@cindex CRAM-MD5
258@cindex PLAIN
206@cindex LOGIN 259@cindex LOGIN
260The process by which the SMTP library authenticates you to the server
261is known as ``Simple Authentication and Security Layer'' (SASL).
262There are various SASL mechanisms, and this library supports three of
263them: CRAM-MD5, PLAIN, and LOGIN. It tries each of them, in that order,
264until one succeeds. The first uses a form of encryption to obscure
265your password, while the other two do not.
266
267
268@node Encryption
269@chapter Encryption
270
207@cindex STARTTLS 271@cindex STARTTLS
208@cindex TLS 272@cindex TLS
209@cindex SSL 273@cindex SSL
210Many environments require SMTP clients to authenticate themselves 274For greater security, you can encrypt your connection to the SMTP
211before they are allowed to route mail via a server. The two following 275server. If this is to work, both Emacs and the server must support it.
212variables contains the authentication information needed for this. 276
213 277The SMTP library supports the ``Transport Layer Security'' (TLS), and
214The first variable, @code{smtpmail-auth-credentials}, instructs the 278the older ``Secure Sockets Layer'' (SSL) encryption mechanisms.
215SMTP library to use a SASL authentication step, currently only the 279It also supports STARTTLS, which is a variant of TLS in which the
216CRAM-MD5 and LOGIN mechanisms are supported and will be selected in 280initial connection to the server is made in plain text, requesting a
217that order if the server support both. 281switch to an encrypted channel for the rest of the process.
218 282
219The second variable, @code{smtpmail-starttls-credentials}, instructs 283@vindex smtpmail-stream-type
220the SMTP library to connect to the server using STARTTLS. This means 284The variable @code{smtpmail-stream-type} controls what form of
221the protocol exchange may be integrity protected and confidential by 285connection the SMTP library uses. The default value is @code{nil},
222using the Transport Layer Security (TLS) protocol, and optionally also 286which means to use a plain connection, but try to switch to a STARTTLS
223authentication of the client and server. 287encrypted connection if the server supports it. Other possible values
224 288are: @code{starttls} - insist on STARTTLS; @code{ssl} - use TLS/SSL;
225TLS is a security protocol that is also known as SSL, although 289and @code{plain} - no encryption.
226strictly speaking, SSL is an older variant of TLS. TLS is backwards 290
227compatible with SSL. In most mundane situations, the two terms are 291Use of any form of TLS/SSL requires support in Emacs. You can either
228equivalent. 292use the built-in support (in Emacs 24.1 and later), or the
229 293@file{starttls.el} Lisp library. The built-in support uses the GnuTLS
230The TLS feature uses the elisp package @file{starttls.el} (see it for 294@footnote{@url{http://www.gnu.org/software/gnutls/}} library.
231more information on customization), which in turn require that at 295If your Emacs has GnuTLS support built-in, the function
232least one of the following external tools are installed: 296@code{gnutls-available-p} is defined and returns non-@code{nil}.
297Otherwise, you must use the @file{starttls.el} library (see that file for
298more information on customization options, etc.). The Lisp library
299requires one of the following external tools to be installed:
233 300
234@enumerate 301@enumerate
235@item 302@item
236The GnuTLS command line tool @samp{gnutls-cli}, you can get it from 303The GnuTLS command line tool @samp{gnutls-cli}, which you can get from
237@url{http://www.gnu.org/software/gnutls/}. This is the recommended 304@url{http://www.gnu.org/software/gnutls/}. This is the recommended
238tool, mainly because it can verify the server certificates. 305tool, mainly because it can verify server certificates.
239 306
240@item 307@item
241The @samp{starttls} external program, you can get it from 308The @samp{starttls} external program, which you can get from
242@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}. 309@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}.
243@end enumerate 310@end enumerate
244 311
245It is not uncommon to use both these mechanisms, e.g., to use STARTTLS 312@cindex certificates
246to achieve integrity and confidentiality and then use SASL for client 313@cindex keys
247authentication. 314The SMTP server may also request that you verify your identity by
315sending a certificate and the associated encryption key to the server.
316If you need to do this, you can use an @file{~/.authinfo} entry like this:
248 317
249@table @code 318@smallexample
250@item smtpmail-auth-credentials 319machine mail.example.org port 25 key "~/.my_smtp_tls.key" cert "~/.my_smtp_tls.cert"
251@vindex smtpmail-auth-credentials 320@end smallexample
252 The variable @code{smtpmail-auth-credentials} contains a list of
253hostname, port, username and password tuples. When the SMTP library
254connects to a host on a certain port, this variable is searched to
255find a matching entry for that hostname and port. If an entry is
256found, the authentication process is invoked and the credentials are
257used.
258
259The hostname field follows the same format as
260@code{smtpmail-smtp-server} (i.e., a string) and the port field the
261same format as @code{smtpmail-smtp-service} (i.e., a string or an
262integer). The username and password fields, which either can be
263@code{nil} to indicate that the user is prompted for the value
264interactively, should be strings with the username and password,
265respectively, information that is normally provided by system
266administrators.
267
268@item smtpmail-starttls-credentials
269@vindex smtpmail-starttls-credentials
270 The variable @code{smtpmail-starttls-credentials} contains a list of
271tuples with hostname, port, name of file containing client key, and
272name of file containing client certificate. The processing is similar
273to the previous variable. The client key and certificate may be
274@code{nil} if you do not wish to use client authentication.
275@end table
276 321
277The following example illustrates what you could put in 322@noindent
278@file{~/.emacs} to enable both SASL authentication and STARTTLS. The 323(This replaces the old @code{smtpmail-starttls-credentials} variable used
279server name (@code{smtpmail-smtp-server}) is @var{hostname}, the 324prior to Emacs 24.1.)
280server port (@code{smtpmail-smtp-service}) is @var{port}, and the
281username and password are @var{username} and @var{password}
282respectively.
283 325
284@example
285;; Authenticate using this username and password against my server.
286(setq smtpmail-auth-credentials
287 '(("@var{hostname}" "@var{port}" "@var{username}" "@var{password}")))
288
289;; Note that if @var{port} is an integer, you must not quote it as a
290;; string. Normally @var{port} should be the integer 25, and the example
291;; become:
292(setq smtpmail-auth-credentials
293 '(("@var{hostname}" 25 "@var{username}" "@var{password}")))
294
295;; Use STARTTLS without authentication against the server.
296(setq smtpmail-starttls-credentials
297 '(("@var{hostname}" "@var{port}" nil nil)))
298@end example
299 326
300@node Queued delivery 327@node Queued delivery
301@chapter Queued delivery 328@chapter Queued delivery
diff --git a/etc/NEWS b/etc/NEWS
index 262379cc918..72b0f5b5ecf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -141,22 +141,22 @@ For example, this is used by Rmail to optionally delete a mail window.
141 141
142*** smtpmail 142*** smtpmail
143 143
144**** smtpmail now uses encrypted connections (via STARTTLS) if the 144+++
145mail server supports them. It also uses the auth-source framework for 145**** smtpmail now uses encrypted connections (via STARTTLS) by default
146getting credentials. 146if the mail server supports them. This uses either built-in GnuTLS
147support, or the starttls.el library. Customize `smtpmail-stream-type'
148to change this.
147 149
150+++
148**** The variable `smtpmail-auth-credentials' has been removed. 151**** The variable `smtpmail-auth-credentials' has been removed.
149That variable used to have the default value "~/.authinfo", in which 152By default, the information is now stored in the file ~/.authinfo.
150case you won't see any difference. But if you changed it to be a list 153This was the default value of smtpmail-auth-credentials.
151of user names and passwords, that setting is now ignored; you will be 154If you had customized smtpmail-auth-credentials to a list of user
152prompted for the user name and the password, which will then be saved 155names and passwords, those settings will not be used. Your first
153to ~/.authinfo. (To control where and how the credentials are stored, 156connection to the smtp server will prompt for the user name and password,
154see the auth-source manual. You may want to change the auth-source 157and then offer to save them to the ~/.authinfo file. Or you can
155preferences if you want to store the credentials encrypted, for 158manually copy the credentials to your ~/.authinfo files. For example,
156instance.) 159if you had
157
158You can also manually copy the credentials to your ~/.authinfo file.
159For example, if you had
160 160
161 (setq smtpmail-auth-credentials 161 (setq smtpmail-auth-credentials
162 '(("mail.example.org" 25 "jim" "s!cret"))) 162 '(("mail.example.org" 25 "jim" "s!cret")))
@@ -165,6 +165,10 @@ then the equivalent line in ~/.authinfo would be
165 165
166 machine mail.example.org port 25 login jim password s!cret 166 machine mail.example.org port 25 login jim password s!cret
167 167
168See the auth-source manual for more information, e.g. on encrypting
169the credentials file.
170
171+++
168**** The variable `smtpmail-starttls-credentials' has been removed. 172**** The variable `smtpmail-starttls-credentials' has been removed.
169 173
170If you had that set, then you need to put 174If you had that set, then you need to put
@@ -1107,7 +1111,10 @@ font-lock-defaults-alist (font-lock-defaults), and e (float-e).
1107** The following obsolete files were removed: 1111** The following obsolete files were removed:
1108sc.el, x-menu.el, rnews.el, rnewspost.el 1112sc.el, x-menu.el, rnews.el, rnewspost.el
1109 1113
1110** FIXME finder-inf.el changes. 1114---
1115** The format of the finder-inf.el file has changed, since the finder
1116mechanism is now based on the package concept. The variable
1117finder-package-info is replaced by package--builtins and finder-keywords-hash.
1111 1118
1112 1119
1113* Lisp changes in Emacs 24.1 1120* Lisp changes in Emacs 24.1
@@ -1282,6 +1289,7 @@ behavior of `completing-read'.
1282** `glyphless-char-display' can now distinguish between graphical and 1289** `glyphless-char-display' can now distinguish between graphical and
1283text terminal display, via a char-table entry that is a cons cell. 1290text terminal display, via a char-table entry that is a cons cell.
1284 1291
1292+++
1285** `open-network-stream' can now be used to open an encrypted stream. 1293** `open-network-stream' can now be used to open an encrypted stream.
1286It now accepts an optional `:type' parameter for initiating a TLS 1294It now accepts an optional `:type' parameter for initiating a TLS
1287connection, directly or via STARTTLS. To do STARTTLS, additional 1295connection, directly or via STARTTLS. To do STARTTLS, additional
@@ -1341,6 +1349,7 @@ The variable is now used to load all kind of supported dynamic libraries,
1341not just image libraries. The previous name is still available as an 1349not just image libraries. The previous name is still available as an
1342obsolete alias. 1350obsolete alias.
1343 1351
1352+++
1344** New variable `syntax-propertize-function'. 1353** New variable `syntax-propertize-function'.
1345This replaces `font-lock-syntactic-keywords' which is now obsolete. 1354This replaces `font-lock-syntactic-keywords' which is now obsolete.
1346This allows syntax-table properties to be set independently from font-lock: 1355This allows syntax-table properties to be set independently from font-lock:
@@ -1423,7 +1432,8 @@ The old name is an obsolete alias to the new one.
1423+++ 1432+++
1424*** Image mode can view any image type that ImageMagick supports. 1433*** Image mode can view any image type that ImageMagick supports.
1425This requires Emacs to be built with ImageMagick support. 1434This requires Emacs to be built with ImageMagick support.
1426Then the function `imagemagick-types' returns a list of image file 1435If your Emacs has ImageMagick support, then the function
1436`imagemagick-types' is defined, and returns a list of image file
1427extensions that your installation of ImageMagick supports. The 1437extensions that your installation of ImageMagick supports. The
1428function `imagemagick-register-types' enables ImageMagick support for 1438function `imagemagick-register-types' enables ImageMagick support for
1429these image types, minus those listed in `imagemagick-types-inhibit'. 1439these image types, minus those listed in `imagemagick-types-inhibit'.
@@ -1447,11 +1457,12 @@ FIXME: These should be front-ended by xml.el.
1447 1457
1448*** New library `gnutls.el'. 1458*** New library `gnutls.el'.
1449This requires Emacs to have been built with GnuTLS support. 1459This requires Emacs to have been built with GnuTLS support.
1450The main functions are `open-gnutls-stream' and `gnutls-negotiate'. 1460If your Emacs has GnuTLS support, the function gnutls-available-p is
1451It's easiest to use these functions through `open-network-stream' 1461defined and returns non-nil. The main functions are `open-gnutls-stream'
1452because it can upgrade connections through STARTTLS opportunistically 1462and `gnutls-negotiate'. It's easiest to use these functions through
1453or use plain SSL, depending on your needs. For debugging, set 1463`open-network-stream' because it can upgrade connections through
1454`gnutls-log-level' greater than 0. 1464STARTTLS opportunistically or use plain SSL, depending on your needs.
1465For debugging, set `gnutls-log-level' greater than 0.
1455 1466
1456** Isearch 1467** Isearch
1457 1468
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f7ecfb529f2..e2e45bf1535 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,31 @@
12012-02-16 Kenichi Handa <handa@m17n.org> 12012-02-17 Kenichi Handa <handa@m17n.org>
2 2
3 * international/charprop.el: 3 * international/charprop.el:
4 * international/uni-name.el: 4 * international/uni-name.el:
5 * international/uni-old-name.el: 5 * international/uni-old-name.el:
6 * international/uni-comment.el: Regenerate. 6 * international/uni-comment.el: Regenerate.
7 7
82012-02-16 Glenn Morris <rgm@gnu.org>
9
10 * calendar/cal-hebrew.el (calendar-hebrew-list-yahrzeits):
11 Interactively in calendar buffer, give an error if not on a date.
12
132012-02-15 Glenn Morris <rgm@gnu.org>
14
15 * shell.el (shell-delimiter-argument-list):
16 Revert 2011-02-17 change. (Bug#8027)
17
182012-02-15 Chong Yidong <cyd@gnu.org>
19
20 * minibuffer.el (completion-at-point-functions): Doc fix.
21
22 * custom.el (defcustom): Doc fix; note use of defvar.
23
242012-02-15 Glenn Morris <rgm@gnu.org>
25
26 * mail/smtpmail.el (smtpmail-smtp-user, smtpmail-stream-type):
27 Doc fixes.
28
82012-02-14 Glenn Morris <rgm@gnu.org> 292012-02-14 Glenn Morris <rgm@gnu.org>
9 30
10 * mail/smtpmail.el (smtpmail-query-smtp-server): Give it a doc. 31 * mail/smtpmail.el (smtpmail-query-smtp-server): Give it a doc.
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index cb738675cc4..9db77d7bd87 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -731,7 +731,7 @@ from the cursor position."
731 (interactive 731 (interactive
732 (let* ((death-date 732 (let* ((death-date
733 (if (equal (current-buffer) (get-buffer calendar-buffer)) 733 (if (equal (current-buffer) (get-buffer calendar-buffer))
734 (calendar-cursor-to-date) 734 (calendar-cursor-to-date t)
735 (let* ((today (calendar-current-date)) 735 (let* ((today (calendar-current-date))
736 (year (calendar-read 736 (year (calendar-read
737 "Year of death (>0): " 737 "Year of death (>0): "
diff --git a/lisp/custom.el b/lisp/custom.el
index 2d880d23955..810b78144a4 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -208,7 +208,11 @@ is unbound. The expression itself is also stored, so that
208Customize can re-evaluate it later to get the standard value. 208Customize can re-evaluate it later to get the standard value.
209DOC is the variable documentation. 209DOC is the variable documentation.
210 210
211The remaining arguments should have the form 211This macro uses `defvar' as a subroutine, which also marks the
212variable as \"special\", so that it is always dynamically bound
213even when `lexical-binding' is t.
214
215The remaining arguments to `defcustom' should have the form
212 216
213 [KEYWORD VALUE]... 217 [KEYWORD VALUE]...
214 218
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 99554cd9ffe..61f6ff9a3d3 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,17 @@
12012-02-16 Leo Liu <sdl.web@gmail.com>
2
3 * gnus-start.el (gnus-1): Avoid duplicate entries.
4
52012-02-15 Lars Ingebrigtsen <larsi@gnus.org>
6
7 * shr.el (shr-remove-trailing-whitespace): Really delete the padding on
8 too-wide lines.
9
102012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11
12 * shr.el (shr-rescale-image): Undo previous change; see
13 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14
12012-02-13 Lars Ingebrigtsen <larsi@gnus.org> 152012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2 16
3 * nnimap.el (nnimap-record-commands): New variable. 17 * nnimap.el (nnimap-record-commands): New variable.
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 9b1d5681e6c..bb7dd76d590 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -763,8 +763,8 @@ prompt the user for the name of an NNTP server to use."
763 ;; Add "native" to gnus-predefined-server-alist just to have a 763 ;; Add "native" to gnus-predefined-server-alist just to have a
764 ;; name for the native select method. 764 ;; name for the native select method.
765 (when gnus-select-method 765 (when gnus-select-method
766 (push (cons "native" gnus-select-method) 766 (add-to-list 'gnus-predefined-server-alist
767 gnus-predefined-server-alist)) 767 (cons "native" gnus-select-method)))
768 768
769 (if gnus-agent 769 (if gnus-agent
770 (gnus-agentize)) 770 (gnus-agentize))
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 47622f5183d..f3d75032926 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -160,7 +160,7 @@ DOM should be a parse tree as generated by
160 (goto-char start) 160 (goto-char start)
161 (while (not (eobp)) 161 (while (not (eobp))
162 (end-of-line) 162 (end-of-line)
163 (when (> (current-column) width) 163 (when (> (shr-previous-newline-padding-width (current-column)) width)
164 (dolist (overlay (overlays-at (point))) 164 (dolist (overlay (overlays-at (point)))
165 (when (overlay-get overlay 'before-string) 165 (when (overlay-get overlay 'before-string)
166 (overlay-put overlay 'before-string nil)))) 166 (overlay-put overlay 'before-string nil))))
@@ -557,8 +557,7 @@ the URL of the image to the kill buffer instead."
557 (insert alt))) 557 (insert alt)))
558 558
559(defun shr-rescale-image (data) 559(defun shr-rescale-image (data)
560 (let* ((max-image-size nil) 560 (let ((image (create-image data nil t :ascent 100)))
561 (image (create-image data nil t :ascent 100)))
562 (if (or (not (fboundp 'imagemagick-types)) 561 (if (or (not (fboundp 'imagemagick-types))
563 (not (get-buffer-window (current-buffer)))) 562 (not (get-buffer-window (current-buffer))))
564 image 563 image
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index bbd8d7ce1ef..3233cff2768 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -86,7 +86,8 @@ The default value would be \"smtp\" or 25."
86 :group 'smtpmail) 86 :group 'smtpmail)
87 87
88(defcustom smtpmail-smtp-user nil 88(defcustom smtpmail-smtp-user nil
89 "User name to use when looking up credentials." 89 "User name to use when looking up credentials in the authinfo file.
90If non-nil, only consider credentials for the specified user."
90 :version "24.1" 91 :version "24.1"
91 :type '(choice (const nil) string) 92 :type '(choice (const nil) string)
92 :group 'smtpmail) 93 :group 'smtpmail)
@@ -99,11 +100,10 @@ don't define this value."
99 :group 'smtpmail) 100 :group 'smtpmail)
100 101
101(defcustom smtpmail-stream-type nil 102(defcustom smtpmail-stream-type nil
102 "Connection type SMTP connections. 103 "Type of SMTP connections to use.
103This may be either nil (possibly upgraded to STARTTLS if 104This may be either nil (possibly upgraded to STARTTLS if possible),
104possible), or `starttls' (refuse to send if STARTTLS isn't 105or `starttls' (refuse to send if STARTTLS isn't available), or `plain'
105available), or `plain' (never use STARTTLS), or `ssl' (to use 106\(never use STARTTLS), or `ssl' (to use TLS/SSL)."
106TLS/SSL)."
107 :version "24.1" 107 :version "24.1"
108 :group 'smtpmail 108 :group 'smtpmail
109 :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil) 109 :type '(choice (const :tag "Possibly upgrade to STARTTLS" nil)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 611df1eb6d9..8564cc2009b 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1550,16 +1550,16 @@ the mode if ARG is omitted or nil."
1550Each function on this hook is called in turns without any argument and should 1550Each function on this hook is called in turns without any argument and should
1551return either nil to mean that it is not applicable at point, 1551return either nil to mean that it is not applicable at point,
1552or a function of no argument to perform completion (discouraged), 1552or a function of no argument to perform completion (discouraged),
1553or a list of the form (START END COLLECTION &rest PROPS) where 1553or a list of the form (START END COLLECTION . PROPS) where
1554 START and END delimit the entity to complete and should include point, 1554 START and END delimit the entity to complete and should include point,
1555 COLLECTION is the completion table to use to complete it, and 1555 COLLECTION is the completion table to use to complete it, and
1556 PROPS is a property list for additional information. 1556 PROPS is a property list for additional information.
1557Currently supported properties are all the properties that can appear in 1557Currently supported properties are all the properties that can appear in
1558`completion-extra-properties' plus: 1558`completion-extra-properties' plus:
1559 `:predicate' a predicate that completion candidates need to satisfy. 1559 `:predicate' a predicate that completion candidates need to satisfy.
1560 `:exclusive' If `no', means that if the completion data does not match the 1560 `:exclusive' If `no', means that if the completion table fails to
1561 text at point failure, then instead of reporting a completion failure, 1561 match the text at point, then instead of reporting a completion
1562 the completion should try the next completion function.") 1562 failure, the completion should try the next completion function.")
1563 1563
1564(defvar completion--capf-misbehave-funs nil 1564(defvar completion--capf-misbehave-funs nil
1565 "List of functions found on `completion-at-point-functions' that misbehave. 1565 "List of functions found on `completion-at-point-functions' that misbehave.
diff --git a/lisp/shell.el b/lisp/shell.el
index e7a8953ecbe..b4b388655c8 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -153,13 +153,14 @@ This is a fine thing to set in your `.emacs' file."
153 :type '(repeat (string :tag "Suffix")) 153 :type '(repeat (string :tag "Suffix"))
154 :group 'shell) 154 :group 'shell)
155 155
156(defcustom shell-delimiter-argument-list nil ; '(?\| ?& ?< ?> ?\( ?\) ?\;) 156(defcustom shell-delimiter-argument-list '(?\| ?& ?< ?> ?\( ?\) ?\;)
157 "List of characters to recognize as separate arguments. 157 "List of characters to recognize as separate arguments.
158This variable is used to initialize `comint-delimiter-argument-list' in the 158This variable is used to initialize `comint-delimiter-argument-list' in the
159shell buffer. The value may depend on the operating system or shell." 159shell buffer. The value may depend on the operating system or shell."
160 :type '(choice (const nil) 160 :type '(choice (const nil)
161 (repeat :tag "List of characters" character)) 161 (repeat :tag "List of characters" character))
162 :version "24.1" ; changed to nil (bug#8027) 162 ;; Reverted.
163;; :version "24.1" ; changed to nil (bug#8027)
163 :group 'shell) 164 :group 'shell)
164 165
165(defvar shell-file-name-chars 166(defvar shell-file-name-chars
diff --git a/src/ChangeLog b/src/ChangeLog
index 7893cd68396..12b4fa97c33 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2
3 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
5
62012-02-15 Chong Yidong <cyd@gnu.org>
7
8 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9 marked as special. Also, starting docstrings with * is obsolete.
10
12012-02-13 Andreas Schwab <schwab@linux-m68k.org> 112012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2 12
3 * gnutls.c (emacs_gnutls_write): Fix last change. 13 * gnutls.c (emacs_gnutls_write): Fix last change.
diff --git a/src/eval.c b/src/eval.c
index dbd06e7c1b1..344228741cb 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -780,17 +780,15 @@ The return value is BASE-VARIABLE. */)
780 780
781DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, 781DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0,
782 doc: /* Define SYMBOL as a variable, and return SYMBOL. 782 doc: /* Define SYMBOL as a variable, and return SYMBOL.
783You are not required to define a variable in order to use it, 783You are not required to define a variable in order to use it, but
784but the definition can supply documentation and an initial value 784defining it lets you supply an initial value and documentation, which
785in a way that tags can recognize. 785can be referred to by the Emacs help facilities and other programming
786 786tools. The `defvar' form also declares the variable as \"special\",
787INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void. 787so that it is always dynamically bound even if `lexical-binding' is t.
788If SYMBOL is buffer-local, its default value is what is set; 788
789 buffer-local values are not affected. 789The optional argument INITVALUE is evaluated, and used to set SYMBOL,
790INITVALUE and DOCSTRING are optional. 790only if SYMBOL's value is void. If SYMBOL is buffer-local, its
791If DOCSTRING starts with *, this variable is identified as a user option. 791default value is what is set; buffer-local values are not affected.
792 This means that M-x set-variable recognizes it.
793 See also `user-variable-p'.
794If INITVALUE is missing, SYMBOL's value is not set. 792If INITVALUE is missing, SYMBOL's value is not set.
795 793
796If SYMBOL has a local binding, then this form affects the local 794If SYMBOL has a local binding, then this form affects the local
@@ -799,6 +797,13 @@ load a file defining variables, with this form or with `defconst' or
799`defcustom', you should always load that file _outside_ any bindings 797`defcustom', you should always load that file _outside_ any bindings
800for these variables. \(`defconst' and `defcustom' behave similarly in 798for these variables. \(`defconst' and `defcustom' behave similarly in
801this respect.) 799this respect.)
800
801The optional argument DOCSTRING is a documentation string for the
802variable.
803
804To define a user option, use `defcustom' instead of `defvar'.
805The function `user-variable-p' also identifies a variable as a user
806option if its DOCSTRING starts with *, but this behavior is obsolete.
802usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) 807usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
803 (Lisp_Object args) 808 (Lisp_Object args)
804{ 809{
@@ -873,15 +878,19 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
873 878
874DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, 879DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0,
875 doc: /* Define SYMBOL as a constant variable. 880 doc: /* Define SYMBOL as a constant variable.
876The intent is that neither programs nor users should ever change this value. 881This declares that neither programs nor users should ever change the
877Always sets the value of SYMBOL to the result of evalling INITVALUE. 882value. This constancy is not actually enforced by Emacs Lisp, but
878If SYMBOL is buffer-local, its default value is what is set; 883SYMBOL is marked as a special variable so that it is never lexically
879 buffer-local values are not affected. 884bound.
880DOCSTRING is optional. 885
881 886The `defconst' form always sets the value of SYMBOL to the result of
882If SYMBOL has a local binding, then this form sets the local binding's 887evalling INITVALUE. If SYMBOL is buffer-local, its default value is
883value. However, you should normally not make local bindings for 888what is set; buffer-local values are not affected. If SYMBOL has a
884variables defined with this form. 889local binding, then this form sets the local binding's value.
890However, you should normally not make local bindings for variables
891defined with this form.
892
893The optional DOCSTRING specifies the variable's documentation string.
885usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) 894usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
886 (Lisp_Object args) 895 (Lisp_Object args)
887{ 896{
diff --git a/src/image.c b/src/image.c
index b2951dd70fb..73490fe2865 100644
--- a/src/image.c
+++ b/src/image.c
@@ -976,7 +976,7 @@ or omitted means use the selected frame. */)
976 976
977static void free_image (struct frame *f, struct image *img); 977static void free_image (struct frame *f, struct image *img);
978 978
979#define MAX_IMAGE_SIZE 6.0 979#define MAX_IMAGE_SIZE 10.0
980/* Allocate and return a new image structure for image specification 980/* Allocate and return a new image structure for image specification
981 SPEC. SPEC has a hash value of HASH. */ 981 SPEC. SPEC has a hash value of HASH. */
982 982