diff options
| author | Kenichi Handa | 2012-02-17 16:33:15 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-02-17 16:33:15 +0900 |
| commit | 48dd1e399f41aa349e8651d049cb4a707ffd0bb0 (patch) | |
| tree | 54a1d0b537b697ca2cb0bb420d125eafbbbb534c | |
| parent | c406be4337317c4ff4e60dc74a10921bd1102cac (diff) | |
| parent | bcc657043df41514ec80c3e172c6872b88221005 (diff) | |
| download | emacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.tar.gz emacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.zip | |
merge trunk
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) | |||
| 7 | are correct. You can use something like the following in the info | 7 | are correct. You can use something like the following in the info |
| 8 | directory in the Emacs build tree: | 8 | directory in the Emacs build tree: |
| 9 | 9 | ||
| 10 | emacs -Q --eval "(setq Info-default-directory-list '(\".\"))" \ | 10 | emacs -Q --eval "(progn (require 'info) (setq Info-directory-list '(\".\")))" \ |
| 11 | -f info-xref-check-all | 11 | -f info-xref-check-all |
| 12 | 12 | ||
| 13 | make emacs.dvi, elisp.dvi, and deal with any errors (undefined | 13 | make 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 | ||
| 65 | be part of Gnus. They should be moved to some other part of Emacs. | ||
| 66 | rsteib: Gnus dependencies in `gnus-dired.el' (and `mailcap.el') have been | ||
| 67 | minimized. 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 |
| 70 | and change key bindings where necessary. The current list of modes: | 65 | and change key bindings where necessary. The current list of modes: |
| 71 | 66 | ||
| @@ -131,13 +126,13 @@ arevert-xtra.texi cyd | |||
| 131 | basic.texi cyd | 126 | basic.texi cyd |
| 132 | buffers.texi cyd | 127 | buffers.texi cyd |
| 133 | building.texi cyd | 128 | building.texi cyd |
| 134 | calendar.texi | 129 | calendar.texi rgm |
| 135 | cal-xtra.texi | 130 | cal-xtra.texi |
| 136 | cmdargs.texi cyd | 131 | cmdargs.texi cyd |
| 137 | commands.texi cyd | 132 | commands.texi cyd |
| 138 | custom.texi cyd | 133 | custom.texi cyd |
| 139 | dired.texi cyd | 134 | dired.texi cyd |
| 140 | dired-xtra.texi | 135 | dired-xtra.texi rgm |
| 141 | display.texi cyd | 136 | display.texi cyd |
| 142 | emacs.texi | 137 | emacs.texi |
| 143 | emacs-xtra.texi | 138 | emacs-xtra.texi |
| @@ -145,7 +140,7 @@ emerge-xtra.texi | |||
| 145 | entering.texi cyd | 140 | entering.texi cyd |
| 146 | files.texi cyd | 141 | files.texi cyd |
| 147 | fixit.texi cyd | 142 | fixit.texi cyd |
| 148 | fortran-xtra.texi | 143 | fortran-xtra.texi rgm |
| 149 | frames.texi cyd | 144 | frames.texi cyd |
| 150 | glossary.texi | 145 | glossary.texi |
| 151 | help.texi cyd | 146 | help.texi cyd |
| @@ -225,14 +220,14 @@ sequences.texi cyd | |||
| 225 | streams.texi cyd | 220 | streams.texi cyd |
| 226 | strings.texi cyd | 221 | strings.texi cyd |
| 227 | symbols.texi cyd | 222 | symbols.texi cyd |
| 228 | syntax.texi | 223 | syntax.texi cyd |
| 229 | text.texi | 224 | text.texi |
| 230 | tips.texi | 225 | tips.texi |
| 231 | variables.texi cyd | 226 | variables.texi cyd |
| 232 | windows.texi | 227 | windows.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 @@ | |||
| 1 | 2012-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 | |||
| 10 | 2012-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 | |||
| 21 | 2012-02-15 Glenn Morris <rgm@gnu.org> | ||
| 22 | |||
| 23 | * sending.texi (Mail Sending): smtpmail-auth-credentials was removed. | ||
| 24 | |||
| 1 | 2012-02-12 Glenn Morris <rgm@gnu.org> | 25 | 2012-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. | |||
| 287 | Rolf Ebert co-wrote Ada mode. | 287 | Rolf Ebert co-wrote Ada mode. |
| 288 | 288 | ||
| 289 | @item | 289 | @item |
| 290 | Paul Eggert integrated the Gnulib portability library, and made many | ||
| 291 | other portability fixes to the C code; as well as his contributions | ||
| 292 | to VC and the calendar. | ||
| 293 | |||
| 294 | @item | ||
| 290 | Stephen Eglen wrote @file{mspools.el}, which tells you which Procmail | 295 | Stephen Eglen wrote @file{mspools.el}, which tells you which Procmail |
| 291 | folders have mail waiting in them; and @file{iswitchb.el}, a feature | 296 | folders have mail waiting in them; and @file{iswitchb.el}, a feature |
| 292 | for incremental reading and completion of buffer names. | 297 | for incremental reading and completion of buffer names. |
| @@ -1250,7 +1255,7 @@ Daiki Ueno wrote @file{starttls.el}, support for Transport Layer | |||
| 1250 | Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with | 1255 | Security protocol; @file{sasl-cram.el} and @file{sasl-digest.el} (with |
| 1251 | Kenichi Okada), and @file{sasl.el}, support for Simple Authentication | 1256 | Kenichi Okada), and @file{sasl.el}, support for Simple Authentication |
| 1252 | and Security Layer (SASL); @file{plstore.el} for secure storage of | 1257 | and Security Layer (SASL); @file{plstore.el} for secure storage of |
| 1253 | propery lists; and the EasyPG (and its predecessor PGG) | 1258 | property lists; and the EasyPG (and its predecessor PGG) |
| 1254 | package, for GnuPG and PGP support. | 1259 | package, for GnuPG and PGP support. |
| 1255 | 1260 | ||
| 1256 | @item | 1261 | @item |
| @@ -1330,7 +1335,7 @@ mode for editing VHDL source code. | |||
| 1330 | John Wiegley wrote @file{align.el}, a set of commands for aligning text | 1335 | John Wiegley wrote @file{align.el}, a set of commands for aligning text |
| 1331 | according to regular-expression based rules; @file{isearchb.el} for fast | 1336 | according to regular-expression based rules; @file{isearchb.el} for fast |
| 1332 | buffer switching; @file{timeclock.el}, a package for keeping track of | 1337 | buffer switching; @file{timeclock.el}, a package for keeping track of |
| 1333 | time spent on projects; the Baha'i calendar support; | 1338 | time 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 | |||
| 95 | general holidays (@code{holiday-general-holidays}), | 95 | general holidays (@code{holiday-general-holidays}), |
| 96 | local holidays (@code{holiday-local-holidays}), | 96 | local holidays (@code{holiday-local-holidays}), |
| 97 | sun- and moon-related holidays (@code{holiday-solar-holidays}), | 97 | sun- and moon-related holidays (@code{holiday-solar-holidays}), |
| 98 | Baha'i holidays (@code{holiday-bahai-holidays}), | 98 | Bahá'í holidays (@code{holiday-bahai-holidays}), |
| 99 | Christian holidays (@code{holiday-christian-holidays}), | 99 | Christian holidays (@code{holiday-christian-holidays}), |
| 100 | Hebrew (Jewish) holidays (@code{holiday-hebrew-holidays}), | 100 | Hebrew (Jewish) holidays (@code{holiday-hebrew-holidays}), |
| 101 | Islamic (Muslim) holidays (@code{holiday-islamic-holidays}), | 101 | Islamic (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 |
| 203 | so on). | 203 | so 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á'í, |
| 206 | Chinese, Hebrew, Islamic, and Julian calendars too. For example, | 206 | Chinese, 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 |
| 422 | diary can have entries based on Baha'i, Hebrew, or Islamic dates. | 422 | diary can have entries based on Bahá'í, Hebrew, or Islamic dates. |
| 423 | Recognition of such entries can be time-consuming, however, and since | 423 | Recognition of such entries can be time-consuming, however, and since |
| 424 | most people don't use them, you must explicitly enable their use. If | 424 | most people don't use them, you must explicitly enable their use. If |
| 425 | you want the diary to recognize Hebrew-date diary entries, for example, | 425 | you 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 |
| 442 | Similarly, for Islamic and Baha'i entries, add | 442 | Similarly, 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 |
| 450 | entries; except that @code{diary-bahai-entry-symbol} (default @samp{B}) | 450 | entries; except that @code{diary-bahai-entry-symbol} (default @samp{B}) |
| 451 | must precede a Baha'i date, @code{diary-hebrew-entry-symbol} (default | 451 | must 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 |
| 454 | be abbreviated (because the first three letters are often not unique). | 454 | be 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 |
| 477 | entries that match the selected date and other dates that are similar in | 477 | entries that match the selected date and other dates that are similar in |
| 478 | the Baha'i, Hebrew, or Islamic calendars: | 478 | the 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 | |||
| 538 | days to be shown in the fancy diary buffer, set the variable | 538 | days 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 |
| 544 | actual diary buffer, and uses invisible text to hide entries that don't | 550 | actual 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 | |||
| 569 | hidden. After preparing the buffer, it runs the hook | 575 | hidden. 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 |
| 571 | the data directly to the printer with the command @code{lpr-buffer} | 577 | the 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 | ||
| 584 | If you want to use a different command to do the | ||
| 573 | printing, just change the value of this hook. Other uses might include, | 585 | printing, just change the value of this hook. Other uses might include, |
| 574 | for example, rearranging the lines into order by day and time. | 586 | for 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) |
| 839 | Make a diary entry with today's equivalent astronomical (Julian) day number. | 851 | Make a diary entry with today's equivalent astronomical (Julian) day number. |
| 840 | @item %%(diary-bahai-date) | 852 | @item %%(diary-bahai-date) |
| 841 | Make a diary entry with today's equivalent Baha'i calendar date. | 853 | Make a diary entry with today's equivalent Bahá'í calendar date. |
| 842 | @item %%(diary-chinese-date) | 854 | @item %%(diary-chinese-date) |
| 843 | Make a diary entry with today's equivalent Chinese calendar date. | 855 | Make 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 |
| 145 | weeks (months, years) as starting on particular dates. So Calendar mode | 145 | weeks (months, years) as starting on particular dates. So Calendar mode |
| 146 | provides commands to move to the beginning or end of a week, month or | 146 | provides commands to move to the start or end of a week, month or year: |
| 147 | year: | ||
| 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}). | |||
| 246 | Scroll calendar one month backward (@code{calendar-scroll-right}). | 245 | Scroll calendar one month backward (@code{calendar-scroll-right}). |
| 247 | @item C-v | 246 | @item C-v |
| 248 | @itemx @key{next} | 247 | @itemx @key{next} |
| 249 | Scroll calendar three months forward | 248 | Scroll 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} |
| 253 | Scroll calendar three months backward | 251 | Scroll 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 |
| 291 | date 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 |
| 296 | point. | 294 | point. |
| @@ -342,6 +340,8 @@ buries all buffers related to the calendar, selecting other buffers. | |||
| 342 | calendar deletes or iconifies that frame depending on the value of | 340 | calendar 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 |
| 428 | mode''), so it can be wider than it is long. Some of them use Filofax | 428 | mode''), so it can be wider than it is long. Some of them use Filofax |
| 429 | paper size (3.75in x 6.75in). All of these commands accept a prefix | 429 | paper size (3.75in x 6.75in). All of these commands accept a prefix |
| 430 | argument which specifies how many days, weeks, months or years to print | 430 | argument, 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. | |||
| 452 | and can display them. You can add your own holidays to the default list. | 452 | and 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 | ||
| 456 | Display holidays for the selected date | 457 | Display holidays for the selected date |
| 457 | (@code{calendar-cursor-holidays}). | 458 | (@code{calendar-cursor-holidays}). |
| 458 | @item Mouse-3 Holidays | ||
| 459 | Display any holidays for the date you click on. | ||
| 460 | @item x | 459 | @item x |
| 461 | Mark holidays in the calendar window (@code{calendar-mark-holidays}). | 460 | Mark 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 | |||
| 519 | holidays}, which prompts for the month and year. | 518 | holidays}, 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 |
| 522 | major Baha'i, Chinese, Christian, Islamic, and Jewish holidays; also the | 521 | major Bahá'í, Chinese, Christian, Islamic, and Jewish holidays; also the |
| 523 | solstices and equinoxes. | 522 | solstices 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 | |||
| 541 | times of sunrise and sunset for any date. | 540 | times 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 | ||
| 545 | Display times of sunrise and sunset for the selected date | 545 | Display 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 | ||
| 548 | Display times of sunrise and sunset for the date you click on. | ||
| 549 | @item M-x sunrise-sunset | 547 | @item M-x sunrise-sunset |
| 550 | Display times of sunrise and sunset for today's date. | 548 | Display 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 |
| 617 | variables for your usual physical location in your @file{.emacs} file. | 615 | variables for your usual physical location in your @file{.emacs} file. |
| 618 | And when you install Emacs on a machine, you can create a | 616 | If 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 | 617 | for all users in a @file{default.el} file. @xref{Init File}. |
| 620 | of 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; | |||
| 666 | it did not fully displace the Julian calendar and gain universal | 663 | it did not fully displace the Julian calendar and gain universal |
| 667 | acceptance until the early twentieth century. The Emacs calendar can | 664 | acceptance until the early twentieth century. The Emacs calendar can |
| 668 | display any month since January, year 1 of the current era, but the | 665 | display any month since January, year 1 of the current era, but the |
| 669 | calendar displayed is the Gregorian, even for a date at which the | 666 | calendar displayed is always the Gregorian, even for a date at which |
| 670 | Gregorian calendar did not exist. | 667 | the 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 |
| 673 | and from several other calendars. | 670 | and 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 | |||
| 745 | the astronomical Persian calendar, which is based on astronomical | 744 | the astronomical Persian calendar, which is based on astronomical |
| 746 | events. As of this writing the first future discrepancy is projected | 745 | events. As of this writing the first future discrepancy is projected |
| 747 | to occur on March 20, 2025. It is currently not clear what the | 746 | to occur on March 20, 2025. It is currently not clear what the |
| 748 | official calendar of Iran will be that far into the future. | 747 | official 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 | |||
| 756 | twelve ``terrestrial branches'' for a total of sixty names that are | 756 | twelve ``terrestrial branches'' for a total of sixty names that are |
| 757 | repeated in a cycle of sixty. | 757 | repeated 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 |
| 761 | 19 days each. The four remaining ``intercalary'' days are placed | 761 | 19 days each. The four remaining ``intercalary'' days are placed |
| 762 | between the 18th and 19th months. | 762 | between the 18th and 19th months. |
| 763 | 763 | ||
| @@ -768,11 +768,10 @@ between the 18th and 19th months. | |||
| 768 | in various other calendar systems: | 768 | in various other calendar systems: |
| 769 | 769 | ||
| 770 | @table @kbd | 770 | @table @kbd |
| 771 | @item Mouse-3 Other calendars | ||
| 772 | Display 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 | ||
| 776 | Display the selected date in various other calendars. | 775 | Display 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 |
| 801 | Display Baha'i date for selected day | 800 | Display 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 | |||
| 821 | Display Mayan date for selected day (@code{calendar-mayan-print-date}). | 820 | Display 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 | ||
| 825 | date into other calendars is to click on it with @kbd{Mouse-3}, then | ||
| 826 | choose @kbd{Other calendars} from the menu that appears. This displays | ||
| 827 | the equivalent forms of the date in all the calendars Emacs understands, | ||
| 828 | in the form of a menu. (Choosing an alternative from this menu doesn't | ||
| 829 | actually 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 |
| 832 | appropriate command starting with @kbd{p} from the table above. The | 824 | appropriate command starting with @kbd{p} from the table above. The |
| 833 | prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the | 825 | prefix @kbd{p} is a mnemonic for ``print,'' since Emacs ``prints'' the |
| 834 | equivalent date in the echo area. @kbd{p o} displays the | 826 | equivalent date in the echo area. @kbd{p o} displays the |
| 835 | date in all forms known to Emacs. | 827 | date in all forms known to Emacs. You can also use @kbd{Mouse-3} and |
| 828 | then choose @kbd{Other calendars} from the menu that appears. This | ||
| 829 | displays the equivalent forms of the date in all the calendars Emacs | ||
| 830 | understands, in the form of a menu. (Choosing an alternative from | ||
| 831 | this menu doesn't actually do anything---the menu is used only for | ||
| 832 | display.) | ||
| 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 | |||
| 868 | Move to a date specified with an astronomical (Julian) day number | 865 | Move 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 |
| 871 | Move to a date specified in the Baha'i calendar | 868 | Move 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 |
| 874 | Move to a date specified in the Hebrew calendar | 871 | Move 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 |
| 907 | of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs | 904 | of the anniversary of a date of death, called a ``yahrzeit.'' The Emacs |
| 908 | calendar includes a facility for such calculations. If you are in the | 905 | calendar includes a facility for such calculations. If you are in the |
| 909 | calendar, the command @kbd{M-x calendar-hebrew-list-yahrzeits} asks you for | 906 | calendar, 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, | |||
| 912 | this command first asks you for the date of death and the range of | 909 | this command first asks you for the date of death and the range of |
| 913 | years, and then displays the list of yahrzeit dates. | 910 | years, 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 |
| 977 | of 20 days each, followed a 5-day monthless period. Like the tzolkin | 975 | of 20 days each, followed by a 5-day monthless period. Like the tzolkin |
| 978 | cycle, this cycle repeats endlessly, and there are commands to move | 976 | cycle, this cycle repeats endlessly, and there are commands to move |
| 979 | backward and forward to the previous or next point in the cycle. Type | 977 | backward 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. | |||
| 1014 | showing what that file looks like: | 1012 | showing what that file looks like: |
| 1015 | 1013 | ||
| 1016 | @example | 1014 | @example |
| 1017 | 12/22/1988 Twentieth wedding anniversary!! | 1015 | 12/22/2012 Twentieth wedding anniversary!! |
| 1018 | &1/1. Happy New Year! | 1016 | &1/1. Happy New Year! |
| 1019 | 10/22 Ruth's birthday. | 1017 | 10/22 Ruth's birthday. |
| 1020 | * 21, *: Payday | 1018 | * 21, *: Payday |
| @@ -1023,15 +1021,15 @@ Tuesday--weekly meeting with grad students at 10am | |||
| 1023 | 1/13/89 Friday the thirteenth!! | 1021 | 1/13/89 Friday the thirteenth!! |
| 1024 | &thu 4pm squash game with Lloyd. | 1022 | &thu 4pm squash game with Lloyd. |
| 1025 | mar 16 Dad's birthday | 1023 | mar 16 Dad's birthday |
| 1026 | April 15, 1989 Income tax due. | 1024 | April 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 |
| 1031 | This format is essentially the same as the one used by the system's | 1029 | This 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 |
| 1033 | the event descriptions of most of the entries. Such formatting is | 1031 | example uses extra spaces to align the event descriptions of most of |
| 1034 | purely a matter of taste. | 1032 | the 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 |
| 1037 | provides a number of commands to let you view, add, and change diary | 1035 | provides 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 | |||
| 1053 | following, key bindings refer to the Calendar buffer. | 1051 | following, 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 | ||
| 1057 | Display all diary entries for the selected date | 1056 | Display all diary entries for the selected date |
| 1058 | (@code{diary-view-entries}). | 1057 | (@code{diary-view-entries}). |
| 1059 | @item Mouse-3 Diary | ||
| 1060 | Display all diary entries for the date you click on. | ||
| 1061 | @item s | 1058 | @item s |
| 1062 | Display the entire diary file (@code{diary-show-all-entries}). | 1059 | Display 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 |
| 1115 | other months that subsequently become visible by scrolling. To turn | 1112 | and to those that subsequently become visible after scrolling. To turn |
| 1116 | marking off and erase the current marks, type @kbd{u}, which also | 1113 | marking off and erase the current marks, type @kbd{u}, which also |
| 1117 | turns off holiday marks (@pxref{Holidays}). If the variable | 1114 | turns 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 |
| 1139 | automatically displays a window with the day's diary entries, when you | 1136 | automatically displays a window with the day's diary entries when you |
| 1140 | enter Emacs. | 1137 | start 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 |
| 1145 | To send such mail to yourself, use the command @kbd{M-x | 1142 | diary. To send such mail to yourself, use the command @kbd{M-x |
| 1146 | diary-mail-entries}. A prefix argument specifies how many days | 1143 | diary-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 | |||
| 1173 | punctuation). For example: | 1170 | punctuation). For example: |
| 1174 | 1171 | ||
| 1175 | @example | 1172 | @example |
| 1176 | 02/11/1989 | 1173 | 02/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 |
| 1201 | window; to do this, insert an ampersand @code{diary-nonmarking-symbol} | 1198 | window; 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 |
| 1203 | has no effect on display of the entry in the diary window; it affects | 1200 | beginning of the entry, before the date. This |
| 1204 | only marks on dates in the calendar window. Nonmarking entries are | 1201 | has no effect on display of the entry in the diary window; it only |
| 1202 | affects marks on dates in the calendar window. Nonmarking entries are | ||
| 1205 | especially useful for generic entries that would otherwise mark many | 1203 | especially useful for generic entries that would otherwise mark many |
| 1206 | different dates. | 1204 | different dates. |
| 1207 | 1205 | ||
| @@ -1214,14 +1212,14 @@ formatting a date. The examples all show dates in American order | |||
| 1214 | month, year) and ISO order (year, month, day) as options. | 1212 | month, year) and ISO order (year, month, day) as options. |
| 1215 | 1213 | ||
| 1216 | @example | 1214 | @example |
| 1217 | 4/20/93 Switch-over to new tabulation system | 1215 | 4/20/12 Switch-over to new tabulation system |
| 1218 | apr. 25 Start tabulating annual results | 1216 | apr. 25 Start tabulating annual results |
| 1219 | 4/30 Results for April are due | 1217 | 4/30 Results for April are due |
| 1220 | */25 Monthly cycle finishes | 1218 | */25 Monthly cycle finishes |
| 1221 | Friday Don't leave without backing up files | 1219 | Friday 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 |
| 1225 | third appear every year on the specified dates, and the fourth uses a | 1223 | third appear every year on the specified dates, and the fourth uses a |
| 1226 | wildcard (asterisk) for the month, so it appears on the 25th of every | 1224 | wildcard (asterisk) for the month, so it appears on the 25th of every |
| 1227 | month. The final entry appears every week on Friday. | 1225 | month. The final entry appears every week on Friday. |
| @@ -1231,7 +1229,7 @@ month. The final entry appears every week on Friday. | |||
| 1231 | This must be followed by a nondigit. In the date itself, @var{month} | 1229 | This must be followed by a nondigit. In the date itself, @var{month} |
| 1232 | and @var{day} are numbers of one or two digits. The optional @var{year} | 1230 | and @var{day} are numbers of one or two digits. The optional @var{year} |
| 1233 | is also a number, and may be abbreviated to the last two digits; that | 1231 | is also a number, and may be abbreviated to the last two digits; that |
| 1234 | is, you can use @samp{11/12/1989} or @samp{11/12/89}. | 1232 | is, 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 |
| 1246 | entry applies to all dates that match the specification. If the date | 1244 | entry applies to all dates that match the specification. If the date |
| 1247 | does not contain a year, it is generic and applies to any year. | 1245 | does not contain a year, it is generic and applies to any year. |
| 1248 | Alternatively, @var{month}, @var{day}, or @var{year} can be a @samp{*}; | 1246 | Alternatively, @var{month}, @var{day}, or @var{year} can be @samp{*}; |
| 1249 | this matches any month, day, or year, respectively. Thus, a diary entry | 1247 | this 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 | |||
| 1311 | yearly diary entry with the @kbd{i y} command. | 1309 | yearly 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 |
| 1314 | make a nonmarking diary entry, give a numeric argument to the command. | 1312 | make a nonmarking diary entry, give a prefix argument to the command. |
| 1315 | For example, @kbd{C-u i w} makes a nonmarking weekly diary entry. | 1313 | For 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 |
| 1370 | dates. Here is a block diary entry that applies to all dates from June | 1368 | dates. Here is a block diary entry that applies to all dates from June |
| 1371 | 24, 1990 through July 10, 1990: | 1369 | 24, 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 |
| 1379 | The @samp{6 24 1990} indicates the starting date and the @samp{7 10 1990} | 1377 | The @samp{6 24 2012} indicates the starting date and the @samp{7 10 2012} |
| 1380 | indicates the stopping date. (Again, if you are using the European or ISO | 1378 | indicates the stopping date. (Again, if you are using the European or ISO |
| 1381 | calendar style, the input order of month, day and year is different.) | 1379 | calendar 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 |
| 1403 | This entry applies to March 1, 1990 and every 50th day following; | 1401 | This 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 |
| 1405 | European or ISO calendar style, the input order of month, day and year | 1403 | European or ISO calendar style, the input order of month, day and year |
| 1406 | is different.) | 1404 | is 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 |
| 1409 | nonmarking entry, give a numeric argument to the command. For example, | 1407 | nonmarking 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, |
| 1413 | time-consuming, since every date visible in the calendar window must be | 1411 | since every date visible in the calendar window must be individually |
| 1414 | individually checked. So it's a good idea to make sexp diary entries | 1412 | checked. So it's a good idea to make sexp diary entries nonmarking |
| 1415 | nonmarking (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, |
| 1418 | specifies a regularly occurring event by offsets specified in days, | 1416 | specifies 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 |
| 1457 | begins with a recognizable time of day, Emacs can warn you several | 1455 | begins with a recognizable time of day, Emacs can warn you in advance |
| 1458 | minutes beforehand that that appointment is pending. Emacs alerts you | 1456 | that an appointment is pending. Emacs alerts you |
| 1459 | to the appointment by displaying a message in your chosen format, as | 1457 | to the appointment by displaying a message in your chosen format, as |
| 1460 | specified by the variable @code{appt-display-format}. If the value of | 1458 | specified 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 | |||
| 1542 | recognize additional appointment message formats by customizing the | 1540 | recognize additional appointment message formats by customizing the |
| 1543 | variable @code{diary-outlook-formats}. | 1541 | variable @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 |
| 1547 | diary file and iCalendar files, which are defined in ``RFC | 1546 | diary 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 |
| 1559 | iCalendar data from the current buffer and adds it to your (default) | 1558 | iCalendar data from the current buffer and adds it to your |
| 1560 | diary file. This function is also suitable for automatic extraction of | 1559 | diary file. This function is also suitable for automatic extraction of |
| 1561 | iCalendar data; for example with the Rmail mail client one could use: | 1560 | iCalendar 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 |
| 1589 | Emacs diary file to iCalendar format. To export only a part of a diary | 1588 | Emacs diary file to iCalendar format. To export only a part of a diary |
| 1590 | file, mark the relevant area, and call @code{icalendar-export-region}. | 1589 | file, mark the relevant area, and call @code{icalendar-export-region}. |
| 1591 | In both cases the result is appended to the target file. | 1590 | In 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 |
| 1696 | you have stopped working on the project and, by default, Emacs asks | 1695 | you have stopped working on the project and, by default, Emacs asks |
| 1697 | you. You can, however, set customize the value of the variable | 1696 | you. 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; |
| 1699 | then, only an explicit @kbd{M-x timeclock-out} or @kbd{M-x | 1698 | then, only an explicit @kbd{M-x timeclock-out} or @kbd{M-x |
| 1700 | timeclock-change} will tell Emacs that the current interval is over. | 1699 | timeclock-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 | ||
| 10 | You can insert subdirectories with specified @command{ls} switches in | 10 | You can insert subdirectories with specified @command{ls} switches in |
| 11 | Dired buffers using @kbd{C-u i}. You can change the @command{ls} | 11 | Dired buffers using @kbd{C-u i}. You can change the @command{ls} |
| 12 | switches of an already inserted subdirectory using @kbd{C-u l}. | 12 | switches of an already inserted subdirectory at point using @kbd{C-u l}. |
| 13 | 13 | ||
| 14 | Dired preserves the switches if you revert the buffer. Deleting a | 14 | Dired preserves the switches if you revert the buffer. Deleting a |
| 15 | subdirectory forgets about its switches. | 15 | subdirectory forgets about its switches. |
| 16 | 16 | ||
| 17 | Using @code{dired-undo} (@pxref{Marks vs Flags}) to reinsert or delete | 17 | Using @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 | ||
| 24 | to reinsert or delete | ||
| 18 | subdirectories that were inserted with explicit switches can bypass | 25 | subdirectories that were inserted with explicit switches can bypass |
| 19 | Dired's machinery for remembering (or forgetting) switches. Deleting | 26 | Dired's machinery for remembering (or forgetting) switches. Deleting |
| 20 | a subdirectory using @code{dired-undo} does not forget its switches. | 27 | a 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 |
| 74 | commands @code{fortran-beginning-of-subprogram} and | 74 | as 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), | 75 | and @code{fortran-beginning-of-subprogram}), Fortran mode provides |
| 76 | Fortran mode provides special commands to move by statements and other | 76 | special commands to move by statements and other program units. |
| 77 | program 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 |
| 99 | Move point forward to the start of the next code block, or the end of | 98 | Move point forward to the start of the next code block, or the end of |
| 100 | the current block, whichever is encountered first. | 99 | the current one, whichever comes first (@code{f90-next-block}). |
| 101 | (@code{f90-next-block}). A code block is a subroutine, | 100 | A code block is a subroutine, @code{if}--@code{endif} statement, and |
| 102 | @code{if}--@code{endif} statement, and so forth. This command exists | 101 | so forth. This command exists for F90 mode only, not Fortran mode. |
| 103 | for F90 mode only, not Fortran mode. With a numeric argument, this | 102 | With a numeric argument, it moves forward that many blocks. |
| 104 | moves 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 |
| 109 | Move point backward to the previous code block | 107 | Move 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 |
| 111 | moves backwards. | 109 | moves 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-^ |
| 164 | Join this line to the previous line (@code{fortran-join-line}). | 162 | Join this line to the previous line (@code{fortran-join-line}). |
| 165 | @item C-M-q | 163 | @item C-M-q |
| 166 | Indent all the lines of the subprogram point is in | 164 | Indent 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 |
| 169 | Fill a comment block or statement (using @code{fortran-fill-paragraph} | 167 | Fill 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 |
| 240 | editing in Fortran mode. In fixed form mode, the minimum column | 238 | editing in Fortran mode. In fixed form mode, the minimum column |
| 241 | number for the body of a statement is 6. Lines inside of Fortran | 239 | number for the body of a statement is 6. Lines inside of Fortran |
| 242 | blocks that are indented to larger column numbers always use only the | 240 | blocks that are indented to larger column numbers must use only the |
| 243 | space character for whitespace. In tab format mode, the minimum | 241 | space character for whitespace. In tab format mode, the minimum |
| 244 | column number for the statement body is 8, and the whitespace before | 242 | column number for the statement body is 8, and the whitespace before |
| 245 | column 8 must always consist of one tab character. | 243 | column 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 |
| 251 | indentation assumes it is a line number and moves it to columns 0 | 249 | indentation assumes it is a line number and moves it to columns 0 |
| 252 | through 4. (Columns always count from 0 in GNU Emacs.) | 250 | through 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 |
| 330 | a @samp{continue} line (or if you use the more modern @samp{enddo}), | 328 | a @samp{continue} line (or if you use the more modern @samp{enddo}), |
| 331 | then you can speed up indentation by setting this variable to | 329 | then 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 |
| 335 | If this is @code{t}, indenting an @samp{endif} (or @samp{enddo} | 333 | If 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 |
| 340 | Minimum indentation for Fortran statements when using fixed form | 338 | Minimum indentation for Fortran statements when using fixed form |
| 341 | continuation line style. Statement bodies are never indented less than | 339 | continuation line style. Statement bodies are never indented by less than |
| 342 | this much. The default is 6. | 340 | this. The default is 6. |
| 343 | 341 | ||
| 344 | @item fortran-minimum-statement-indent-tab | 342 | @item fortran-minimum-statement-indent-tab |
| 345 | Minimum indentation for Fortran statements for tab format continuation line | 343 | Minimum indentation for Fortran statements for tab format continuation line |
| 346 | style. Statement bodies are never indented less than this much. The | 344 | style. Statement bodies are never indented by less than this. The |
| 347 | default is 8. | 345 | default is 8. |
| 348 | @end table | 346 | @end table |
| 349 | 347 | ||
| 350 | The variables controlling the indentation of comments are described in | 348 | The following section describes the variables controlling the |
| 351 | the following section. | 349 | indentation 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 | |||
| 364 | some Fortran 77 compilers accept this syntax, Fortran mode will not | 362 | some Fortran 77 compilers accept this syntax, Fortran mode will not |
| 365 | insert such comments unless you have said in advance to do so. To do | 363 | insert such comments unless you have said in advance to do so. To do |
| 366 | this, set the variable @code{fortran-comment-line-start} to @samp{"!"}. | 364 | this, set the variable @code{fortran-comment-line-start} to @samp{"!"}. |
| 367 | If you use an unusual value, you may also need to adjust | 365 | If 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 | |||
| 373 | Align comment or insert new comment (@code{comment-dwim}). | 371 | Align comment or insert new comment (@code{comment-dwim}). |
| 374 | 372 | ||
| 375 | @item C-x ; | 373 | @item C-x ; |
| 376 | Applies to nonstandard @samp{!} comments only. | 374 | Applies to nonstandard @samp{!} comments only (@code{comment-set-column}). |
| 377 | 375 | ||
| 378 | @item C-c ; | 376 | @item C-c ; |
| 379 | Turn all lines of the region into comments, or (with argument) turn them back | 377 | Turn 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 |
| 407 | indentation. This is the default. | 405 | indentation. This is the default. |
| 408 | 406 | ||
| 409 | The minimum statement indentation is | 407 | The minimum indentation is |
| 410 | @code{fortran-minimum-statement-indent-fixed} for fixed form | 408 | @code{fortran-minimum-statement-indent-tab} for tab format |
| 411 | continuation line style and @code{fortran-minimum-statement-indent-tab} | 409 | continuation line style and @code{fortran-minimum-statement-indent-fixed} |
| 412 | for tab format style. | 410 | for fixed form style. |
| 413 | 411 | ||
| 414 | @item relative | 412 | @item relative |
| 415 | Align the text as if it were a line of code, but with an additional | 413 | Align 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 | |||
| 434 | lines are directives. Matching lines are never indented, and receive | 432 | lines are directives. Matching lines are never indented, and receive |
| 435 | distinctive font-locking. | 433 | distinctive 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}) |
| 438 | you use @samp{!} comments, this command can be used with them. Otherwise | 436 | has not been redefined. If you use @samp{!} comments, this command |
| 439 | it is useless in Fortran mode. | 437 | can 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 |
| 445 | lines of the region into comments by inserting the string @samp{C$$$} at | 443 | lines of the region into comments by inserting the string @samp{c$$$} at |
| 446 | the front of each one. With a numeric argument, it turns the region | 444 | the front of each one. With a numeric argument, it turns the region |
| 447 | back into live code by deleting @samp{C$$$} from the front of each line | 445 | back into live code by deleting @samp{c$$$} from the front of each line |
| 448 | in it. The string used for these comments can be controlled by setting | 446 | in it. The string used for these comments can be controlled by setting |
| 449 | the variable @code{fortran-comment-region}. Note that here we have an | 447 | the variable @code{fortran-comment-region}. Note that here we have an |
| 450 | example of a command and a variable with the same name; these two uses | 448 | example 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 | |||
| 507 | Split the current window horizontally temporarily so that it is | 505 | Split 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 |
| 510 | making lines longer than the character limit imposed by your Fortran | 508 | making lines longer than the limit imposed by your Fortran compiler. |
| 511 | compiler. | ||
| 512 | @item C-u C-c C-w | 509 | @item C-u C-c C-w |
| 513 | Split the current window horizontally so that it is | 510 | Split 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). | |||
| 377 | Send mail using the through an external mail host, such as your | 377 | Send mail using the through an external mail host, such as your |
| 378 | Internet service provider's outgoing SMTP mail server. If you have | 378 | Internet service provider's outgoing SMTP mail server. If you have |
| 379 | not told Emacs how to contact the SMTP server, it prompts for this | 379 | not told Emacs how to contact the SMTP server, it prompts for this |
| 380 | information, which is saved in the variables | 380 | information, which is saved in the @code{smtpmail-smtp-server} variable |
| 381 | @code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}. | 381 | and 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. | |||
| 123 | it via the version control system. The file is removed from the | 123 | it via the version control system. The file is removed from the |
| 124 | working tree, and in the VC Directory buffer | 124 | working 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 | |||
| 438 | locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; | 438 | locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature; |
| 439 | see the CVS documentation for details. If that case, you can use | 439 | see 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 |
| 441 | locking-based version control system (@pxref{VC With A Locking VCS}). | 441 | locking-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 @@ | |||
| 1 | 2012-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 | |||
| 32 | 2012-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 | |||
| 48 | 2012-02-15 Glenn Morris <rgm@gnu.org> | ||
| 49 | |||
| 50 | * processes.texi (Network): Document open-network-stream :parameters. | ||
| 51 | |||
| 1 | 2012-02-14 Chong Yidong <cyd@gnu.org> | 52 | 2012-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 | ||
| 658 | Command Loop | 659 | Command 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 |
| 608 | calls to the macro. An indentation specifiction is written like this: | 608 | calls 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 |
| 646 | This function returns the longest common substring of all possible | 647 | This function returns the longest common substring of all possible |
| 647 | completions of @var{string} in @var{collection}. The value of | 648 | completions of @var{string} in @var{collection}. |
| 648 | @var{collection} must be a list of strings, an alist whose keys are | 649 | |
| 649 | strings or symbols, an obarray, a hash table, or a completion function | 650 | @cindex completion table |
| 650 | (@pxref{Programmed Completion}). | 651 | The @var{collection} argument is called the @dfn{completion table}. |
| 652 | Its value must be a list of strings, an alist whose keys are strings | ||
| 653 | or symbols, an obarray, a hash table, or a completion function. | ||
| 651 | 654 | ||
| 652 | Completion compares @var{string} against each of the permissible | 655 | Completion compares @var{string} against each of the permissible |
| 653 | completions specified by @var{collection}. If no permissible | 656 | completions specified by @var{collection}. If no permissible |
| @@ -678,13 +681,13 @@ Also, you cannot intern a given symbol in more than one obarray. | |||
| 678 | If @var{collection} is a hash table, then the keys that are strings | 681 | If @var{collection} is a hash table, then the keys that are strings |
| 679 | are the possible completions. Other keys are ignored. | 682 | are the possible completions. Other keys are ignored. |
| 680 | 683 | ||
| 681 | You can also use a function as @var{collection}. | 684 | You can also use a function as @var{collection}. Then the function is |
| 682 | Then the function is solely responsible for performing completion; | 685 | solely responsible for performing completion; @code{try-completion} |
| 683 | @code{try-completion} returns whatever this function returns. The | 686 | returns whatever this function returns. The function is called with |
| 684 | function is called with three arguments: @var{string}, @var{predicate} | 687 | three arguments: @var{string}, @var{predicate} and @code{nil} (the |
| 685 | and @code{nil} (the reason for the third argument is so that the same | 688 | reason for the third argument is so that the same function can be used |
| 686 | function can be used in @code{all-completions} and do the appropriate | 689 | in @code{all-completions} and do the appropriate thing in either |
| 687 | thing in either case). @xref{Programmed Completion}. | 690 | case). @xref{Programmed Completion}. |
| 688 | 691 | ||
| 689 | If the argument @var{predicate} is non-@code{nil}, then it must be a | 692 | If the argument @var{predicate} is non-@code{nil}, then it must be a |
| 690 | function of one argument, unless @var{collection} is a hash table, in | 693 | function 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}. | |||
| 862 | It is done by calling @var{fun} with no arguments. The | 865 | It is done by calling @var{fun} with no arguments. The |
| 863 | value @var{fun} returns becomes the permanent value of @var{var}. | 866 | value @var{fun} returns becomes the permanent value of @var{var}. |
| 864 | 867 | ||
| 865 | Here is an example of use: | 868 | Here 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 | ||
| 872 | The function @code{completion-in-region} provides a convenient way to | ||
| 873 | perform completion on an arbitrary stretch of text in an Emacs buffer: | ||
| 874 | |||
| 875 | @defun completion-in-region start end collection &optional predicate | ||
| 876 | This function completes the text in the current buffer between the | ||
| 877 | positions @var{start} and @var{end}, using @var{collection}. The | ||
| 878 | argument @var{collection} has the same meaning as in | ||
| 879 | @code{try-completion} (@pxref{Basic Completion}). | ||
| 880 | |||
| 881 | This function inserts the completion text directly into the current | ||
| 882 | buffer. Unlike @code{completing-read} (@pxref{Minibuffer | ||
| 883 | Completion}), it does not activate the minibuffer. | ||
| 884 | |||
| 885 | For this function to work, point must be somewhere between @var{start} | ||
| 886 | and @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 | |||
| 899 | providing completion. It activates the minibuffer with prompt | 885 | providing 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 | ||
| 902 | The actual completion is done by passing @var{collection} and | 888 | The 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 |
| 904 | Completion}). This happens in certain commands bound in the local | 890 | function @code{try-completion} (@pxref{Basic Completion}). This |
| 905 | keymaps used for completion. Some of these commands also call | 891 | happens in certain commands bound in the local keymaps used for |
| 906 | @code{test-completion}. Thus, if @var{predicate} is non-@code{nil}, | 892 | completion. Some of these commands also call @code{test-completion}. |
| 907 | it should be compatible with @var{collection} and | 893 | Thus, if @var{predicate} is non-@code{nil}, it should be compatible |
| 908 | @code{completion-ignore-case}. @xref{Definition of test-completion}. | 894 | with @var{collection} and @code{completion-ignore-case}. |
| 895 | @xref{Definition of test-completion}. | ||
| 909 | 896 | ||
| 910 | The value of the optional argument @var{require-match} determines how | 897 | The value of the optional argument @var{require-match} determines how |
| 911 | the user may exit the minibuffer: | 898 | the user may exit the minibuffer: |
| @@ -1005,10 +992,11 @@ They are described in the following section. | |||
| 1005 | in the minibuffer to do completion. | 992 | in the minibuffer to do completion. |
| 1006 | 993 | ||
| 1007 | @defvar minibuffer-completion-table | 994 | @defvar minibuffer-completion-table |
| 1008 | The value of this variable is the collection used for completion in | 995 | The value of this variable is the completion table used for completion |
| 1009 | the minibuffer. This is the global variable that contains what | 996 | in 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 |
| 1011 | minibuffer completion commands such as @code{minibuffer-complete-word}. | 998 | minibuffer 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 | ||
| 1714 | completion facility can also be used on the text in ordinary Emacs | ||
| 1715 | buffers. In many major modes, in-buffer completion is performed by | ||
| 1716 | the @kbd{C-M-i} or @kbd{M-@key{TAB}} command, bound to | ||
| 1717 | @code{completion-at-point}. @xref{Symbol Completion,,, emacs, The GNU | ||
| 1718 | Emacs Manual}. This command uses the abnormal hook variable | ||
| 1719 | @code{completion-at-point-functions}: | ||
| 1720 | |||
| 1721 | @defvar completion-at-point-functions | ||
| 1722 | The value of this abnormal hook should be a list of functions, which | ||
| 1723 | are used to compute a completion table for completing the text at | ||
| 1724 | point. It can be used by major modes to provide mode-specific | ||
| 1725 | completion tables (@pxref{Major Mode Conventions}). | ||
| 1726 | |||
| 1727 | When the command @code{completion-at-point} runs, it calls the | ||
| 1728 | functions in the list one by one, without any argument. Each function | ||
| 1729 | should return @code{nil} if it is unable to produce a completion table | ||
| 1730 | for 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 | ||
| 1738 | enclose point). @var{collection} is a completion table for completing | ||
| 1739 | that text, in a form suitable for passing as the second argument to | ||
| 1740 | @code{try-completion} (@pxref{Basic Completion}); completion | ||
| 1741 | alternatives will be generated from this completion table in the usual | ||
| 1742 | way, via the completion styles defined in @code{completion-styles} | ||
| 1743 | (@pxref{Completion Styles}). @var{props} is a property list for | ||
| 1744 | additional information; the following optional properties are | ||
| 1745 | recognized: | ||
| 1746 | |||
| 1747 | @table @code | ||
| 1748 | @item :predicate | ||
| 1749 | The value should be a predicate that completion candidates need to | ||
| 1750 | satisfy. | ||
| 1751 | |||
| 1752 | @item :exclusive | ||
| 1753 | If the value is @code{no}, then if the completion table fails to match | ||
| 1754 | the text at point, then @code{completion-at-point} moves on to the | ||
| 1755 | next function in @code{completion-at-point-functions} instead of | ||
| 1756 | reporting a completion failure. | ||
| 1757 | @end table | ||
| 1758 | |||
| 1759 | A function in @code{completion-at-point-functions} may also return a | ||
| 1760 | function. In that case, that returned function is called, with no | ||
| 1761 | argument, and it is entirely responsible for performing the | ||
| 1762 | completion. We discourage this usage; it is intended to help convert | ||
| 1763 | old code to using @code{completion-at-point}. | ||
| 1764 | |||
| 1765 | The first function in @code{completion-at-point-functions} to return a | ||
| 1766 | non-@code{nil} value is used by @code{completion-at-point}. The | ||
| 1767 | remaining functions are not called. The exception to this is when | ||
| 1768 | there is a @code{:exclusive} specification, as described above. | ||
| 1769 | @end defvar | ||
| 1770 | |||
| 1771 | The following function provides a convenient way to perform | ||
| 1772 | completion on an arbitrary stretch of text in an Emacs buffer: | ||
| 1773 | |||
| 1774 | @defun completion-in-region start end collection &optional predicate | ||
| 1775 | This function completes the text in the current buffer between the | ||
| 1776 | positions @var{start} and @var{end}, using @var{collection}. The | ||
| 1777 | argument @var{collection} has the same meaning as in | ||
| 1778 | @code{try-completion} (@pxref{Basic Completion}). | ||
| 1779 | |||
| 1780 | This function inserts the completion text directly into the current | ||
| 1781 | buffer. Unlike @code{completing-read} (@pxref{Minibuffer | ||
| 1782 | Completion}), it does not activate the minibuffer. | ||
| 1783 | |||
| 1784 | For this function to work, point must be somewhere between @var{start} | ||
| 1785 | and @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 | |||
| 48 | possible, so that you can use them in a uniform way. | 48 | possible, 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 |
| 52 | makes it easy for a user to customize the behavior of the mode, by | 52 | it easy for a user to customize the behavior of the mode, by overriding |
| 53 | overriding the buffer-local variable assignments already made by the | 53 | the buffer-local variable assignments already made by the mode. Most |
| 54 | mode. Most minor mode functions also run a mode hook at the end. But | 54 | minor mode functions also run a mode hook at the end. But hooks are |
| 55 | hooks are used in other contexts too. For example, the hook | 55 | used in other contexts too. For example, the hook @code{suspend-hook} |
| 56 | @code{suspend-hook} runs just before Emacs suspends itself | 56 | runs 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 |
| 60 | calling @code{add-hook} (see below). The hook functions may be any of | 60 | of the valid kinds of functions that @code{funcall} accepts (@pxref{What |
| 61 | the valid kinds of functions that @code{funcall} accepts (@pxref{What | ||
| 62 | Is a Function}). Most normal hook variables are initially void; | 61 | Is 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 |
| 64 | globally or buffer-locally with @code{add-hook}. | 63 | globally or buffer-locally with @code{add-hook}. |
| @@ -178,7 +177,7 @@ calls @code{wrap-function} with arguments @code{fun} and @code{args}. | |||
| 178 | in Lisp Interaction mode: | 177 | in 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 | |||
| 202 | changing major modes) won't delete it from the hook variable's local | 201 | changing major modes) won't delete it from the hook variable's local |
| 203 | value. | 202 | value. |
| 204 | 203 | ||
| 205 | It is best to design your hook functions so that the order in which | 204 | For a normal hook, hook functions should be designed so that the order |
| 206 | they are executed does not matter. Any dependence on the order is | 205 | in which they are executed does not matter. Any dependence on the order |
| 207 | asking for trouble. However, the order is predictable: normally, | 206 | is 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 |
| 209 | executed first (barring another @code{add-hook} call). If the | 208 | first (barring another @code{add-hook} call). If the optional argument |
| 210 | optional 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 |
| 211 | function goes at the end of the hook list and will be executed last. | 210 | the 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 |
| 214 | value is a single function; it sets or changes the value to a list of | 213 | value 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 |
| 304 | many of these conventions automatically. @xref{Derived Modes}. Note | 303 | many of these conventions automatically. @xref{Derived Modes}. Note |
| 305 | also that fundamental mode is an exception to many of these conventions, | 304 | also that Fundamental mode is an exception to many of these conventions, |
| 306 | because its definition is to present the global state of Emacs. | 305 | because 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 |
| 309 | should aim for consistency in general with other Emacs major modes, as | 308 | should aim for consistency in general with other Emacs major modes, as |
| @@ -460,13 +459,9 @@ The mode can specify a local value for | |||
| 460 | this mode. | 459 | this mode. |
| 461 | 460 | ||
| 462 | @item | 461 | @item |
| 463 | The mode can specify how to complete various keywords by adding | 462 | The mode can specify how to complete various keywords by adding one or |
| 464 | to the special hook @code{completion-at-point-functions}. | 463 | more buffer-local entries to the special hook |
| 465 | 464 | @code{completion-at-point-functions}. @xref{Completion in Buffers}. | |
| 466 | @item | ||
| 467 | Use @code{defvar} or @code{defcustom} to set mode-related variables, so | ||
| 468 | that they are not reinitialized if they already have a value. (Such | ||
| 469 | reinitialization 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 | |||
| 546 | the file that contains the mode definition. | 541 | the file that contains the mode definition. |
| 547 | 542 | ||
| 548 | @item | 543 | @item |
| 549 | In 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 |
| 556 | The top-level forms in the file defining the mode should be written so | 545 | The top-level forms in the file defining the mode should be written so |
| 557 | that they may be evaluated more than once without adverse consequences. | 546 | that they may be evaluated more than once without adverse consequences. |
| 558 | Even if you never load the file more than once, someone else will. | 547 | For instance, use @code{defvar} or @code{defcustom} to set mode-related |
| 548 | variables, so that they are not reinitialized if they already have a | ||
| 549 | value (@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 |
| 566 | automatically selects a major mode for the new buffer when a file is | 558 | the buffer based on information in the file name or in the file itself. |
| 567 | visited. It also processes local variables specified in the file text. | 559 | It 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 |
| 570 | This function establishes the proper major mode and buffer-local variable | 562 | This 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 |
| 1206 | independently of the choice of major mode. Minor modes can be enabled | 1198 | disable independently of the choice of major mode. Minor modes can be |
| 1207 | individually or in combination. Minor modes would be better named | 1199 | enabled individually or in combination. |
| 1208 | ``generally available, optional feature modes,'' except that such a name | ||
| 1209 | would be unwieldy. | ||
| 1210 | |||
| 1211 | A minor mode is not usually meant as a variation of a single major mode. | ||
| 1212 | Usually they are general and can apply to many major modes. For | ||
| 1213 | example, Auto Fill mode works with any major mode that permits text | ||
| 1214 | insertion. To be general, a minor mode must be effectively independent | ||
| 1215 | of 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 |
| 1218 | mode. One reason is that you should be able to activate and deactivate | 1202 | mode, and can thus be used with most major modes. For example, Auto |
| 1219 | minor modes in any order. A minor mode should be able to have its | 1203 | Fill mode works with any major mode that permits text insertion. A few |
| 1220 | desired effect regardless of the major mode and regardless of the other | 1204 | minor modes, however, are specific to a particular major mode. For |
| 1221 | minor modes in effect. | 1205 | example, Diff Auto Refine mode is a minor mode that is intended to be |
| 1206 | used 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 |
| 1224 | way to insert the necessary hook into the rest of Emacs. Minor mode | 1209 | other minor modes in effect. It should be possible to activate and |
| 1225 | keymaps make this easier than it used to be. | 1210 | deactivate minor modes in any order. |
| 1226 | 1211 | ||
| 1227 | @defvar minor-mode-list | 1212 | @defvar minor-mode-list |
| 1228 | The value of this variable is a list of all minor mode commands. | 1213 | The 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 |
| 1243 | major modes. Several of the major mode conventions apply to minor | 1228 | major modes. These conventions are described below. The easiest way to |
| 1244 | modes as well: those regarding the name of the mode initialization | 1229 | follow them is to use the macro @code{define-minor-mode}. |
| 1245 | function, the names of global symbols, the use of a hook at the end of | 1230 | @xref{Defining Minor Modes}. |
| 1246 | the initialization function, and the use of keymaps and other tables. | ||
| 1247 | |||
| 1248 | In addition, there are several conventions that are specific to | ||
| 1249 | minor modes. (The easiest way to follow all the conventions is to use | ||
| 1250 | the 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 |
| 1255 | Make a variable whose name ends in @samp{-mode} to control the minor | 1235 | Define a variable whose name ends in @samp{-mode}. We call this the |
| 1256 | mode. We call this the @dfn{mode variable}. The minor mode command | 1236 | @dfn{mode variable}. The minor mode command should set this variable. |
| 1257 | should set this variable (@code{nil} to disable; anything else to | 1237 | The value will be @code{nil} is the mode is disabled, and non-@code{nil} |
| 1258 | enable). | 1238 | if the mode is enabled. The variable should be buffer-local if the |
| 1259 | 1239 | minor mode is buffer-local. | |
| 1260 | If possible, implement the mode so that setting the variable | ||
| 1261 | automatically enables or disables the mode. Then the minor mode command | ||
| 1262 | does not need to do anything except set the variable. | ||
| 1263 | 1240 | ||
| 1264 | This variable is used in conjunction with the @code{minor-mode-alist} to | 1241 | This variable is used in conjunction with the @code{minor-mode-alist} to |
| 1265 | display the minor mode name in the mode line. It can also enable | 1242 | display the minor mode name in the mode line. It also determines |
| 1266 | or disable a minor mode keymap. Individual commands or hooks can also | 1243 | whether the minor mode keymap is active, via @code{minor-mode-map-alist} |
| 1267 | check the variable's value. | 1244 | (@pxref{Controlling Active Maps}). Individual commands or hooks can |
| 1268 | 1245 | also check its value. | |
| 1269 | If you want the minor mode to be enabled separately in each buffer, | ||
| 1270 | make the variable buffer-local. | ||
| 1271 | 1246 | ||
| 1272 | @item | 1247 | @item |
| 1273 | Define a command whose name is the same as the mode variable. | 1248 | Define a command, called the @dfn{mode command}, whose name is the same |
| 1274 | Its job is to enable and disable the mode by setting the variable. | 1249 | as the mode variable. Its job is to set the value of the mode variable, |
| 1250 | plus anything else that needs to be done to actually enable or disable | ||
| 1251 | the mode's features. | ||
| 1275 | 1252 | ||
| 1276 | The command should accept one optional argument. If the argument is | 1253 | The 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 | 1254 | interactively with no prefix argument, it should toggle the mode |
| 1278 | off 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 |
| 1279 | positive integer, the symbol @code{t}, or a list whose @sc{car} is one | 1256 | called interactively with a prefix argument, it should enable the mode |
| 1280 | of those. It should turn the mode off if the argument is a negative | 1257 | if the argument is positive and disable it otherwise. |
| 1281 | integer or zero, the symbol @code{-}, or a list whose @sc{car} is a | ||
| 1282 | negative integer or zero. The meaning of other arguments is not | ||
| 1283 | specified. | ||
| 1284 | 1258 | ||
| 1285 | Here is an example taken from the definition of @code{transient-mark-mode}. | 1259 | If the mode command is called from Lisp (i.e.@: non-interactively), it |
| 1286 | It shows the use of @code{transient-mark-mode} as a variable that enables or | 1260 | should enable the mode if the argument is omitted or @code{nil}; it |
| 1287 | disables the mode's behavior, and also shows the proper way to toggle, | 1261 | should toggle the mode if the argument is the symbol @code{toggle}; |
| 1288 | enable or disable the minor mode based on the raw prefix argument value. | 1262 | otherwise it should treat the argument in the same way as for an |
| 1263 | interactive call with a numeric prefix argument, as described above. | ||
| 1289 | 1264 | ||
| 1290 | @smallexample | 1265 | The following example shows how to implement this behavior (it is |
| 1291 | @group | 1266 | similar 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 | |||
| 1278 | The reason for this somewhat complex behavior is that it lets users | ||
| 1279 | easily toggle the minor mode interactively, and also lets the minor mode | ||
| 1280 | be 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 | ||
| 1287 | This behaves correctly whether or not @code{foo-mode} was already | ||
| 1288 | enabled, since the @code{foo-mode} mode command unconditionally enables | ||
| 1289 | the minor mode when it is called from Lisp with no argument. Disabling | ||
| 1290 | a 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 | ||
| 1297 | However, this is not very commonly done. | ||
| 1297 | 1298 | ||
| 1298 | @item | 1299 | @item |
| 1299 | Add an element to @code{minor-mode-alist} for each minor mode | 1300 | Add 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 |
| 1335 | enabling and disabling via Custom (@pxref{Customization}). To do this, | 1335 | well: those regarding the names of global symbols, the use of a hook at |
| 1336 | the first step is to define the mode variable with @code{defcustom}, and | 1336 | the end of the initialization function, and the use of keymaps and other |
| 1337 | specify @code{:type 'boolean}. | 1337 | tables. |
| 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 |
| 1340 | Custom (@pxref{Customization}). To do this, the mode variable should be | ||
| 1341 | defined with @code{defcustom}, usually with @code{:type 'boolean}. If | ||
| 1342 | just setting the variable is not sufficient to enable the mode, you | ||
| 1340 | should also specify a @code{:set} method which enables the mode by | 1343 | should also specify a @code{:set} method which enables the mode by |
| 1341 | invoking the mode command. Note in the variable's documentation string that | 1344 | invoking the mode command. Note in the variable's documentation string |
| 1342 | setting the variable other than via Custom may not take effect. | 1345 | that setting the variable other than via Custom may not take effect. |
| 1343 | 1346 | Also, mark the definition with an autoload cookie (@pxref{autoload | |
| 1344 | Also mark the definition with an autoload cookie (@pxref{autoload cookie}), | 1347 | cookie}), and specify a @code{:require} so that customizing the variable |
| 1345 | and specify a @code{:require} so that customizing the variable will load | 1348 | will load the library that defines the mode. For example: |
| 1346 | the library that defines the mode. This will copy suitable definitions | ||
| 1347 | into @file{loaddefs.el} so that users can use @code{customize-option} to | ||
| 1348 | enable 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 | 1612 | variable @code{mode-line-format} (@pxref{Mode Line Top}). This variable |
| 1614 | displayed on the mode line of the current buffer. The value of | 1613 | holds a @dfn{mode line construct}: a template that controls what is |
| 1615 | @code{header-line-format} specifies the buffer's header line in the | 1614 | displayed on the buffer's mode line. The value of |
| 1616 | same way. All windows for the same buffer use the same | 1615 | @code{header-line-format} specifies the buffer's header line in the same |
| 1616 | way. 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 |
| 1620 | line and header line of a window. It does so when circumstances | 1620 | mode line and header line. It does so when circumstances appear to call |
| 1621 | appear to call for it---for instance, if you change the window | 1621 | for it---for instance, if you change the window configuration, switch |
| 1622 | configuration, switch buffers, narrow or widen the buffer, scroll, or | 1622 | buffers, narrow or widen the buffer, scroll, or modify the buffer. If |
| 1623 | change the buffer's modification status. If you modify any of the | 1623 | you alter any of the variables referenced by @code{mode-line-format} or |
| 1624 | variables referenced by @code{mode-line-format} (@pxref{Mode Line | 1624 | @code{header-line-format} (@pxref{Mode Line Variables}), or any other |
| 1625 | Variables}), or any other variables and data structures that affect | 1625 | data structures that affect how text is displayed (@pxref{Display}), you |
| 1626 | how text is displayed (@pxref{Display}), you may want to force an | 1626 | should use the function @code{force-mode-line-update} to update the |
| 1627 | update of the mode line so as to display the new information or | 1627 | display. |
| 1628 | display it in the new way. | ||
| 1629 | 1628 | ||
| 1630 | @defun force-mode-line-update &optional all | 1629 | @defun force-mode-line-update &optional all |
| 1631 | Force redisplay of the current buffer's mode line and header line. | 1630 | This function forces Emacs to update the current buffer's mode line and |
| 1632 | The next redisplay will update the mode line and header line based on | 1631 | header line, based on the latest values of all relevant variables, |
| 1633 | the latest values of all relevant variables. With optional | 1632 | during its next redisplay cycle. If the optional argument @var{all} is |
| 1634 | non-@code{nil} @var{all}, force redisplay of all mode lines and header | 1633 | non-@code{nil}, it forces an update for all mode lines and header lines. |
| 1635 | lines. | 1634 | |
| 1636 | 1635 | This function also forces an update of the menu bar and frame title. | |
| 1637 | This function also forces recomputation of the menu bar menus | ||
| 1638 | and 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 |
| 1642 | color using the face @code{mode-line}. Other windows' mode lines | 1639 | color using the face @code{mode-line}. Other windows' mode lines appear |
| 1643 | appear in the face @code{mode-line-inactive} instead. @xref{Faces}. | 1640 | in 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 |
| 1651 | numbers kept in buffer-local variables. Each data type has a specific | 1648 | numbers kept in buffer-local variables. Each data type has a specific |
| 1652 | meaning for the mode-line appearance, as described below. The same | 1649 | meaning for the mode line appearance, as described below. The same data |
| 1653 | data structure is used for constructing frame titles (@pxref{Frame | 1650 | structure is used for constructing frame titles (@pxref{Frame Titles}) |
| 1654 | Titles}) and header lines (@pxref{Header Lines}). | 1651 | and 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, |
| 1657 | but it usually specifies how to combine fixed strings with variables' | 1654 | but it usually specifies how to combine fixed strings with variables' |
| 1658 | values to construct the text. Many of these variables are themselves | 1655 | values to construct the text. Many of these variables are themselves |
| 1659 | defined to have mode-line constructs as their values. | 1656 | defined 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} |
| 1666 | A string as a mode-line construct appears verbatim except for | 1663 | A 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 |
| 1668 | other data; see @ref{%-Constructs}. | 1665 | other data; see @ref{%-Constructs}. |
| 1669 | 1666 | ||
| @@ -1676,8 +1673,8 @@ default, in the face @code{mode-line} or @code{mode-line-inactive} | |||
| 1676 | special meanings. @xref{Properties in Mode}. | 1673 | special meanings. @xref{Properties in Mode}. |
| 1677 | 1674 | ||
| 1678 | @item @var{symbol} | 1675 | @item @var{symbol} |
| 1679 | A symbol as a mode-line construct stands for its value. The value of | 1676 | A 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}. |
| 1681 | However, the symbols @code{t} and @code{nil} are ignored, as is any | 1678 | However, the symbols @code{t} and @code{nil} are ignored, as is any |
| 1682 | symbol whose value is void. | 1679 | symbol whose value is void. |
| 1683 | 1680 | ||
| @@ -1686,17 +1683,17 @@ displayed verbatim: the @code{%}-constructs are not recognized. | |||
| 1686 | 1683 | ||
| 1687 | Unless @var{symbol} is marked as ``risky'' (i.e., it has a | 1684 | Unless @var{symbol} is marked as ``risky'' (i.e., it has a |
| 1688 | non-@code{nil} @code{risky-local-variable} property), all text | 1685 | non-@code{nil} @code{risky-local-variable} property), all text |
| 1689 | properties specified in @var{symbol}'s value are ignored. This | 1686 | properties specified in @var{symbol}'s value are ignored. This includes |
| 1690 | includes the text properties of strings in @var{symbol}'s value, as | 1687 | the text properties of strings in @var{symbol}'s value, as well as all |
| 1691 | well as all @code{:eval} and @code{:propertize} forms in it. (The | 1688 | @code{:eval} and @code{:propertize} forms in it. (The reason for this |
| 1692 | reason for this is security: non-risky variables could be set | 1689 | is security: non-risky variables could be set automatically from file |
| 1693 | automatically from file variables without prompting the user.) | 1690 | variables 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{}) |
| 1697 | A list whose first element is a string or list means to process all the | 1694 | A list whose first element is a string or list means to process all the |
| 1698 | elements recursively and concatenate the results. This is the most | 1695 | elements recursively and concatenate the results. This is the most |
| 1699 | common form of mode-line construct. | 1696 | common form of mode line construct. |
| 1700 | 1697 | ||
| 1701 | @item (:eval @var{form}) | 1698 | @item (:eval @var{form}) |
| 1702 | A list whose first element is the symbol @code{:eval} says to evaluate | 1699 | A 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{}) |
| 1708 | A list whose first element is the symbol @code{:propertize} says to | 1705 | A list whose first element is the symbol @code{:propertize} says to |
| 1709 | process the mode-line construct @var{elt} recursively, then add the text | 1706 | process the mode line construct @var{elt} recursively, then add the text |
| 1710 | properties specified by @var{props} to the result. The argument | 1707 | properties 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}) |
| 1715 | A list whose first element is a symbol that is not a keyword specifies | 1712 | A list whose first element is a symbol that is not a keyword specifies |
| 1716 | a conditional. Its meaning depends on the value of @var{symbol}. If | 1713 | a 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. |
| 1719 | Otherwise, the third element, @var{else}, is processed recursively. | 1716 | Otherwise, the third element, @var{else}, is processed recursively. |
| 1720 | You may omit @var{else}; then the mode-line element displays nothing | 1717 | You may omit @var{else}; then the mode line element displays nothing |
| 1721 | if the value of @var{symbol} is @code{nil} or void. | 1718 | if 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{}) |
| 1724 | A list whose first element is an integer specifies truncation or | 1721 | A list whose first element is an integer specifies truncation or |
| 1725 | padding of the results of @var{rest}. The remaining elements | 1722 | padding 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 |
| 1727 | concatenated together. When @var{width} is positive, the result is | 1724 | concatenated together. When @var{width} is positive, the result is |
| 1728 | space filled on the right if its width is less than @var{width}. When | 1725 | space 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 |
| 1743 | The value of this variable is a mode-line construct that controls the | 1740 | The value of this variable is a mode line construct that controls the |
| 1744 | contents of the mode-line. It is always buffer-local in all buffers. | 1741 | contents of the mode-line. It is always buffer-local in all buffers. |
| 1745 | 1742 | ||
| 1746 | If you set this variable to @code{nil} in a buffer, that buffer does | 1743 | If you set this variable to @code{nil} in a buffer, that buffer does not |
| 1747 | not have a mode line. (A window that is just one line tall never | 1744 | have a mode line. (A window that is just one line tall also does not |
| 1748 | displays a mode line.) | 1745 | display 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 | |||
| 1763 | the user or by Lisp programs (such as @code{display-time} and major | 1760 | the user or by Lisp programs (such as @code{display-time} and major |
| 1764 | modes) via changes to those variables remain effective. | 1761 | modes) 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 |
| 1767 | useful for @code{shell-mode}, since it contains the host name and default | 1764 | be useful for Shell mode (in reality, Shell mode does not set |
| 1768 | directory. | 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 |
| 1812 | of @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 |
| 1813 | nothing inherently special about these variables; any other variables | 1809 | nothing inherently special about these variables; any other variables |
| 1814 | could have the same effects on the mode line if | 1810 | could 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 |
| 1816 | various parts of Emacs set these variables on the understanding that | 1812 | of Emacs set these variables on the understanding that they will control |
| 1817 | they will control parts of the mode line; therefore, practically | 1813 | parts of the mode line; therefore, practically speaking, it is essential |
| 1818 | speaking, it is essential for the mode line to use them. | 1814 | for the mode line to use them. |
| 1819 | 1815 | ||
| 1820 | @defvar mode-line-mule-info | 1816 | @defvar mode-line-mule-info |
| 1821 | This variable holds the value of the mode-line construct that displays | 1817 | This variable holds the value of the mode line construct that displays |
| 1822 | information about the language environment, buffer coding system, and | 1818 | information about the language environment, buffer coding system, and |
| 1823 | current input method. @xref{Non-ASCII Characters}. | 1819 | current input method. @xref{Non-ASCII Characters}. |
| 1824 | @end defvar | 1820 | @end defvar |
| 1825 | 1821 | ||
| 1826 | @defvar mode-line-modified | 1822 | @defvar mode-line-modified |
| 1827 | This variable holds the value of the mode-line construct that displays | 1823 | This variable holds the value of the mode line construct that displays |
| 1828 | whether the current buffer is modified. Its default value displays | 1824 | whether 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 |
| 1830 | modified, @samp{%%} if the buffer is read only, and @samp{%*} if the | 1826 | modified, @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 |
| 1890 | This buffer-local variable contains the mode-line information on process | 1886 | This buffer-local variable contains the mode line information on process |
| 1891 | status in modes used for communicating with subprocesses. It is | 1887 | status in modes used for communicating with subprocesses. It is |
| 1892 | displayed immediately following the major mode name, with no intervening | 1888 | displayed immediately following the major mode name, with no intervening |
| 1893 | space. For example, its value in the @samp{*shell*} buffer is | 1889 | space. 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 | ||
| 1909 | More generally, @var{mode-line-string} can be any mode-line spec. It | 1905 | More generally, @var{mode-line-string} can be any mode line construct. |
| 1910 | appears in the mode line when the value of @var{minor-mode-variable} | 1906 | It appears in the mode line when the value of @var{minor-mode-variable} |
| 1911 | is non-@code{nil}, and not otherwise. These strings should begin with | 1907 | is non-@code{nil}, and not otherwise. These strings should begin with |
| 1912 | spaces so that they don't run together. Conventionally, the | 1908 | spaces 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} |
| 1914 | non-@code{nil} value when that minor mode is activated. | 1910 | value 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 |
| 1917 | mentioned in the alist should be buffer-local if its minor mode can be | 1913 | mentioned 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 |
| 1922 | This variable holds a mode-line spec that, by default, appears in the | 1918 | This variable holds a mode line construct that, by default, appears in |
| 1923 | mode line just after the @code{which-func-mode} minor mode if set, | 1919 | the mode line just after the @code{which-func-mode} minor mode if set, |
| 1924 | else after @code{mode-line-modes}. The command @code{display-time} | 1920 | else after @code{mode-line-modes}. The command @code{display-time} sets |
| 1925 | sets @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 |
| 1927 | and load information. | 1923 | load information. |
| 1928 | 1924 | ||
| 1929 | The @samp{%M} construct substitutes the value of | 1925 | The @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 |
| 1963 | list of the defined @code{%}-constructs, and what they mean. In any | 1959 | list of the defined @code{%}-constructs, and what they mean. In any |
| 1964 | construct except @samp{%%}, you can add a decimal integer after the | 1960 | construct 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 |
| 2006 | The percentage of the buffer text above the @strong{top} of window, or | 2002 | The 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 |
| 2008 | mode-line specification truncates this to three characters. | 2004 | line construct truncates this to three characters. |
| 2009 | 2005 | ||
| 2010 | @item %P | 2006 | @item %P |
| 2011 | The percentage of the buffer text that is above the @strong{bottom} of | 2007 | The 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 |
| 2088 | Put a string with a text property directly into the mode-line data | 2084 | Put a string with a text property directly into the mode line data |
| 2089 | structure. | 2085 | structure. |
| 2090 | 2086 | ||
| 2091 | @item | 2087 | @item |
| 2092 | Put a text property on a mode-line %-construct such as @samp{%12b}; then | 2088 | Put a text property on a mode line %-construct such as @samp{%12b}; then |
| 2093 | the expansion of the %-construct will have that same text property. | 2089 | the 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 | |||
| 2097 | give @var{elt} a text property specified by @var{props}. | 2093 | give @var{elt} a text property specified by @var{props}. |
| 2098 | 2094 | ||
| 2099 | @item | 2095 | @item |
| 2100 | Use a list containing @code{:eval @var{form}} in the mode-line data | 2096 | Use a list containing @code{:eval @var{form}} in the mode line data |
| 2101 | structure, and make @var{form} evaluate to a string that has a text | 2097 | structure, and make @var{form} evaluate to a string that has a text |
| 2102 | property. | 2098 | property. |
| 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 |
| 2123 | top, just as it can have a mode line at the bottom. The header line | 2119 | a mode line at the bottom. The header line feature works just like the |
| 2124 | feature works just like the mode-line feature, except that it's | 2120 | mode line feature, except that it's controlled by |
| 2125 | controlled by different variables. | 2121 | @code{header-line-format}: |
| 2126 | 2122 | ||
| 2127 | @defvar header-line-format | 2123 | @defvar header-line-format |
| 2128 | This variable, local in every buffer, specifies how to display the | 2124 | This 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 | |||
| 2137 | header line. | 2133 | header 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 |
| 2143 | the text that would appear in a mode line or header line | 2139 | that would appear in a mode line or header line based on a certain |
| 2144 | based on a certain mode-line specification. | 2140 | mode line construct. |
| 2145 | 2141 | ||
| 2146 | @defun format-mode-line format &optional face window buffer | 2142 | @defun format-mode-line format &optional face window buffer |
| 2147 | This function formats a line of text according to @var{format} as if it | 2143 | This 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 | 2375 | attaches @code{face} properties to certain parts of the buffer based on |
| 2380 | syntactic role. How it parses the buffer depends on the major mode; | 2376 | their syntactic role. How it parses the buffer depends on the major |
| 2381 | most major modes define syntactic criteria for which faces to use in | 2377 | mode; most major modes define syntactic criteria for which faces to use |
| 2382 | which contexts. This section explains how to customize Font Lock for a | 2378 | in which contexts. This section explains how to customize Font Lock for |
| 2383 | particular major mode. | 2379 | a 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 |
| 2386 | syntactic parsing based on the syntax table, and through searching | 2382 | syntactic 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 | |||
| 2415 | Lock mode is enabled, to set all the other variables. | 2409 | Lock mode is enabled, to set all the other variables. |
| 2416 | 2410 | ||
| 2417 | @defvar font-lock-defaults | 2411 | @defvar font-lock-defaults |
| 2418 | This variable is set by major modes, as a buffer-local variable, to | 2412 | This variable is set by major modes to specify how to fontify text in |
| 2419 | specify how to fontify text in that mode. It automatically becomes | 2413 | that mode. It automatically becomes buffer-local when set. If its |
| 2420 | buffer-local when you set it. If its value is @code{nil}, Font-Lock | 2414 | value is @code{nil}, Font Lock mode does no highlighting, and you can |
| 2421 | mode does no highlighting, and you can use the @samp{Faces} menu | 2415 | use 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 | 2416 | Properties} in the menu bar) to assign faces explicitly to text in the |
| 2423 | assign faces explicitly to text in the buffer. | 2417 | buffer. |
| 2424 | 2418 | ||
| 2425 | If non-@code{nil}, the value should look like this: | 2419 | If non-@code{nil}, the value should look like this: |
| 2426 | 2420 | ||
| @@ -2443,19 +2437,20 @@ value. @xref{Levels of Font Lock}. | |||
| 2443 | The second element, @var{keywords-only}, specifies the value of the | 2437 | The second element, @var{keywords-only}, specifies the value of the |
| 2444 | variable @code{font-lock-keywords-only}. If this is omitted or | 2438 | variable @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 |
| 2446 | performed. If this is non-@code{nil}, such fontification is not | 2440 | performed. If this is non-@code{nil}, syntactic fontification is not |
| 2447 | performed. @xref{Syntactic Font Lock}. | 2441 | performed. @xref{Syntactic Font Lock}. |
| 2448 | 2442 | ||
| 2449 | The third element, @var{case-fold}, specifies the value of | 2443 | The 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}, |
| 2451 | Font Lock mode ignores case when searching as directed by | 2445 | Font Lock mode ignores case during search-based fontification. |
| 2452 | @code{font-lock-keywords}. | ||
| 2453 | 2446 | ||
| 2454 | If the fourth element, @var{syntax-alist}, is non-@code{nil}, it | 2447 | If the fourth element, @var{syntax-alist}, is non-@code{nil}, it should |
| 2455 | should be a list of cons cells of the form @code{(@var{char-or-string} | 2448 | be 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 |
| 2457 | syntactic fontification (@pxref{Syntax Table Functions}). The | 2450 | fontification; the resulting syntax table is stored in |
| 2458 | resulting 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 | ||
| 2453 | the @code{syntax-table} function. @xref{Syntax Table Functions}. | ||
| 2459 | 2454 | ||
| 2460 | The fifth element, @var{syntax-begin}, specifies the value of | 2455 | The 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 |
| 2486 | search-based fontification. You should specify the value of this | 2481 | @var{keywords} element in @code{font-lock-defaults}. |
| 2487 | variable with @var{keywords} in @code{font-lock-defaults}. | ||
| 2488 | 2482 | ||
| 2489 | @defvar font-lock-keywords | 2483 | @defvar font-lock-keywords |
| 2490 | This variable's value is a list of the keywords to highlight. Be | 2484 | The value of this variable is a list of the keywords to highlight. Lisp |
| 2491 | careful when composing regular expressions for this list; a poorly | 2485 | programs should not set this variable directly. Normally, the value is |
| 2492 | written pattern can dramatically slow things down! | 2486 | automatically set by Font Lock mode, using the @var{keywords} element in |
| 2487 | @code{font-lock-defaults}. The value can also be altered using the | ||
| 2488 | functions @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 | ||
| 2517 | The function @code{regexp-opt} (@pxref{Regexp Functions}) is useful | 2514 | Be careful when composing these regular expressions; a poorly written |
| 2518 | for calculating optimal regular expressions to match a number of | 2515 | pattern can dramatically slow things down! The function |
| 2519 | different keywords. | 2516 | @code{regexp-opt} (@pxref{Regexp Functions}) is useful for calculating |
| 2517 | optimal regular expressions to match several keywords. | ||
| 2520 | 2518 | ||
| 2521 | @item @var{function} | 2519 | @item @var{function} |
| 2522 | Find text by calling @var{function}, and highlight the matches | 2520 | Find 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}, |
| 2742 | and @code{java-font-lock-extra-types}, for example. | 2740 | and @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 |
| 2746 | or indirectly, except through their mode hooks. (Doing so would lead to | 2744 | or indirectly, except through their mode hooks. (Doing so would lead to |
| 2747 | incorrect behavior for some minor modes.) They should set up their | 2745 | incorrect 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 |
| 2759 | mode: one to fontify the word @samp{FIXME}, even in comments, and | ||
| 2760 | another to fontify the words @samp{and}, @samp{or} and @samp{not} as | ||
| 2761 | keywords. | ||
| 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 |
| 2769 | adds two fontification patterns for C mode: one to fontify the word | 2770 | This 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 | 2771 | mode @emph{and} all modes derived from it, do this instead: |
| 2771 | @samp{and}, @samp{or} and @samp{not} as keywords. | ||
| 2772 | |||
| 2773 | @noindent | ||
| 2774 | That example affects only C mode proper. To add the same patterns to | ||
| 2775 | C 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 |
| 2863 | can define multiple levels by using a list of symbols for @var{keywords} | 2859 | can define multiple levels by using a list of symbols for @var{keywords} |
| 2864 | in @code{font-lock-defaults}. Each symbol specifies one level of | 2860 | in @code{font-lock-defaults}. Each symbol specifies one level of |
| 2865 | fontification; it is up to the user to choose one of these levels, | 2861 | fontification; it is up to the user to choose one of these levels, |
| 2866 | normally by setting @code{font-lock-maximum-decoration} (@pxref{Font | 2862 | normally by setting @code{font-lock-maximum-decoration} (@pxref{Font |
| 2867 | Lock,,, emacs, the GNU Emacs Manual}). The chosen level's symbol | 2863 | Lock,,, emacs, the GNU Emacs Manual}). The chosen level's symbol value |
| 2868 | value is used to initialize @code{font-lock-keywords}. | 2864 | is 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 |
| 2871 | fontification: | 2867 | fontification: |
| @@ -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 |
| 2916 | faces specifically for syntactic highlighting. These @dfn{Font Lock | 2912 | faces specifically for Font Lock to use to highlight text. These |
| 2917 | faces} 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 |
| 2918 | syntactic highlighting outside of Font Lock mode (@pxref{Major Mode | 2914 | modes for syntactic highlighting outside of Font Lock mode (@pxref{Major |
| 2919 | Conventions}). | 2915 | Mode 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 |
| 2922 | default value is the symbol itself. Thus, the default value of | 2918 | default 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 | ||
| 2994 | Syntactic fontification uses the syntax table to find comments and | 2990 | Syntactic fontification uses a syntax table (@pxref{Syntax Tables}) to |
| 2995 | string constants (@pxref{Syntax Tables}). It highlights them using | 2991 | find and highlight syntactically relevant text. If enabled, it runs |
| 2996 | @code{font-lock-comment-face} and @code{font-lock-string-face} | 2992 | prior 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 | 2994 | which syntactic constructs to highlight. There are several variables |
| 2999 | variables that affect syntactic fontification; you should set them by | 2995 | that affect syntactic fontification; you should set them by means of |
| 3000 | means 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 | ||
| 2999 | of 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 | ||
| 3002 | table in special cases. @xref{Syntax Properties}. | ||
| 3001 | 3003 | ||
| 3002 | @defvar font-lock-keywords-only | 3004 | @defvar font-lock-keywords-only |
| 3003 | Non-@code{nil} means Font Lock should not do syntactic fontification; | 3005 | If the value of this variable is non-@code{nil}, Font Lock does not do |
| 3004 | it should only fontify based on @code{font-lock-keywords}. The normal | 3006 | syntactic fontification, only search-based fontification based on |
| 3005 | way 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}. | 3008 | on 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 |
| 3010 | This variable holds the syntax table to use for fontification of | 3012 | This variable holds the syntax table to use for fontification of |
| 3011 | comments and strings. Specify it using @var{syntax-alist} in | 3013 | comments 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 |
| 3013 | the buffer's syntax table. | 3015 | is @code{nil}, syntactic fontification uses the buffer's syntax table |
| 3016 | (the value returned by the function @code{syntax-table}; @pxref{Syntax | ||
| 3017 | Table 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 |
| 3017 | If this variable is non-@code{nil}, it should be a function to move | 3021 | If this variable is non-@code{nil}, it should be a function to move |
| 3018 | point back to a position that is syntactically at ``top level'' and | 3022 | point back to a position that is syntactically at ``top level'' and |
| 3019 | outside of strings or comments. Font Lock uses this when necessary | 3023 | outside of strings or comments. The value is normally set through an |
| 3020 | to 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 | |
| 3022 | This function is called with no arguments. It should leave point at | 3026 | outside of any comment, string, or sexp (@pxref{Position Parse}). |
| 3023 | the 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 | 3028 | This variable is semi-obsolete; we usually recommend setting |
| 3025 | be outside a syntactic block), or @code{beginning-of-defun} for | 3029 | @code{syntax-begin-function} instead. One of its uses is to tune the |
| 3030 | behavior of syntactic fontification, e.g.@: to ensure that different | ||
| 3031 | kinds of strings or comments are highlighted differently. | ||
| 3032 | |||
| 3033 | The specified function is called with no arguments. It should leave | ||
| 3034 | point at the beginning of any enclosing syntactic block. Typical values | ||
| 3035 | are @code{beginning-of-line} (used when the start of the line is known | ||
| 3036 | to be outside a syntactic block), or @code{beginning-of-defun} for | ||
| 3026 | programming modes, or @code{backward-paragraph} for textual modes. | 3037 | programming modes, or @code{backward-paragraph} for textual modes. |
| 3027 | |||
| 3028 | If the value is @code{nil}, Font Lock uses | ||
| 3029 | @code{syntax-begin-function} to move back outside of any comment, | ||
| 3030 | string, or sexp. This variable is semi-obsolete; we recommend setting | ||
| 3031 | @code{syntax-begin-function} instead. | ||
| 3032 | |||
| 3033 | Specify 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 |
| 3038 | A function to determine which face to use for a given syntactic | 3041 | If this variable is non-@code{nil}, it should be a function to determine |
| 3039 | element (a string or a comment). The function is called with one | 3042 | which face to use for a given syntactic element (a string or a comment). |
| 3040 | argument, the parse state at point returned by | 3043 | The value is normally set through an @var{other-vars} element in |
| 3041 | @code{parse-partial-sexp}, and should return a face. The default | ||
| 3042 | value returns @code{font-lock-comment-face} for comments and | ||
| 3043 | @code{font-lock-string-face} for strings. | ||
| 3044 | |||
| 3045 | This can be used to highlighting different kinds of strings or | ||
| 3046 | comments differently. It is also sometimes abused together with | ||
| 3047 | @code{font-lock-syntactic-keywords} to highlight constructs that span | ||
| 3048 | multiple lines, but this is too esoteric to document here. | ||
| 3049 | |||
| 3050 | Specify 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 | ||
| 3058 | automatically (@pxref{Syntax Properties}). This is useful in | ||
| 3059 | languages for which a single syntax table by itself is not sufficient. | ||
| 3060 | |||
| 3061 | @defvar font-lock-syntactic-keywords | ||
| 3062 | This variable enables and controls updating @code{syntax-table} | ||
| 3063 | properties by Font Lock. Its value should be a list of elements of | ||
| 3064 | this form: | ||
| 3065 | |||
| 3066 | @example | ||
| 3067 | (@var{matcher} @var{subexp} @var{syntax} @var{override} @var{laxmatch}) | ||
| 3068 | @end example | ||
| 3069 | |||
| 3070 | The parts of this element have the same meanings as in the corresponding | ||
| 3071 | sort of element of @code{font-lock-keywords}, | ||
| 3072 | 3045 | ||
| 3073 | @example | 3046 | The function is called with one argument, the parse state at point |
| 3074 | (@var{matcher} @var{subexp} @var{facespec} @var{override} @var{laxmatch}) | 3047 | returned by @code{parse-partial-sexp}, and should return a face. The |
| 3075 | @end example | 3048 | default value returns @code{font-lock-comment-face} for comments and |
| 3076 | 3049 | @code{font-lock-string-face} for strings (@pxref{Faces for Font Lock}). | |
| 3077 | However, instead of specifying the value @var{facespec} to use for the | ||
| 3078 | @code{face} property, it specifies the value @var{syntax} to use for | ||
| 3079 | the @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 | ||
| 3082 | is one of those two types. @var{override} cannot be @code{prepend} or | ||
| 3083 | @code{append}. | ||
| 3084 | |||
| 3085 | For example, an element of the form: | ||
| 3086 | |||
| 3087 | @example | ||
| 3088 | ("\\$\\(#\\)" 1 ".") | ||
| 3089 | @end example | ||
| 3090 | |||
| 3091 | highlights syntactically a hash character when following a dollar | ||
| 3092 | character, with a SYNTAX of @code{"."} (meaning punctuation syntax). | ||
| 3093 | Assuming that the buffer syntax table specifies hash characters to | ||
| 3094 | have comment start syntax, the element will only highlight hash | ||
| 3095 | characters that do not follow dollar characters as comments | ||
| 3096 | syntactically. | ||
| 3097 | |||
| 3098 | An element of the form: | ||
| 3099 | |||
| 3100 | @example | ||
| 3101 | ("\\('\\).\\('\\)" | ||
| 3102 | (1 "\"") | ||
| 3103 | (2 "\"")) | ||
| 3104 | @end example | ||
| 3105 | |||
| 3106 | highlights syntactically both single quotes which surround a single | ||
| 3107 | character, with a SYNTAX of @code{"\""} (meaning string quote syntax). | ||
| 3108 | Assuming that the buffer syntax table does not specify single quotes | ||
| 3109 | to have quote syntax, the element will only highlight single quotes of | ||
| 3110 | the form @samp{'@var{c}'} as strings syntactically. Other forms, such | ||
| 3111 | as @samp{foo'bar} or @samp{'fubar'}, will not be highlighted as | ||
| 3112 | strings. | ||
| 3113 | |||
| 3114 | Major 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 |
| 3223 | refontification; it does not automatically identify new multiline | 3157 | refontification; it does not automatically identify new multiline |
| 3224 | constructs. Identifying the requires that Font-Lock operate on large | 3158 | constructs. Identifying the requires that Font Lock mode operate on |
| 3225 | enough chunks at a time. This will happen by accident on many cases, | 3159 | large enough chunks at a time. This will happen by accident on many |
| 3226 | which may give the impression that multiline constructs magically work. | 3160 | cases, which may give the impression that multiline constructs magically |
| 3227 | If you set the @code{font-lock-multiline} variable non-@code{nil}, | 3161 | work. If you set the @code{font-lock-multiline} variable |
| 3228 | this impression will be even stronger, since the highlighting of those | 3162 | non-@code{nil}, this impression will be even stronger, since the |
| 3229 | constructs which are found will be properly updated from then on. | 3163 | highlighting of those constructs which are found will be properly |
| 3230 | But that does not work reliably. | 3164 | updated 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 |
| 3233 | place the @code{font-lock-multiline} property on the text before | 3167 | the @code{font-lock-multiline} property on the text before Font Lock |
| 3234 | Font-Lock looks at it, or use | 3168 | mode 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. | |||
| 3247 | the following variable: | 3180 | the following variable: |
| 3248 | 3181 | ||
| 3249 | @defvar font-lock-extend-after-change-region-function | 3182 | @defvar font-lock-extend-after-change-region-function |
| 3250 | This buffer-local variable is either @code{nil} or a function for | 3183 | This buffer-local variable is either @code{nil} or a function for Font |
| 3251 | Font-Lock to call to determine the region to scan and fontify. | 3184 | Lock mode to call to determine the region to scan and fontify. |
| 3252 | 3185 | ||
| 3253 | The function is given three parameters, the standard @var{beg}, | 3186 | The 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 | ||
| 3269 | For programming languages, an important feature of a major mode is to | 3202 | For programming languages, an important feature of a major mode is to |
| 3270 | provide automatic indentation. This is controlled in Emacs by | 3203 | provide 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 | |||
| 3287 | indentation code will want to be somewhat friendly to syntactically | 3220 | indentation code will want to be somewhat friendly to syntactically |
| 3288 | incorrect code. | 3221 | incorrect code. |
| 3289 | 3222 | ||
| 3290 | Good maintainable indentation functions usually fall into 2 categories: | 3223 | Good maintainable indentation functions usually fall into two categories: |
| 3291 | either parsing forward from some ``safe'' starting point until the | 3224 | either parsing forward from some ``safe'' starting point until the |
| 3292 | position of interest, or parsing backward from the position of interest. | 3225 | position of interest, or parsing backward from the position of interest. |
| 3293 | Neither of the two is a clearly better choice than the other: parsing | 3226 | Neither 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 |
| 1940 | server is stopped; a non-@code{nil} value means yes. | 1940 | server 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 |
| 1943 | This function opens a TCP connection, and returns a process object | 1943 | @cindex encrypted network connections |
| 1944 | that 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 | ||
| 1947 | This function opens a TCP connection, with optional encryption, and | ||
| 1948 | returns a process object that represents the connection. | ||
| 1945 | 1949 | ||
| 1946 | The @var{name} argument specifies the name for the process object. It | 1950 | The @var{name} argument specifies the name for the process object. It |
| 1947 | is modified as necessary to make it unique. | 1951 | is modified as necessary to make it unique. |
| @@ -1955,6 +1959,83 @@ associated with any buffer. | |||
| 1955 | The arguments @var{host} and @var{service} specify where to connect to; | 1959 | The 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 |
| 1957 | a defined network service (a string) or a port number (an integer). | 1961 | a defined network service (a string) or a port number (an integer). |
| 1962 | |||
| 1963 | @c FIXME? Is this too lengthy for the printed manual? | ||
| 1964 | The remaining arguments @var{parameters} are keyword/argument pairs | ||
| 1965 | that are mainly relevant to encrypted connections: | ||
| 1966 | |||
| 1967 | @table @code | ||
| 1968 | |||
| 1969 | @item :nowait @var{boolean} | ||
| 1970 | If non-@code{nil}, try to make an asynchronous connection. | ||
| 1971 | |||
| 1972 | @item :type @var{type} | ||
| 1973 | The type of connection. Options are: | ||
| 1974 | |||
| 1975 | @table @code | ||
| 1976 | @item plain | ||
| 1977 | An ordinary, unencrypted connection. | ||
| 1978 | @item tls | ||
| 1979 | @itemx ssl | ||
| 1980 | A TLS (``Transport Layer Security'') connection. | ||
| 1981 | @item nil | ||
| 1982 | @itemx network | ||
| 1983 | Start with a plain connection, and if parameters @samp{:success} | ||
| 1984 | and @samp{:capability-command} are supplied, try to upgrade to an encrypted | ||
| 1985 | connection via STARTTLS. If that fails, retain the unencrypted connection. | ||
| 1986 | @item starttls | ||
| 1987 | As for @code{nil}, but if STARTTLS fails drop the connection. | ||
| 1988 | @item shell | ||
| 1989 | A shell connection. | ||
| 1990 | @end table | ||
| 1991 | |||
| 1992 | @item :always-query-capabilities @var{boolean} | ||
| 1993 | If non-@code{nil}, always ask for the server's capabilities, even when | ||
| 1994 | doing a @samp{plain} connection. | ||
| 1995 | |||
| 1996 | @item :capability-command @var{capability-command} | ||
| 1997 | Command string to query the host capabilities. | ||
| 1998 | |||
| 1999 | @item :end-of-command @var{regexp} | ||
| 2000 | @itemx :end-of-capability @var{regexp} | ||
| 2001 | Regular expression matching the end of a command, or the end of the | ||
| 2002 | command @var{capability-command}. The latter defaults to the former. | ||
| 2003 | |||
| 2004 | @item :starttls-function @var{function} | ||
| 2005 | Function of one argument (the response to @var{capability-command}), | ||
| 2006 | which returns either @code{nil}, or the command to activate STARTTLS | ||
| 2007 | if supported. | ||
| 2008 | |||
| 2009 | @item :success @var{regexp} | ||
| 2010 | Regular expression matching a successful STARTTLS negotiation. | ||
| 2011 | |||
| 2012 | @item :use-starttls-if-possible @var{boolean} | ||
| 2013 | If non-@code{nil}, do opportunistic STARTTLS upgrades even if Emacs | ||
| 2014 | doesn't have built-in TLS support. | ||
| 2015 | |||
| 2016 | @item :client-certificate @var{list-or-t} | ||
| 2017 | Either a list of the form @code{(@var{key-file} @var{cert-file})}, | ||
| 2018 | naming 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}). | ||
| 2021 | Only used for TLS or STARTTLS. | ||
| 2022 | |||
| 2023 | @item :return-list @var{cons-or-nil} | ||
| 2024 | The return value of this function. If omitted or @code{nil}, return a | ||
| 2025 | process 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} | ||
| 2030 | If non-@code{nil}, the greeting string returned by the host. | ||
| 2031 | @item :capabilities @var{string-or-nil} | ||
| 2032 | If non-@code{nil}, the host's capability string. | ||
| 2033 | @item :type @var{symbol} | ||
| 2034 | The 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 |
| 14 | character. This information is used by the @dfn{parsing functions}, the | 14 | in a buffer. It can be used to determine where words, symbols, and |
| 15 | complex movement commands, and others to determine where words, symbols, | 15 | other syntactic constructs begin and end. This information is used by |
| 16 | and other syntactic constructs begin and end. The current syntax table | 16 | many Emacs facilities, including Font Lock mode (@pxref{Font Lock |
| 17 | controls the meaning of the word motion functions (@pxref{Word Motion}) | 17 | Mode}) and the various complex movement commands (@pxref{Motion}). |
| 18 | and the list motion functions (@pxref{List Motion}), as well as the | ||
| 19 | functions 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 | ||
| 39 | determines the syntactic use of each character in a buffer. This | ||
| 40 | information is used by the parsing commands, the complex movement | ||
| 41 | commands, and others to determine where words, symbols, and other | ||
| 42 | syntactic constructs begin and end. The current syntax table controls | ||
| 43 | the meaning of the word motion functions (@pxref{Word Motion}) and the | ||
| 44 | list motion functions (@pxref{List Motion}) as well as the functions in | ||
| 45 | this 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 |
| 49 | index @var{c} describes the character with code @var{c}. The element's | 36 | index @var{c} describes the character with code @var{c}. The element's |
| 50 | value should be a list that encodes the syntax of the character in | 37 | value 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 | |||
| 57 | feature out of Emacs Lisp for simplicity.) | 44 | feature 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 |
| 60 | idea of the syntactic class of various characters. For example, in Lisp | 47 | idea of the syntactic class of various characters. For example, in |
| 61 | mode, the character @samp{;} begins a comment, but in C mode, it | 48 | Lisp mode, the character @samp{;} begins a comment, but in C mode, it |
| 62 | terminates a statement. To support these variations, Emacs makes the | 49 | terminates a statement. To support these variations, Emacs makes the |
| 63 | choice of syntax table local to each buffer. Typically, each major | 50 | syntax table local to each buffer. Typically, each major mode has its |
| 64 | mode has its own syntax table and installs that table in each buffer | 51 | own syntax table and installs that table in each buffer that uses that |
| 65 | that uses that mode. Changing this table alters the syntax in all | 52 | mode. Changing this table alters the syntax in all those buffers as |
| 66 | those buffers as well as in any buffers subsequently put in that mode. | 53 | well as in any buffers subsequently put in that mode. Occasionally |
| 67 | Occasionally several similar modes share one syntax table. | 54 | several similar modes share one syntax table. @xref{Example Major |
| 68 | @xref{Example Major Modes}, for an example of how to set up a syntax | 55 | Modes}, for an example of how to set up a syntax table. |
| 69 | table. | ||
| 70 | 56 | ||
| 71 | A syntax table can inherit the data for some characters from the | 57 | A syntax table can inherit the data for some characters from the |
| 72 | standard syntax table, while specifying other characters itself. The | 58 | standard 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}. |
| 86 | syntax of a character, and how they are represented as a @dfn{syntax | 72 | Each syntax table specifies the syntax class of each character. There |
| 87 | descriptor}, 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 | ||
| 91 | is no necessary relationship between the class of a character in one | 73 | is no necessary relationship between the class of a character in one |
| 92 | syntax table and its class in any other table. | 74 | syntax 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 |
| 95 | name of the class when you need to specify a class. Usually the | 77 | serves as the name of the class when you need to specify a class. |
| 96 | designator character is one that is often assigned that class; however, | 78 | Usually, this designator character is one that is often assigned that |
| 97 | its meaning as a designator is unvarying and independent of what syntax | 79 | class; however, its meaning as a designator is unvarying and |
| 98 | that character currently has. Thus, @samp{\} as a designator character | 80 | independent of what syntax that character currently has. Thus, |
| 99 | always gives ``escape character'' syntax, regardless of what syntax | 81 | @samp{\} as a designator character always means ``escape character'' |
| 100 | @samp{\} currently has. | 82 | syntax, regardless of whether the @samp{\} character actually has that |
| 83 | syntax 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 |
| 104 | matching character (used only for the parenthesis classes) and flags. | 90 | classes and other syntactic properties of a character. When you want |
| 105 | The first character is the designator for a syntax class. The second | 91 | to modify the syntax of a character, that is done by calling the |
| 106 | character is the character to match; if it is unused, put a space there. | 92 | function @code{modify-syntax-entry} and passing a syntax descriptor as |
| 107 | Then come the characters for any desired flags. If no matching | 93 | one of its arguments (@pxref{Syntax Table Functions}). |
| 108 | character or flags are needed, one character is sufficient. | 94 | |
| 95 | The first character in a syntax descriptor designates the syntax | ||
| 96 | class. The second character specifies a matching character (e.g.@: in | ||
| 97 | Lisp, the matching character for @samp{(} is @samp{)}); if there is no | ||
| 98 | matching character, put a space there. Then come the characters for | ||
| 99 | any 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 |
| 111 | mode is @code{". 23"} (i.e., punctuation, matching character slot | 105 | mode 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 |
| 126 | their meanings, and examples of their use. | 120 | them, 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{-}) | ||
| 130 | separate symbols and words from each other. Typically, whitespace | ||
| 131 | characters have no other syntactic significance, and multiple | ||
| 132 | whitespace characters are syntactically equivalent to a single one. | ||
| 133 | Space, tab, and formfeed are classified as whitespace in almost all | ||
| 134 | major 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 | ||
| 139 | human languages, and are typically used in variable and command names | ||
| 140 | in programs. All upper- and lower-case letters, and the digits, are | ||
| 141 | typically 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{-} |
| 146 | characters that are used in variable and command names along with word | 124 | Characters that separate symbols and words from each other. |
| 147 | constituents. For example, the symbol constituents class is used in | 125 | Typically, whitespace characters have no other syntactic significance, |
| 148 | Lisp mode to indicate that certain characters may be part of symbol | 126 | and multiple whitespace characters are syntactically equivalent to a |
| 149 | names even though they are not part of English words. These characters | 127 | single one. Space, tab, and formfeed are classified as whitespace in |
| 150 | are @samp{$&*+-_<>}. In standard C, the only non-word-constituent | 128 | almost all major modes. |
| 129 | |||
| 130 | This syntax class can be designated by either @w{@samp{@ }} or | ||
| 131 | @samp{-}. Both designators are equivalent. | ||
| 132 | |||
| 133 | @item Word constituents: @samp{w} | ||
| 134 | Parts of words in human languages. These are typically used in | ||
| 135 | variable and command names in programs. All upper- and lower-case | ||
| 136 | letters, and the digits, are typically word constituents. | ||
| 137 | |||
| 138 | @item Symbol constituents: @samp{_} | ||
| 139 | Extra characters used in variable and command names along with word | ||
| 140 | constituents. Examples include the characters @samp{$&*+-_<>} in Lisp | ||
| 141 | mode, which may be part of a symbol name even though they are not part | ||
| 142 | of English words. In standard C, the only non-word-constituent | ||
| 151 | character that is valid in symbols is underscore (@samp{_}). | 143 | character 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 | ||
| 156 | characters that are used as punctuation in English, or are used in some | ||
| 157 | way in a programming language to separate symbols from one another. | ||
| 158 | Some programming language modes, such as Emacs Lisp mode, have no | ||
| 159 | characters in this class since the few characters that are not symbol or | ||
| 160 | word constituents all have other uses. Other programming language modes, | ||
| 161 | such 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} | 146 | Characters used as punctuation in a human language, or used in a |
| 166 | @cindex parenthesis syntax | 147 | programming language to separate symbols from one another. Some |
| 167 | Open and close @dfn{parenthesis characters} are characters used in | 148 | programming language modes, such as Emacs Lisp mode, have no |
| 168 | dissimilar pairs to surround sentences or expressions. Such a grouping | 149 | characters in this class since the few characters that are not symbol |
| 169 | is begun with an open parenthesis character and terminated with a close. | 150 | or word constituents all have other uses. Other programming language |
| 170 | Each open parenthesis character matches a particular close parenthesis | 151 | modes, such as C mode, use punctuation syntax for operators. |
| 171 | character, and vice versa. Normally, Emacs indicates momentarily the | 152 | |
| 172 | matching open parenthesis when you insert a close parenthesis. | 153 | @item Open parenthesis characters: @samp{(} |
| 173 | @xref{Blinking}. | 154 | @itemx Close parenthesis characters: @samp{)} |
| 174 | 155 | Characters used in dissimilar pairs to surround sentences or | |
| 175 | The class of open parentheses is designated by @samp{(}, and that of | 156 | expressions. Such a grouping is begun with an open parenthesis |
| 176 | close parentheses by @samp{)}. | 157 | character and terminated with a close. Each open parenthesis |
| 177 | 158 | character matches a particular close parenthesis character, and vice | |
| 178 | In English text, and in C code, the parenthesis pairs are @samp{()}, | 159 | versa. Normally, Emacs indicates momentarily the matching open |
| 179 | @samp{[]}, and @samp{@{@}}. In Emacs Lisp, the delimiters for lists and | 160 | parenthesis when you insert a close parenthesis. @xref{Blinking}. |
| 180 | vectors (@samp{()} and @samp{[]}) are classified as parenthesis | 161 | |
| 181 | characters. | 162 | In human languages, and in C code, the parenthesis pairs are |
| 182 | @end deffn | 163 | @samp{()}, @samp{[]}, and @samp{@{@}}. In Emacs Lisp, the delimiters |
| 183 | 164 | for lists and vectors (@samp{()} and @samp{[]}) are classified as | |
| 184 | @deffn {Syntax class} @w{string quote} | 165 | parenthesis characters. |
| 185 | @dfn{String quote characters} (designated by @samp{"}) are used in | 166 | |
| 186 | many languages, including Lisp and C, to delimit string constants. The | 167 | @item String quotes: @samp{"} |
| 187 | same string quote character appears at the beginning and the end of a | 168 | Characters used to delimit string constants. The same string quote |
| 188 | string. Such quoted strings do not nest. | 169 | character appears at the beginning and the end of a string. Such |
| 170 | quoted strings do not nest. | ||
| 189 | 171 | ||
| 190 | The parsing facilities of Emacs consider a string as a single token. | 172 | The parsing facilities of Emacs consider a string as a single token. |
| 191 | The usual syntactic meanings of the characters in the string are | 173 | The 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: | |||
| 197 | double-quote for strings, and single-quote (@samp{'}) for character | 179 | double-quote for strings, and single-quote (@samp{'}) for character |
| 198 | constants. | 180 | constants. |
| 199 | 181 | ||
| 200 | English text has no string quote characters because English is not a | 182 | Human text has no string quote characters. We do not want quotation |
| 201 | programming language. Although quotation marks are used in English, | 183 | marks to turn off the usual syntactic properties of other characters |
| 202 | we do not want them to turn off the usual syntactic properties of | 184 | in the quotation. |
| 203 | other characters in the quotation. | ||
| 204 | @end deffn | ||
| 205 | 185 | ||
| 206 | @deffn {Syntax class} @w{escape-syntax character} | 186 | @item Escape-syntax characters: @samp{\} |
| 207 | An @dfn{escape character} (designated by @samp{\}) starts an escape | 187 | Characters that start an escape sequence, such as is used in string |
| 208 | sequence such as is used in C string and character constants. The | 188 | and character constants. The character @samp{\} belongs to this class |
| 209 | character @samp{\} belongs to this class in both C and Lisp. (In C, it | 189 | in both C and Lisp. (In C, it is used thus only inside strings, but |
| 210 | is used thus only inside strings, but it turns out to cause no trouble | 190 | it turns out to cause no trouble to treat it this way throughout C |
| 211 | to treat it this way throughout C code.) | 191 | code.) |
| 212 | 192 | ||
| 213 | Characters in this class count as part of words if | 193 | Characters 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{/} |
| 218 | A @dfn{character quote character} (designated by @samp{/}) quotes the | 197 | Characters used to quote the following character so that it loses its |
| 219 | following character so that it loses its normal syntactic meaning. This | 198 | normal syntactic meaning. This differs from an escape character in |
| 220 | differs from an escape character in that only the character immediately | 199 | that only the character immediately following is ever affected. |
| 221 | following is ever affected. | ||
| 222 | 200 | ||
| 223 | Characters in this class count as part of words if | 201 | Characters 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 | ||
| 226 | This class is used for backslash in @TeX{} mode. | 204 | This 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 | ||
| 231 | string quote characters except that the syntactic properties of the | ||
| 232 | characters between the delimiters are not suppressed. Only @TeX{} mode | ||
| 233 | uses a paired delimiter presently---the @samp{$} that both enters and | ||
| 234 | leaves math mode. | ||
| 235 | @end deffn | ||
| 236 | |||
| 237 | @deffn {Syntax class} @w{expression prefix} | ||
| 238 | An @dfn{expression prefix operator} (designated by @samp{'}) is used for | ||
| 239 | syntactic operators that are considered as part of an expression if they | ||
| 240 | appear next to one. In Lisp modes, these characters include the | ||
| 241 | apostrophe, @samp{'} (used for quoting), the comma, @samp{,} (used in | ||
| 242 | macros), 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} | 207 | Similar to string quote characters, except that the syntactic |
| 208 | properties of the characters between the delimiters are not | ||
| 209 | suppressed. Only @TeX{} mode uses a paired delimiter presently---the | ||
| 210 | @samp{$} that both enters and leaves math mode. | ||
| 211 | |||
| 212 | @item Expression prefixes: @samp{'} | ||
| 213 | Characters used for syntactic operators that are considered as part of | ||
| 214 | an expression if they appear next to one. In Lisp modes, these | ||
| 215 | characters include the apostrophe, @samp{'} (used for quoting), the | ||
| 216 | comma, @samp{,} (used in macros), and @samp{#} (used in the read | ||
| 217 | syntax for certain data types). | ||
| 218 | |||
| 219 | @item Comment starters: @samp{<} | ||
| 220 | @itemx Comment enders: @samp{>} | ||
| 247 | @cindex comment syntax | 221 | @cindex comment syntax |
| 248 | The @dfn{comment starter} and @dfn{comment ender} characters are used in | 222 | Characters used in various languages to delimit comments. Human text |
| 249 | various languages to delimit comments. These classes are designated | 223 | has no comment characters. In Lisp, the semicolon (@samp{;}) starts a |
| 250 | by @samp{<} and @samp{>}, respectively. | 224 | comment and a newline or formfeed ends one. |
| 251 | 225 | ||
| 252 | English 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. | 227 | This syntax class does not specify a particular syntax. It says to |
| 254 | @end deffn | 228 | look in the standard syntax table to find the syntax of this |
| 255 | 229 | character. | |
| 256 | @deffn {Syntax class} @w{inherit standard syntax} | ||
| 257 | This syntax class does not specify a particular syntax. It says to look | ||
| 258 | in the standard syntax table to find the syntax of this character. The | ||
| 259 | designator 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{!} |
| 263 | A @dfn{generic comment delimiter} (designated by @samp{!}) starts | 232 | Characters that start or end a special kind of comment. @emph{Any} |
| 264 | or ends a special kind of comment. @emph{Any} generic comment delimiter | 233 | generic comment delimiter matches @emph{any} generic comment |
| 265 | matches @emph{any} generic comment delimiter, but they cannot match | 234 | delimiter, but they cannot match a comment starter or comment ender; |
| 266 | a comment starter or comment ender; generic comment delimiters can only | 235 | generic comment delimiters can only match each other. |
| 267 | match each other. | ||
| 268 | 236 | ||
| 269 | This syntax class is primarily meant for use with the | 237 | This 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 |
| 271 | mark any range of characters as forming a comment, by giving the first | 239 | can mark any range of characters as forming a comment, by giving the |
| 272 | and last characters of the range @code{syntax-table} properties | 240 | first and last characters of the range @code{syntax-table} properties |
| 273 | identifying them as generic comment delimiters. | 241 | identifying them as generic comment delimiters. |
| 274 | @end deffn | ||
| 275 | 242 | ||
| 276 | @deffn {Syntax class} @w{generic string delimiter} | 243 | @item Generic string delimiters: @samp{|} |
| 277 | A @dfn{generic string delimiter} (designated by @samp{|}) starts or ends | 244 | Characters that start or end a string. This class differs from the |
| 278 | a string. This class differs from the string quote class in that @emph{any} | 245 | string quote class in that @emph{any} generic string delimiter can |
| 279 | generic string delimiter can match any other generic string delimiter; but | 246 | match any other generic string delimiter; but they do not match |
| 280 | they do not match ordinary string quote characters. | 247 | ordinary string quote characters. |
| 281 | 248 | ||
| 282 | This syntax class is primarily meant for use with the | 249 | This 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 |
| 284 | mark any range of characters as forming a string constant, by giving the | 251 | can mark any range of characters as forming a string constant, by |
| 285 | first and last characters of the range @code{syntax-table} properties | 252 | giving the first and last characters of the range @code{syntax-table} |
| 286 | identifying them as generic string delimiters. | 253 | properties 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 |
| 421 | This function sets the syntax entry for @var{char} according to | 388 | This 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 |
| 423 | cell of the form @code{(@var{min} . @var{max})}; in the latter case, | 390 | cell of the form @code{(@var{min} . @var{max})}; in the latter case, |
| 424 | the function sets the syntax entries for all characters in the range | 391 | the function sets the syntax entries for all characters in the range |
| 425 | between @var{min} and @var{max}, inclusive. | 392 | between @var{min} and @var{max}, inclusive. |
| 426 | 393 | ||
| 427 | The syntax is changed only for @var{table}, which defaults to the | 394 | The syntax is changed only for @var{table}, which defaults to the |
| 428 | current buffer's syntax table, and not in any other syntax table. The | 395 | current buffer's syntax table, and not in any other syntax table. |
| 429 | argument @var{syntax-descriptor} specifies the desired syntax; this is | 396 | |
| 430 | a string beginning with a class designator character, and optionally | 397 | The argument @var{syntax-descriptor} is a syntax descriptor for the |
| 431 | containing a matching character and flags as well. @xref{Syntax | 398 | desired syntax (i.e.@: a string beginning with a class designator |
| 432 | Descriptors}. | 399 | character, and optionally containing a matching character and syntax |
| 400 | flags). An error is signaled if the first character is not one of the | ||
| 401 | seventeen syntax class designators. @xref{Syntax Descriptors}. | ||
| 433 | 402 | ||
| 434 | This function always returns @code{nil}. The old syntax information in | 403 | This function always returns @code{nil}. The old syntax information in |
| 435 | the table for this character is discarded. | 404 | the table for this character is discarded. |
| 436 | 405 | ||
| 437 | An error is signaled if the first character of the syntax descriptor is not | ||
| 438 | one of the seventeen syntax class designator characters. An error is also | ||
| 439 | signaled 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 | ||
| 536 | When the syntax table is not flexible enough to specify the syntax of | 501 | When the syntax table is not flexible enough to specify the syntax of |
| 537 | a language, you can use @code{syntax-table} text properties to | 502 | a language, you can override the syntax table for specific character |
| 538 | override the syntax table for specific character occurrences in the | 503 | occurrences in the buffer, by applying a @code{syntax-table} text |
| 539 | buffer. @xref{Text Properties}. You can use Font Lock mode to set | 504 | property. @xref{Text Properties}, for how to apply text properties. |
| 540 | @code{syntax-table} text properties. @xref{Setting Syntax | ||
| 541 | Properties}. | ||
| 542 | 505 | ||
| 543 | The 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} |
| 547 | If the property value is a syntax table, that table is used instead of | 510 | If the property value is a syntax table, that table is used instead of |
| 548 | the current buffer's syntax table to determine the syntax for this | 511 | the current buffer's syntax table to determine the syntax for the |
| 549 | occurrence of the character. | 512 | underlying text character. |
| 550 | 513 | ||
| 551 | @item @code{(@var{syntax-code} . @var{matching-char})} | 514 | @item @code{(@var{syntax-code} . @var{matching-char})} |
| 552 | A cons cell of this format specifies the syntax for this | 515 | A cons cell of this format specifies the syntax for the underlying |
| 553 | occurrence of the character. (@pxref{Syntax Table Internals}) | 516 | text character. (@pxref{Syntax Table Internals}) |
| 554 | 517 | ||
| 555 | @item @code{nil} | 518 | @item @code{nil} |
| 556 | If the property is @code{nil}, the character's syntax is determined from | 519 | If 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 |
| 561 | If this is non-@code{nil}, the syntax scanning functions pay attention | 524 | If this is non-@code{nil}, the syntax scanning functions, like |
| 562 | to syntax text properties. Otherwise they use only the current syntax | 525 | @code{forward-sexp}, pay attention to syntax text properties. |
| 563 | table. | 526 | Otherwise they use only the current syntax table. |
| 527 | @end defvar | ||
| 528 | |||
| 529 | @defvar syntax-propertize-function | ||
| 530 | This variable, if non-@code{nil}, should store a function for applying | ||
| 531 | @code{syntax-table} properties to a specified stretch of text. It is | ||
| 532 | intended to be used by major modes to install a function which applies | ||
| 533 | @code{syntax-table} properties in some mode-appropriate way. | ||
| 534 | |||
| 535 | The function is called by @code{syntax-ppss} (@pxref{Position Parse}), | ||
| 536 | and by Font Lock mode during syntactic fontification (@pxref{Syntactic | ||
| 537 | Font Lock}). It is called with two arguments, @var{start} and | ||
| 538 | @var{end}, which are the starting and ending positions of the text on | ||
| 539 | which it should act. It is allowed to call @code{syntax-ppss} on any | ||
| 540 | position 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 | ||
| 543 | earlier position. | ||
| 544 | @end defvar | ||
| 545 | |||
| 546 | @defvar syntax-propertize-extend-region-functions | ||
| 547 | This abnormal hook is run by the syntax parsing code prior to calling | ||
| 548 | @code{syntax-propertize-function}. Its role is to help locate safe | ||
| 549 | starting and ending buffer positions for passing to | ||
| 550 | @code{syntax-propertize-function}. For example, a major mode can add | ||
| 551 | a function to this hook to identify multi-line syntactic constructs, | ||
| 552 | and ensure that the boundaries do not fall in the middle of one. | ||
| 553 | |||
| 554 | Each function in this hook should accept two arguments, @var{start} | ||
| 555 | and @var{end}. It should return either a cons cell of two adjusted | ||
| 556 | buffer positions, @code{(@var{new-start} . @var{new-end})}, or | ||
| 557 | @code{nil} if no adjustment is necessary. The hook functions are run | ||
| 558 | in 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 | |||
| 611 | on languages other than Lisp. Basically, a sexp is either a balanced | 606 | on languages other than Lisp. Basically, a sexp is either a balanced |
| 612 | parenthetical grouping, a string, or a ``symbol'' (i.e.@: a sequence | 607 | parenthetical grouping, a string, or a ``symbol'' (i.e.@: a sequence |
| 613 | of characters whose syntax is either word constituent or symbol | 608 | of characters whose syntax is either word constituent or symbol |
| 614 | constituent). However, characters whose syntax is expression prefix | 609 | constituent). However, characters in the expression prefix syntax |
| 615 | are treated as part of the sexp if they appear next to it. | 610 | class (@pxref{Syntax Class Table}) are treated as part of the sexp if |
| 611 | they 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 |
| 618 | functions can be used for Lisp expressions when in Lisp mode and for C | 614 | functions 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 | |||
| 654 | from position @var{from}. It returns the position where the scan stops. | 650 | from position @var{from}. It returns the position where the scan stops. |
| 655 | If @var{count} is negative, the scan moves backwards. | 651 | If @var{count} is negative, the scan moves backwards. |
| 656 | 652 | ||
| 657 | If @var{depth} is nonzero, parenthesis depth counting begins from that | 653 | If @var{depth} is nonzero, assume that the starting point is already |
| 658 | value. The only candidates for stopping are places where the depth in | 654 | @var{depth} parentheses deep. This function counts out @var{count} |
| 659 | parentheses becomes zero; @code{scan-lists} counts @var{count} such | 655 | number of points where the parenthesis depth goes back to zero, then |
| 660 | places and then stops. Thus, a positive value for @var{depth} means go | 656 | stops. Thus, a positive value for @var{depth} has the effect of |
| 661 | out @var{depth} levels of parenthesis. | 657 | moving out @var{depth} levels of parenthesis, whereas a negative |
| 658 | @var{depth} has the effect of moving deeper by @var{-depth} levels of | ||
| 659 | parenthesis. | ||
| 662 | 660 | ||
| 663 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is | 661 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is |
| 664 | non-@code{nil}. | 662 | non-@code{nil}. |
| @@ -699,12 +697,12 @@ expected, with nothing except whitespace between them, it returns | |||
| 699 | This function cannot tell whether the ``comments'' it traverses are | 697 | This function cannot tell whether the ``comments'' it traverses are |
| 700 | embedded within a string. If they look like comments, it treats them | 698 | embedded within a string. If they look like comments, it treats them |
| 701 | as comments. | 699 | as comments. |
| 702 | @end defun | ||
| 703 | 700 | ||
| 704 | To move forward over all comments and whitespace following point, use | 701 | To 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 |
| 706 | argument to use, because the number of comments in the buffer cannot | 703 | good argument to use, because the number of comments in the buffer |
| 707 | exceed that many. | 704 | cannot 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 | |||
| 714 | position. This function does that conveniently. | 712 | position. This function does that conveniently. |
| 715 | 713 | ||
| 716 | @defun syntax-ppss &optional pos | 714 | @defun syntax-ppss &optional pos |
| 717 | This function returns the parser state (see next section) that the | 715 | This function returns the parser state that the parser would reach at |
| 718 | parser would reach at position @var{pos} starting from the beginning | 716 | position @var{pos} starting from the beginning of the buffer. |
| 719 | of 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 | 718 | See the next section for |
| 721 | to 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 |
| 723 | depth) of the returned parser state are not meaningful. | 721 | @xref{Parser State}, |
| 724 | @end defun | 722 | @end ifnottex |
| 725 | 723 | for 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 | 725 | The return value is the same as if you call the low-level parsing |
| 728 | updating can fail if @code{syntax-ppss} is called while | 726 | function @code{parse-partial-sexp} to parse from the beginning of the |
| 727 | buffer to @var{pos} (@pxref{Low-Level Parsing}). However, | ||
| 728 | @code{syntax-ppss} uses a cache to speed up the computation. Due to | ||
| 729 | this optimization, the second value (previous complete subexpression) | ||
| 730 | and sixth value (minimum parenthesis depth) in the returned parser | ||
| 731 | state are not meaningful. | ||
| 732 | |||
| 733 | This 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 | ||
| 736 | cache consistent as the buffer is modified. However, the cache might | ||
| 737 | not 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 |
| 730 | buffer is modified without obeying the hook, such as when using | 739 | buffer 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 |
| 732 | necessary to flush the cache manually. | 741 | call @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 |
| 735 | This function flushes the cache used by @code{syntax-ppss}, starting | 745 | This 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 |
| 758 | state of parsing text syntactically as part of an expression. The | 768 | of the syntactic parser, after it parses the text between a specified |
| 759 | parsing functions in the following sections return a parser state as | 769 | starting point and a specified end point in the buffer. Parsing |
| 760 | the value, and in some cases accept one as an argument also, so that | 770 | functions such as @code{syntax-ppss} |
| 761 | you can resume parsing after it stops. Here are the meanings of the | 771 | @ifnottex |
| 762 | elements of the parser state: | 772 | (@pxref{Position Parse}) |
| 773 | @end ifnottex | ||
| 774 | return a parser state as the value. Some parsing functions accept a | ||
| 775 | parser 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 |
| 766 | The depth in parentheses, counting from 0. @strong{Warning:} this can | 781 | The depth in parentheses, counting from 0. @strong{Warning:} this can |
| 767 | be negative if there are more close parens than open parens between | 782 | be negative if there are more close parens than open parens between |
| 768 | the start of the defun and point. | 783 | the 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; |
| 789 | or the comment nesting level if inside a kind of comment | 804 | @pxref{Syntax Flags}); or the comment nesting level if inside a |
| 790 | that can be nested. | 805 | comment 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 |
| 797 | The minimum parenthesis depth encountered during this scan. | 812 | The minimum parenthesis depth encountered during this scan. |
| 798 | 813 | ||
| 799 | @item | 814 | @item |
| 800 | What kind of comment is active: @code{nil} for a comment of style | 815 | What 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 | 816 | comment 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 | 817 | comment of style @samp{c}; and @code{syntax-table} for a comment that |
| 803 | generic comment delimiter character. | 818 | should be ended by a generic comment delimiter character. |
| 804 | 819 | ||
| 805 | @item | 820 | @item |
| 806 | The string or comment start position. While inside a comment, this is | 821 | The 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 |
| 818 | argument to continue parsing, and elements 8 and 9 are used only in | 833 | argument to continue parsing, and elements 8 and 9 are used only in |
| 819 | trivial cases. Those elements serve primarily to convey information | 834 | trivial cases. Those elements are mainly used internally by the |
| 820 | to the Lisp program which does the parsing. | 835 | parser 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 |
| 823 | parser state using this function: | 838 | parser 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 |
| 305 | variable's global value, i.e.@: the value outside of any lexical | 305 | variable's global value, i.e.@: the value outside of any lexical |
| 306 | binding contruct. When a variable is lexically bound, the local value | 306 | binding construct. When a variable is lexically bound, the local value |
| 307 | is determined by the lexical environment; the variable may have a | 307 | is determined by the lexical environment; the variable may have a |
| 308 | local value if its symbol's value cell is unassigned. | 308 | local 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 | ||
| 679 | Command Loop | 680 | Command 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 | ||
| 678 | Command Loop | 679 | Command 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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> | 6 | 2012-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 | |||
| 129 | machine is often disconnected from the internet. | 130 | machine 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 |
| 133 | this should be described for each mail user agent; for the default | 134 | have not configured anything, then in Emacs 24.1 and later the first |
| 134 | mail user agent the variable @code{send-mail-function} (@pxref{Mail | 135 | time you try to send a mail Emacs will ask how you want to send |
| 135 | Sending,,,emacs}) is used; for the Message and Gnus user agents the | 136 | mail. To use this library, answer @samp{smtp} when prompted. Emacs |
| 136 | variable @code{message-send-mail-function} (@pxref{Mail | 137 | then asks for the name of the SMTP server. |
| 137 | Variables,,,message}) is used. | 138 | |
| 138 | 139 | If you prefer, or if you are using a non-standard mail user agent, | |
| 139 | @example | 140 | you can configure this yourself. The normal way to do this is to set |
| 140 | ;; If you use the default mail user agent. | 141 | the variable @code{send-mail-function} (@pxref{Mail |
| 142 | Sending,,,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 |
| 149 | The default value for this variable is @code{sendmail-query-once}, | ||
| 150 | which interactively asks how you want to send mail. | ||
| 151 | |||
| 152 | Your mail user agent might use a different variable for this purpose. | ||
| 153 | It should inherit from @code{send-mail-function}, but if it does not, | ||
| 154 | or if you prefer, you can set that variable directly. Consult your | ||
| 155 | mail 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 |
| 147 | to use. Your system administrator should provide you with this | 159 | to use. Your system administrator or mail service provider should |
| 148 | information, but often it is the same as the server you receive mail | 160 | supply this information. Often it is some variant of the server you |
| 149 | from. | 161 | receive mail from. If your email address is |
| 162 | @samp{yourname@@example.com}, then the name of the SMTP server is | ||
| 163 | may 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 | ||
| 220 | Most SMTP servers require clients to authenticate themselves before | ||
| 221 | they are allowed to send mail. Authentication usually involves | ||
| 222 | supplying a user name and password. | ||
| 223 | |||
| 224 | If you have not configured anything, then the first time you try to | ||
| 225 | send mail via a server, Emacs (version 24.1 and later) prompts you | ||
| 226 | for the user name and password to use, and then offers to save the | ||
| 227 | information. By default, Emacs stores authentication information in | ||
| 228 | a file @file{~/.authinfo}. | ||
| 229 | |||
| 230 | @cindex authinfo | ||
| 231 | The basic format of the @file{~/.authinfo} file is one line for each | ||
| 232 | set of credentials. Each line consists of pairs of variables and | ||
| 233 | values. A simple example would be: | ||
| 234 | |||
| 235 | @smallexample | ||
| 236 | machine mail.example.org port 25 login myuser password mypassword | ||
| 237 | @end smallexample | ||
| 238 | |||
| 239 | @noindent | ||
| 240 | This specifies that when using the SMTP server called @samp{mail.example.org} | ||
| 241 | on port 25, Emacs should send the user name @samp{myuser} and the | ||
| 242 | password @samp{mypassword}. Either or both of the login and password | ||
| 243 | fields may be absent, in which case Emacs prompts for the information | ||
| 244 | when 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 | ||
| 249 | searches the @file{~/.authinfo} file for a matching entry. If an | ||
| 250 | entry is found, the authentication process is invoked and the | ||
| 251 | credentials are used. If the variable @code{smtpmail-smtp-user} is | ||
| 252 | set to a non-@code{nil} value, then only entries for that user are | ||
| 253 | considered. For more information on the @file{~/.authinfo} | ||
| 254 | file, @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 |
| 260 | The process by which the SMTP library authenticates you to the server | ||
| 261 | is known as ``Simple Authentication and Security Layer'' (SASL). | ||
| 262 | There are various SASL mechanisms, and this library supports three of | ||
| 263 | them: CRAM-MD5, PLAIN, and LOGIN. It tries each of them, in that order, | ||
| 264 | until one succeeds. The first uses a form of encryption to obscure | ||
| 265 | your 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 |
| 210 | Many environments require SMTP clients to authenticate themselves | 274 | For greater security, you can encrypt your connection to the SMTP |
| 211 | before they are allowed to route mail via a server. The two following | 275 | server. If this is to work, both Emacs and the server must support it. |
| 212 | variables contains the authentication information needed for this. | 276 | |
| 213 | 277 | The SMTP library supports the ``Transport Layer Security'' (TLS), and | |
| 214 | The first variable, @code{smtpmail-auth-credentials}, instructs the | 278 | the older ``Secure Sockets Layer'' (SSL) encryption mechanisms. |
| 215 | SMTP library to use a SASL authentication step, currently only the | 279 | It also supports STARTTLS, which is a variant of TLS in which the |
| 216 | CRAM-MD5 and LOGIN mechanisms are supported and will be selected in | 280 | initial connection to the server is made in plain text, requesting a |
| 217 | that order if the server support both. | 281 | switch to an encrypted channel for the rest of the process. |
| 218 | 282 | ||
| 219 | The second variable, @code{smtpmail-starttls-credentials}, instructs | 283 | @vindex smtpmail-stream-type |
| 220 | the SMTP library to connect to the server using STARTTLS. This means | 284 | The variable @code{smtpmail-stream-type} controls what form of |
| 221 | the protocol exchange may be integrity protected and confidential by | 285 | connection the SMTP library uses. The default value is @code{nil}, |
| 222 | using the Transport Layer Security (TLS) protocol, and optionally also | 286 | which means to use a plain connection, but try to switch to a STARTTLS |
| 223 | authentication of the client and server. | 287 | encrypted connection if the server supports it. Other possible values |
| 224 | 288 | are: @code{starttls} - insist on STARTTLS; @code{ssl} - use TLS/SSL; | |
| 225 | TLS is a security protocol that is also known as SSL, although | 289 | and @code{plain} - no encryption. |
| 226 | strictly speaking, SSL is an older variant of TLS. TLS is backwards | 290 | |
| 227 | compatible with SSL. In most mundane situations, the two terms are | 291 | Use of any form of TLS/SSL requires support in Emacs. You can either |
| 228 | equivalent. | 292 | use 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 | |
| 230 | The TLS feature uses the elisp package @file{starttls.el} (see it for | 294 | @footnote{@url{http://www.gnu.org/software/gnutls/}} library. |
| 231 | more information on customization), which in turn require that at | 295 | If your Emacs has GnuTLS support built-in, the function |
| 232 | least one of the following external tools are installed: | 296 | @code{gnutls-available-p} is defined and returns non-@code{nil}. |
| 297 | Otherwise, you must use the @file{starttls.el} library (see that file for | ||
| 298 | more information on customization options, etc.). The Lisp library | ||
| 299 | requires one of the following external tools to be installed: | ||
| 233 | 300 | ||
| 234 | @enumerate | 301 | @enumerate |
| 235 | @item | 302 | @item |
| 236 | The GnuTLS command line tool @samp{gnutls-cli}, you can get it from | 303 | The 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 |
| 238 | tool, mainly because it can verify the server certificates. | 305 | tool, mainly because it can verify server certificates. |
| 239 | 306 | ||
| 240 | @item | 307 | @item |
| 241 | The @samp{starttls} external program, you can get it from | 308 | The @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 | ||
| 245 | It is not uncommon to use both these mechanisms, e.g., to use STARTTLS | 312 | @cindex certificates |
| 246 | to achieve integrity and confidentiality and then use SASL for client | 313 | @cindex keys |
| 247 | authentication. | 314 | The SMTP server may also request that you verify your identity by |
| 315 | sending a certificate and the associated encryption key to the server. | ||
| 316 | If 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 | 319 | machine 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 | ||
| 253 | hostname, port, username and password tuples. When the SMTP library | ||
| 254 | connects to a host on a certain port, this variable is searched to | ||
| 255 | find a matching entry for that hostname and port. If an entry is | ||
| 256 | found, the authentication process is invoked and the credentials are | ||
| 257 | used. | ||
| 258 | |||
| 259 | The hostname field follows the same format as | ||
| 260 | @code{smtpmail-smtp-server} (i.e., a string) and the port field the | ||
| 261 | same format as @code{smtpmail-smtp-service} (i.e., a string or an | ||
| 262 | integer). The username and password fields, which either can be | ||
| 263 | @code{nil} to indicate that the user is prompted for the value | ||
| 264 | interactively, should be strings with the username and password, | ||
| 265 | respectively, information that is normally provided by system | ||
| 266 | administrators. | ||
| 267 | |||
| 268 | @item smtpmail-starttls-credentials | ||
| 269 | @vindex smtpmail-starttls-credentials | ||
| 270 | The variable @code{smtpmail-starttls-credentials} contains a list of | ||
| 271 | tuples with hostname, port, name of file containing client key, and | ||
| 272 | name of file containing client certificate. The processing is similar | ||
| 273 | to 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 | ||
| 277 | The 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 |
| 279 | server name (@code{smtpmail-smtp-server}) is @var{hostname}, the | 324 | prior to Emacs 24.1.) |
| 280 | server port (@code{smtpmail-smtp-service}) is @var{port}, and the | ||
| 281 | username and password are @var{username} and @var{password} | ||
| 282 | respectively. | ||
| 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 |
| @@ -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 | +++ |
| 145 | mail server supports them. It also uses the auth-source framework for | 145 | **** smtpmail now uses encrypted connections (via STARTTLS) by default |
| 146 | getting credentials. | 146 | if the mail server supports them. This uses either built-in GnuTLS |
| 147 | support, or the starttls.el library. Customize `smtpmail-stream-type' | ||
| 148 | to change this. | ||
| 147 | 149 | ||
| 150 | +++ | ||
| 148 | **** The variable `smtpmail-auth-credentials' has been removed. | 151 | **** The variable `smtpmail-auth-credentials' has been removed. |
| 149 | That variable used to have the default value "~/.authinfo", in which | 152 | By default, the information is now stored in the file ~/.authinfo. |
| 150 | case you won't see any difference. But if you changed it to be a list | 153 | This was the default value of smtpmail-auth-credentials. |
| 151 | of user names and passwords, that setting is now ignored; you will be | 154 | If you had customized smtpmail-auth-credentials to a list of user |
| 152 | prompted for the user name and the password, which will then be saved | 155 | names and passwords, those settings will not be used. Your first |
| 153 | to ~/.authinfo. (To control where and how the credentials are stored, | 156 | connection to the smtp server will prompt for the user name and password, |
| 154 | see the auth-source manual. You may want to change the auth-source | 157 | and then offer to save them to the ~/.authinfo file. Or you can |
| 155 | preferences if you want to store the credentials encrypted, for | 158 | manually copy the credentials to your ~/.authinfo files. For example, |
| 156 | instance.) | 159 | if you had |
| 157 | |||
| 158 | You can also manually copy the credentials to your ~/.authinfo file. | ||
| 159 | For 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 | ||
| 168 | See the auth-source manual for more information, e.g. on encrypting | ||
| 169 | the credentials file. | ||
| 170 | |||
| 171 | +++ | ||
| 168 | **** The variable `smtpmail-starttls-credentials' has been removed. | 172 | **** The variable `smtpmail-starttls-credentials' has been removed. |
| 169 | 173 | ||
| 170 | If you had that set, then you need to put | 174 | If 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: |
| 1108 | sc.el, x-menu.el, rnews.el, rnewspost.el | 1112 | sc.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 | ||
| 1116 | mechanism is now based on the package concept. The variable | ||
| 1117 | finder-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 |
| 1283 | text terminal display, via a char-table entry that is a cons cell. | 1290 | text 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. |
| 1286 | It now accepts an optional `:type' parameter for initiating a TLS | 1294 | It now accepts an optional `:type' parameter for initiating a TLS |
| 1287 | connection, directly or via STARTTLS. To do STARTTLS, additional | 1295 | connection, 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, | |||
| 1341 | not just image libraries. The previous name is still available as an | 1349 | not just image libraries. The previous name is still available as an |
| 1342 | obsolete alias. | 1350 | obsolete alias. |
| 1343 | 1351 | ||
| 1352 | +++ | ||
| 1344 | ** New variable `syntax-propertize-function'. | 1353 | ** New variable `syntax-propertize-function'. |
| 1345 | This replaces `font-lock-syntactic-keywords' which is now obsolete. | 1354 | This replaces `font-lock-syntactic-keywords' which is now obsolete. |
| 1346 | This allows syntax-table properties to be set independently from font-lock: | 1355 | This 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. |
| 1425 | This requires Emacs to be built with ImageMagick support. | 1434 | This requires Emacs to be built with ImageMagick support. |
| 1426 | Then the function `imagemagick-types' returns a list of image file | 1435 | If your Emacs has ImageMagick support, then the function |
| 1436 | `imagemagick-types' is defined, and returns a list of image file | ||
| 1427 | extensions that your installation of ImageMagick supports. The | 1437 | extensions that your installation of ImageMagick supports. The |
| 1428 | function `imagemagick-register-types' enables ImageMagick support for | 1438 | function `imagemagick-register-types' enables ImageMagick support for |
| 1429 | these image types, minus those listed in `imagemagick-types-inhibit'. | 1439 | these 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'. |
| 1449 | This requires Emacs to have been built with GnuTLS support. | 1459 | This requires Emacs to have been built with GnuTLS support. |
| 1450 | The main functions are `open-gnutls-stream' and `gnutls-negotiate'. | 1460 | If your Emacs has GnuTLS support, the function gnutls-available-p is |
| 1451 | It's easiest to use these functions through `open-network-stream' | 1461 | defined and returns non-nil. The main functions are `open-gnutls-stream' |
| 1452 | because it can upgrade connections through STARTTLS opportunistically | 1462 | and `gnutls-negotiate'. It's easiest to use these functions through |
| 1453 | or 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. | 1464 | STARTTLS opportunistically or use plain SSL, depending on your needs. |
| 1465 | For 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 @@ | |||
| 1 | 2012-02-16 Kenichi Handa <handa@m17n.org> | 1 | 2012-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 | ||
| 8 | 2012-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 | |||
| 13 | 2012-02-15 Glenn Morris <rgm@gnu.org> | ||
| 14 | |||
| 15 | * shell.el (shell-delimiter-argument-list): | ||
| 16 | Revert 2011-02-17 change. (Bug#8027) | ||
| 17 | |||
| 18 | 2012-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 | |||
| 24 | 2012-02-15 Glenn Morris <rgm@gnu.org> | ||
| 25 | |||
| 26 | * mail/smtpmail.el (smtpmail-smtp-user, smtpmail-stream-type): | ||
| 27 | Doc fixes. | ||
| 28 | |||
| 8 | 2012-02-14 Glenn Morris <rgm@gnu.org> | 29 | 2012-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 | |||
| 208 | Customize can re-evaluate it later to get the standard value. | 208 | Customize can re-evaluate it later to get the standard value. |
| 209 | DOC is the variable documentation. | 209 | DOC is the variable documentation. |
| 210 | 210 | ||
| 211 | The remaining arguments should have the form | 211 | This macro uses `defvar' as a subroutine, which also marks the |
| 212 | variable as \"special\", so that it is always dynamically bound | ||
| 213 | even when `lexical-binding' is t. | ||
| 214 | |||
| 215 | The 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 @@ | |||
| 1 | 2012-02-16 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * gnus-start.el (gnus-1): Avoid duplicate entries. | ||
| 4 | |||
| 5 | 2012-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 | |||
| 10 | 2012-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 | |||
| 1 | 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> | 15 | 2012-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. |
| 90 | If 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. |
| 103 | This may be either nil (possibly upgraded to STARTTLS if | 104 | This may be either nil (possibly upgraded to STARTTLS if possible), |
| 104 | possible), or `starttls' (refuse to send if STARTTLS isn't | 105 | or `starttls' (refuse to send if STARTTLS isn't available), or `plain' |
| 105 | available), or `plain' (never use STARTTLS), or `ssl' (to use | 106 | \(never use STARTTLS), or `ssl' (to use TLS/SSL)." |
| 106 | TLS/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." | |||
| 1550 | Each function on this hook is called in turns without any argument and should | 1550 | Each function on this hook is called in turns without any argument and should |
| 1551 | return either nil to mean that it is not applicable at point, | 1551 | return either nil to mean that it is not applicable at point, |
| 1552 | or a function of no argument to perform completion (discouraged), | 1552 | or a function of no argument to perform completion (discouraged), |
| 1553 | or a list of the form (START END COLLECTION &rest PROPS) where | 1553 | or 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. |
| 1557 | Currently supported properties are all the properties that can appear in | 1557 | Currently 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. |
| 158 | This variable is used to initialize `comint-delimiter-argument-list' in the | 158 | This variable is used to initialize `comint-delimiter-argument-list' in the |
| 159 | shell buffer. The value may depend on the operating system or shell." | 159 | shell 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 @@ | |||
| 1 | 2012-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 | |||
| 6 | 2012-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 | |||
| 1 | 2012-02-13 Andreas Schwab <schwab@linux-m68k.org> | 11 | 2012-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 | ||
| 781 | DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, | 781 | DEFUN ("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. |
| 783 | You are not required to define a variable in order to use it, | 783 | You are not required to define a variable in order to use it, but |
| 784 | but the definition can supply documentation and an initial value | 784 | defining it lets you supply an initial value and documentation, which |
| 785 | in a way that tags can recognize. | 785 | can be referred to by the Emacs help facilities and other programming |
| 786 | 786 | tools. The `defvar' form also declares the variable as \"special\", | |
| 787 | INITVALUE is evaluated, and used to set SYMBOL, only if SYMBOL's value is void. | 787 | so that it is always dynamically bound even if `lexical-binding' is t. |
| 788 | If SYMBOL is buffer-local, its default value is what is set; | 788 | |
| 789 | buffer-local values are not affected. | 789 | The optional argument INITVALUE is evaluated, and used to set SYMBOL, |
| 790 | INITVALUE and DOCSTRING are optional. | 790 | only if SYMBOL's value is void. If SYMBOL is buffer-local, its |
| 791 | If DOCSTRING starts with *, this variable is identified as a user option. | 791 | default 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'. | ||
| 794 | If INITVALUE is missing, SYMBOL's value is not set. | 792 | If INITVALUE is missing, SYMBOL's value is not set. |
| 795 | 793 | ||
| 796 | If SYMBOL has a local binding, then this form affects the local | 794 | If 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 |
| 800 | for these variables. \(`defconst' and `defcustom' behave similarly in | 798 | for these variables. \(`defconst' and `defcustom' behave similarly in |
| 801 | this respect.) | 799 | this respect.) |
| 800 | |||
| 801 | The optional argument DOCSTRING is a documentation string for the | ||
| 802 | variable. | ||
| 803 | |||
| 804 | To define a user option, use `defcustom' instead of `defvar'. | ||
| 805 | The function `user-variable-p' also identifies a variable as a user | ||
| 806 | option if its DOCSTRING starts with *, but this behavior is obsolete. | ||
| 802 | usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | 807 | usage: (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 | ||
| 874 | DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, | 879 | DEFUN ("defconst", Fdefconst, Sdefconst, 2, UNEVALLED, 0, |
| 875 | doc: /* Define SYMBOL as a constant variable. | 880 | doc: /* Define SYMBOL as a constant variable. |
| 876 | The intent is that neither programs nor users should ever change this value. | 881 | This declares that neither programs nor users should ever change the |
| 877 | Always sets the value of SYMBOL to the result of evalling INITVALUE. | 882 | value. This constancy is not actually enforced by Emacs Lisp, but |
| 878 | If SYMBOL is buffer-local, its default value is what is set; | 883 | SYMBOL is marked as a special variable so that it is never lexically |
| 879 | buffer-local values are not affected. | 884 | bound. |
| 880 | DOCSTRING is optional. | 885 | |
| 881 | 886 | The `defconst' form always sets the value of SYMBOL to the result of | |
| 882 | If SYMBOL has a local binding, then this form sets the local binding's | 887 | evalling INITVALUE. If SYMBOL is buffer-local, its default value is |
| 883 | value. However, you should normally not make local bindings for | 888 | what is set; buffer-local values are not affected. If SYMBOL has a |
| 884 | variables defined with this form. | 889 | local binding, then this form sets the local binding's value. |
| 890 | However, you should normally not make local bindings for variables | ||
| 891 | defined with this form. | ||
| 892 | |||
| 893 | The optional DOCSTRING specifies the variable's documentation string. | ||
| 885 | usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) | 894 | usage: (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 | ||
| 977 | static void free_image (struct frame *f, struct image *img); | 977 | static 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 | ||