diff options
| author | Chong Yidong | 2012-09-30 17:18:38 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-09-30 17:18:38 +0800 |
| commit | 48de8b12215e22390db1bc822e809708070ab938 (patch) | |
| tree | 125595be25583796bec86a019f75c8049164133e | |
| parent | 5938d5196d09aff887aa74603c102b1f303a613a (diff) | |
| download | emacs-48de8b12215e22390db1bc822e809708070ab938.tar.gz emacs-48de8b12215e22390db1bc822e809708070ab938.zip | |
Update docs for a bunch of 24.3 changes.
* doc/emacs/killing.texi (Rectangles): Document copy-rectangle-as-kill.
* doc/emacs/search.texi (Special Isearch): Document the lax space search
feature and M-s SPC.
(Regexp Search): Move main search-whitespace-regexp description to
Special Isearch.
(Replace): Document replace-lax-whitespace.
* doc/emacs/basic.texi (Position Info): Document C-u M-=.
(Moving Point): Document move-to-column.
* doc/emacs/display.texi (Useless Whitespace): Add delete-trailing-lines.
* doc/emacs/misc.texi (emacsclient Options): Document the effect of
initial-buffer-choice on client frames. Document server-auth-dir.
Do not document server-host, which is bad security practice.
* doc/emacs/building.texi (Lisp Libraries): Docstring lookups can trigger
autoloading. Document help-enable-auto-load.
* doc/emacs/mini.texi (Yes or No Prompts): New node.
* doc/emacs/ack.texi (Acknowledgments): Remove obsolete packages.
* doc/lispref/commands.texi (Click Events): Define "mouse position list".
Remove mention of unimplemented horizontal scroll bars.
(Drag Events, Motion Events): Refer to "mouse position list".
(Accessing Mouse): Document posnp.
* doc/lispref/errors.texi (Standard Errors): Tweak arith-error description.
Tweak markup. Remove domain-error and friends, which seem to be
unused after the floating-point code revamp.
* doc/lispref/functions.texi (Obsolete Functions): Obsolescence also affects
documentation commands. Various clarifications.
(Declare Form): New node.
* doc/lispref/loading.texi (Autoload):
* doc/lispref/help.texi (Documentation Basics): The special sequences can
trigger autoloading.
* doc/lispref/macros.texi (Defining Macros): Move description of `declare' to
Declare Form node.
* doc/lispref/numbers.texi (Integer Basics): Copyedits.
(Float Basics): Consider IEEE floating point always available.
(Random Numbers): Document actual limits.
(Arithmetic Operations): Clarify division by zero. Don't mention
the machine-independence of negative division since it does not
happen in practice.
* doc/lispref/os.texi (Idle Timers): Minor clarifications.
(User Identification): Add system-users and system-groups.
* doc/lispref/strings.texi (String Basics): Copyedits.
* lisp/minibuffer.el (minibuffer-local-filename-syntax): Doc fix.
* lisp/server.el (server-host): Document the security implications.
(server-auth-key): Doc fix.
* lisp/startup.el (initial-buffer-choice): Doc fix.
* src/fns.c (Frandom): Doc fix.
31 files changed, 754 insertions, 540 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index e0ed850c394..c1894fb900b 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2012-09-30 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * killing.texi (Rectangles): Document copy-rectangle-as-kill. | ||
| 4 | |||
| 5 | * search.texi (Special Isearch): Document the lax space search | ||
| 6 | feature and M-s SPC. | ||
| 7 | (Regexp Search): Move main search-whitespace-regexp description to | ||
| 8 | Special Isearch. | ||
| 9 | (Replace): Document replace-lax-whitespace. | ||
| 10 | |||
| 11 | * basic.texi (Position Info): Document C-u M-=. | ||
| 12 | (Moving Point): Document move-to-column. | ||
| 13 | |||
| 14 | * display.texi (Useless Whitespace): Add delete-trailing-lines. | ||
| 15 | |||
| 16 | * misc.texi (emacsclient Options): Document the effect of | ||
| 17 | initial-buffer-choice on client frames. Document server-auth-dir. | ||
| 18 | Do not document server-host, which is bad security practice. | ||
| 19 | |||
| 20 | * building.texi (Lisp Libraries): Docstring lookups can trigger | ||
| 21 | autoloading. Document help-enable-auto-load. | ||
| 22 | |||
| 23 | * mini.texi (Yes or No Prompts): New node. | ||
| 24 | |||
| 25 | * ack.texi (Acknowledgments): Remove obsolete packages. | ||
| 26 | |||
| 1 | 2012-09-27 Glenn Morris <rgm@gnu.org> | 27 | 2012-09-27 Glenn Morris <rgm@gnu.org> |
| 2 | 28 | ||
| 3 | * cal-xtra.texi (Advanced Calendar/Diary Usage): | 29 | * cal-xtra.texi (Advanced Calendar/Diary Usage): |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index 487e3c19c16..8d1e4221a6c 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -644,10 +644,9 @@ statically scoped Emacs lisp. | |||
| 644 | @item | 644 | @item |
| 645 | Daniel LaLiberte wrote @file{edebug.el}, a source-level debugger for | 645 | Daniel LaLiberte wrote @file{edebug.el}, a source-level debugger for |
| 646 | Emacs Lisp; @file{cl-specs.el}, specifications to help @code{edebug} | 646 | Emacs Lisp; @file{cl-specs.el}, specifications to help @code{edebug} |
| 647 | debug code written using David Gillespie's Common Lisp support; | 647 | debug code written using David Gillespie's Common Lisp support; and |
| 648 | @file{cust-print.el}, a customizable package for printing lisp | 648 | @file{isearch.el}, Emacs's incremental search minor mode. He also |
| 649 | objects; and @file{isearch.el}, Emacs's incremental search minor mode. | 649 | co-wrote @file{hideif.el} (q.v.@:). |
| 650 | He also co-wrote @file{hideif.el} (q.v.@:). | ||
| 651 | 650 | ||
| 652 | @item | 651 | @item |
| 653 | Karl Landstrom and Daniel Colascione wrote @file{js.el}, a mode for | 652 | Karl Landstrom and Daniel Colascione wrote @file{js.el}, a mode for |
| @@ -1301,15 +1300,14 @@ providing electric accent keys. | |||
| 1301 | Colin Walters wrote Ibuffer, an enhanced buffer menu. | 1300 | Colin Walters wrote Ibuffer, an enhanced buffer menu. |
| 1302 | 1301 | ||
| 1303 | @item | 1302 | @item |
| 1304 | Barry Warsaw wrote @file{assoc.el}, a set of utility functions for | 1303 | Barry Warsaw wrote @file{cc-mode.el}, a mode for editing C, C@t{++}, |
| 1305 | working with association lists; @file{cc-mode.el}, a mode for editing | 1304 | and Java code, based on earlier work by Dave Detlefs, Stewart Clamen, |
| 1306 | C, C@t{++}, and Java code, based on earlier work by Dave Detlefs, | 1305 | and Richard Stallman; @file{elp.el}, a profiler for Emacs Lisp |
| 1307 | Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler for | 1306 | programs; @file{man.el}, a mode for reading Unix manual pages; |
| 1308 | Emacs Lisp programs; @file{man.el}, a mode for reading Unix manual | 1307 | @file{regi.el}, providing an AWK-like functionality for use in lisp |
| 1309 | pages; @file{regi.el}, providing an AWK-like functionality for use in | 1308 | programs; @file{reporter.el}, providing customizable bug reporting for |
| 1310 | lisp programs; @file{reporter.el}, providing customizable bug | 1309 | lisp packages; and @file{supercite.el}, a minor mode for quoting |
| 1311 | reporting for lisp packages; and @file{supercite.el}, a minor mode for | 1310 | sections of mail messages and news articles. |
| 1312 | quoting sections of mail messages and news articles. | ||
| 1313 | 1311 | ||
| 1314 | @item | 1312 | @item |
| 1315 | Christoph Wedler wrote @file{antlr-mode.el}, a major mode for ANTLR | 1313 | Christoph Wedler wrote @file{antlr-mode.el}, a major mode for ANTLR |
| @@ -1351,9 +1349,8 @@ Directory Client; and @code{eshell}, a command shell implemented | |||
| 1351 | entirely in Emacs Lisp. He also contributed to Org mode (q.v.@:). | 1349 | entirely in Emacs Lisp. He also contributed to Org mode (q.v.@:). |
| 1352 | 1350 | ||
| 1353 | @item | 1351 | @item |
| 1354 | Mike Williams wrote @file{mouse-sel.el}, providing enhanced mouse | 1352 | Mike Williams wrote @file{thingatpt.el}, a library of functions for |
| 1355 | selection; and @file{thingatpt.el}, a library of functions for finding | 1353 | finding the ``thing'' (word, line, s-expression) at point. |
| 1356 | the ``thing'' (word, line, s-expression) containing point. | ||
| 1357 | 1354 | ||
| 1358 | @item | 1355 | @item |
| 1359 | Roland Winkler wrote @file{proced.el}, a system process editor. | 1356 | Roland Winkler wrote @file{proced.el}, a system process editor. |
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 16ccdba0866..42bd2a4fde2 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -267,7 +267,8 @@ necessary (@code{scroll-up-command}). @xref{Scrolling}. | |||
| 267 | Scroll one screen backward, and move point onscreen if necessary | 267 | Scroll one screen backward, and move point onscreen if necessary |
| 268 | (@code{scroll-down-command}). @xref{Scrolling}. | 268 | (@code{scroll-down-command}). @xref{Scrolling}. |
| 269 | 269 | ||
| 270 | @item M-x goto-char | 270 | @item M-g c |
| 271 | @kindex M-g c | ||
| 271 | @findex goto-char | 272 | @findex goto-char |
| 272 | Read a number @var{n} and move point to buffer position @var{n}. | 273 | Read a number @var{n} and move point to buffer position @var{n}. |
| 273 | Position 1 is the beginning of the buffer. | 274 | Position 1 is the beginning of the buffer. |
| @@ -285,6 +286,13 @@ also specify @var{n} by giving @kbd{M-g M-g} a numeric prefix argument. | |||
| 285 | @xref{Select Buffer}, for the behavior of @kbd{M-g M-g} when you give it | 286 | @xref{Select Buffer}, for the behavior of @kbd{M-g M-g} when you give it |
| 286 | a plain prefix argument. | 287 | a plain prefix argument. |
| 287 | 288 | ||
| 289 | @item M-g @key{TAB} | ||
| 290 | @kindex M-g TAB | ||
| 291 | @findex move-to-column | ||
| 292 | Read a number @var{n} and move to column @var{n} in the current line. | ||
| 293 | Column 0 is the leftmost column. If called with a prefix argument, | ||
| 294 | move to the column number specified by the argument's numeric value. | ||
| 295 | |||
| 288 | @item C-x C-n | 296 | @item C-x C-n |
| 289 | @kindex C-x C-n | 297 | @kindex C-x C-n |
| 290 | @findex set-goal-column | 298 | @findex set-goal-column |
| @@ -619,12 +627,16 @@ narrowed region and the line number relative to the whole buffer. | |||
| 619 | 627 | ||
| 620 | @kindex M-= | 628 | @kindex M-= |
| 621 | @findex count-words-region | 629 | @findex count-words-region |
| 622 | @findex count-words | ||
| 623 | @kbd{M-=} (@code{count-words-region}) displays a message reporting | 630 | @kbd{M-=} (@code{count-words-region}) displays a message reporting |
| 624 | the number of lines, words, and characters in the region. @kbd{M-x | 631 | the number of lines, words, and characters in the region |
| 625 | count-words} displays a similar message for the entire buffer, or for | 632 | (@pxref{Mark}, for an explanation of the region). With a prefix |
| 626 | the region if the region is @dfn{active}. @xref{Mark}, for an | 633 | argument, @kbd{C-u M-=}, the command displays a count for the entire |
| 627 | explanation of the region. | 634 | buffer. |
| 635 | |||
| 636 | @findex count-words | ||
| 637 | The command @kbd{M-x count-words} does the same job, but with a | ||
| 638 | different calling convention. It displays a count for the region if | ||
| 639 | the region is active, and for the buffer otherwise. | ||
| 628 | 640 | ||
| 629 | @kindex C-x = | 641 | @kindex C-x = |
| 630 | @findex what-cursor-position | 642 | @findex what-cursor-position |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 21948f181fb..eaee16ac8d5 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -1393,13 +1393,21 @@ putting a line like this in your init file (@pxref{Init File}): | |||
| 1393 | @end example | 1393 | @end example |
| 1394 | 1394 | ||
| 1395 | @cindex autoload | 1395 | @cindex autoload |
| 1396 | Some commands are @dfn{autoloaded}: when you run them, Emacs | 1396 | Some commands are @dfn{autoloaded}; when you run them, Emacs |
| 1397 | automatically loads the associated library first. For instance, the | 1397 | automatically loads the associated library first. For instance, the |
| 1398 | @kbd{M-x compile} command (@pxref{Compilation}) is autoloaded; if you | 1398 | @kbd{M-x compile} command (@pxref{Compilation}) is autoloaded; if you |
| 1399 | call it, Emacs automatically loads the @code{compile} library first. | 1399 | call it, Emacs automatically loads the @code{compile} library first. |
| 1400 | In contrast, the command @kbd{M-x recompile} is not autoloaded, so it | 1400 | In contrast, the command @kbd{M-x recompile} is not autoloaded, so it |
| 1401 | is unavailable until you load the @code{compile} library. | 1401 | is unavailable until you load the @code{compile} library. |
| 1402 | 1402 | ||
| 1403 | @vindex help-enable-auto-load | ||
| 1404 | Automatic loading can also occur when you look up the documentation | ||
| 1405 | of an autoloaded command (@pxref{Name Help}), if the documentation | ||
| 1406 | refers to other functions and variables in its library (loading the | ||
| 1407 | library lets Emacs properly set up the hyperlinks in the @file{*Help*} | ||
| 1408 | buffer). To disable this feature, change the variable | ||
| 1409 | @code{help-enable-auto-load} to @code{nil}. | ||
| 1410 | |||
| 1403 | @vindex load-dangerous-libraries | 1411 | @vindex load-dangerous-libraries |
| 1404 | @cindex Lisp files byte-compiled by XEmacs | 1412 | @cindex Lisp files byte-compiled by XEmacs |
| 1405 | By default, Emacs refuses to load compiled Lisp files which were | 1413 | By default, Emacs refuses to load compiled Lisp files which were |
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 2238570eaa9..2313d117a90 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -1044,9 +1044,9 @@ the left fringe, but no arrow bitmaps, use @code{((top . left) | |||
| 1044 | @cindex whitespace, trailing | 1044 | @cindex whitespace, trailing |
| 1045 | @vindex show-trailing-whitespace | 1045 | @vindex show-trailing-whitespace |
| 1046 | It is easy to leave unnecessary spaces at the end of a line, or | 1046 | It is easy to leave unnecessary spaces at the end of a line, or |
| 1047 | empty lines at the end of a file, without realizing it. In most | 1047 | empty lines at the end of a buffer, without realizing it. In most |
| 1048 | cases, this @dfn{trailing whitespace} has no effect, but there are | 1048 | cases, this @dfn{trailing whitespace} has no effect, but sometimes it |
| 1049 | special circumstances where it matters, and it can be a nuisance. | 1049 | can be a nuisance. |
| 1050 | 1050 | ||
| 1051 | You can make trailing whitespace at the end of a line visible by | 1051 | You can make trailing whitespace at the end of a line visible by |
| 1052 | setting the buffer-local variable @code{show-trailing-whitespace} to | 1052 | setting the buffer-local variable @code{show-trailing-whitespace} to |
| @@ -1061,9 +1061,13 @@ the location of point is enough to show you that the spaces are | |||
| 1061 | present. | 1061 | present. |
| 1062 | 1062 | ||
| 1063 | @findex delete-trailing-whitespace | 1063 | @findex delete-trailing-whitespace |
| 1064 | @vindex delete-trailing-lines | ||
| 1064 | Type @kbd{M-x delete-trailing-whitespace} to delete all trailing | 1065 | Type @kbd{M-x delete-trailing-whitespace} to delete all trailing |
| 1065 | whitespace within the buffer. If the region is active, it deletes all | 1066 | whitespace. This command deletes all extra spaces at the end of each |
| 1066 | trailing whitespace in the region instead. | 1067 | line in the buffer, and all empty lines at the end of the buffer; to |
| 1068 | ignore the latter, change the varaible @code{delete-trailing-lines} to | ||
| 1069 | @code{nil}. If the region is active, the command instead deletes | ||
| 1070 | extra spaces at the end of each line in the region. | ||
| 1067 | 1071 | ||
| 1068 | @vindex indicate-empty-lines | 1072 | @vindex indicate-empty-lines |
| 1069 | @cindex unused lines | 1073 | @cindex unused lines |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index c18123d7b29..a2eaaf673e5 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -267,6 +267,7 @@ The Minibuffer | |||
| 267 | * Minibuffer History:: Reusing recent minibuffer arguments. | 267 | * Minibuffer History:: Reusing recent minibuffer arguments. |
| 268 | * Repetition:: Re-executing commands that used the minibuffer. | 268 | * Repetition:: Re-executing commands that used the minibuffer. |
| 269 | * Passwords:: Entering passwords in the echo area. | 269 | * Passwords:: Entering passwords in the echo area. |
| 270 | * Yes or No Prompts:: Replying yes or no in the echo area. | ||
| 270 | 271 | ||
| 271 | Completion | 272 | Completion |
| 272 | 273 | ||
diff --git a/doc/emacs/entering.texi b/doc/emacs/entering.texi index de143516ce8..224ab356d08 100644 --- a/doc/emacs/entering.texi +++ b/doc/emacs/entering.texi | |||
| @@ -79,11 +79,6 @@ non-@code{nil} value. (In that case, even if you specify one or more | |||
| 79 | files on the command line, Emacs opens but does not display them.) | 79 | files on the command line, Emacs opens but does not display them.) |
| 80 | The value of @code{initial-buffer-choice} should be the name of | 80 | The value of @code{initial-buffer-choice} should be the name of |
| 81 | the desired file or directory. | 81 | the desired file or directory. |
| 82 | @ignore | ||
| 83 | @c I do not think this should be mentioned. AFAICS it is just a dodge | ||
| 84 | @c around inhibit-startup-screen not being settable on a site-wide basis. | ||
| 85 | or @code{t}, which means to display the @file{*scratch*} buffer. | ||
| 86 | @end ignore | ||
| 87 | 82 | ||
| 88 | @node Exiting | 83 | @node Exiting |
| 89 | @section Exiting Emacs | 84 | @section Exiting Emacs |
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index d09885c5edd..050ecd150ab 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -243,7 +243,7 @@ by the innermost Lisp expression in the buffer around point, | |||
| 243 | (That name appears as the default while you enter the argument.) For | 243 | (That name appears as the default while you enter the argument.) For |
| 244 | example, if point is located following the text @samp{(make-vector | 244 | example, if point is located following the text @samp{(make-vector |
| 245 | (car x)}, the innermost list containing point is the one that starts | 245 | (car x)}, the innermost list containing point is the one that starts |
| 246 | with @samp{(make-vector}, so @kbd{C-h f @key{RET}} will describe the | 246 | with @samp{(make-vector}, so @kbd{C-h f @key{RET}} describes the |
| 247 | function @code{make-vector}. | 247 | function @code{make-vector}. |
| 248 | 248 | ||
| 249 | @kbd{C-h f} is also useful just to verify that you spelled a | 249 | @kbd{C-h f} is also useful just to verify that you spelled a |
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 1eb53d0d2ec..5510816b067 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi | |||
| @@ -709,6 +709,9 @@ rectangle, depending on the command that uses them. | |||
| 709 | @item C-x r k | 709 | @item C-x r k |
| 710 | Kill the text of the region-rectangle, saving its contents as the | 710 | Kill the text of the region-rectangle, saving its contents as the |
| 711 | ``last killed rectangle'' (@code{kill-rectangle}). | 711 | ``last killed rectangle'' (@code{kill-rectangle}). |
| 712 | @item C-x r M-w | ||
| 713 | Save the text of the region-rectangle as the ``last killed rectangle'' | ||
| 714 | (@code{copy-rectangle-as-kill}). | ||
| 712 | @item C-x r d | 715 | @item C-x r d |
| 713 | Delete the text of the region-rectangle (@code{delete-rectangle}). | 716 | Delete the text of the region-rectangle (@code{delete-rectangle}). |
| 714 | @item C-x r y | 717 | @item C-x r y |
| @@ -757,6 +760,12 @@ yanking a rectangle is so different from yanking linear text that | |||
| 757 | different yank commands have to be used. Yank-popping is not defined | 760 | different yank commands have to be used. Yank-popping is not defined |
| 758 | for rectangles. | 761 | for rectangles. |
| 759 | 762 | ||
| 763 | @kindex C-x r M-w | ||
| 764 | @findex copy-rectangle-as-kill | ||
| 765 | @kbd{C-x r M-w} (@code{copy-rectangle-as-kill}) is the equivalent of | ||
| 766 | @kbd{M-w} for rectangles: it records the rectangle as the ``last | ||
| 767 | killed rectangle'', without deleting the text from the buffer. | ||
| 768 | |||
| 760 | @kindex C-x r y | 769 | @kindex C-x r y |
| 761 | @findex yank-rectangle | 770 | @findex yank-rectangle |
| 762 | To yank the last killed rectangle, type @kbd{C-x r y} | 771 | To yank the last killed rectangle, type @kbd{C-x r y} |
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 2856db7a4fa..5d2fc804498 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -45,6 +45,7 @@ do not echo. | |||
| 45 | * Minibuffer History:: Reusing recent minibuffer arguments. | 45 | * Minibuffer History:: Reusing recent minibuffer arguments. |
| 46 | * Repetition:: Re-executing commands that used the minibuffer. | 46 | * Repetition:: Re-executing commands that used the minibuffer. |
| 47 | * Passwords:: Entering passwords in the echo area. | 47 | * Passwords:: Entering passwords in the echo area. |
| 48 | * Yes or No Prompts:: Replying yes or no in the echo area. | ||
| 48 | @end menu | 49 | @end menu |
| 49 | 50 | ||
| 50 | @node Minibuffer File | 51 | @node Minibuffer File |
| @@ -733,3 +734,53 @@ password (@pxref{Killing}). You may type either @key{RET} or | |||
| 733 | @key{ESC} to submit the password. Any other self-inserting character | 734 | @key{ESC} to submit the password. Any other self-inserting character |
| 734 | key inserts the associated character into the password, and all other | 735 | key inserts the associated character into the password, and all other |
| 735 | input is ignored. | 736 | input is ignored. |
| 737 | |||
| 738 | @node Yes or No Prompts | ||
| 739 | @section Yes or No Prompts | ||
| 740 | |||
| 741 | An Emacs command may require you to answer a ``yes or no'' question | ||
| 742 | during the course of its execution. Such queries come in two main | ||
| 743 | varieties. | ||
| 744 | |||
| 745 | @cindex y or n prompt | ||
| 746 | For the first type of ``yes or no'' query, the prompt ends with | ||
| 747 | @samp{(y or n)}. Such a query does not actually use the minibuffer; | ||
| 748 | the prompt appears in the echo area, and you answer by typing either | ||
| 749 | @samp{y} or @samp{n}, which immediately delivers the response. For | ||
| 750 | example, if you type @kbd{C-x C-w} (@kbd{write-file}) to save a | ||
| 751 | buffer, and enter the name of an existing file, Emacs issues a prompt | ||
| 752 | like this: | ||
| 753 | |||
| 754 | @smallexample | ||
| 755 | File `foo.el' exists; overwrite? (y or n) | ||
| 756 | @end smallexample | ||
| 757 | |||
| 758 | @noindent | ||
| 759 | Because this query does not actually use the minibuffer, the usual | ||
| 760 | minibuffer editing commands cannot be used. However, you can perform | ||
| 761 | some window scrolling operations while the query is active: @kbd{C-l} | ||
| 762 | recenters the selected window; @kbd{M-v} (or @key{PageDown} or | ||
| 763 | @key{next}) scrolls forward; @kbd{C-v} (or @key{PageUp}, or | ||
| 764 | @key{prior}) scrolls backward; @kbd{C-M-v} scrolls forward in the next | ||
| 765 | window; and @kbd{C-M-S-v} scrolls backward in the next window. Typing | ||
| 766 | @kbd{C-g} dismisses the query, and quits the command that issued it | ||
| 767 | (@pxref{Quitting}). | ||
| 768 | |||
| 769 | @cindex yes or no prompt | ||
| 770 | The second type of ``yes or no'' query is typically employed if | ||
| 771 | giving the wrong answer would have serious consequences; it uses the | ||
| 772 | minibuffer, and features a prompt ending with @samp{(yes or no)}. For | ||
| 773 | example, if you invoke @kbd{C-x k} (@code{kill-buffer}) on a | ||
| 774 | file-visiting buffer with unsaved changes, Emacs activates the | ||
| 775 | minibuffer with a prompt like this: | ||
| 776 | |||
| 777 | @smallexample | ||
| 778 | Buffer foo.el modified; kill anyway? (yes or no) | ||
| 779 | @end smallexample | ||
| 780 | |||
| 781 | @noindent | ||
| 782 | To answer, you must type @samp{yes} or @samp{no} into the minibuffer, | ||
| 783 | followed by @key{RET}. The minibuffer behaves as described in the | ||
| 784 | previous sections; you can switch to another window with @kbd{C-x o}, | ||
| 785 | use the history commands @kbd{M-p} and @kbd{M-f}, etc. Type @kbd{C-g} | ||
| 786 | to quit the minibuffer and the querying command. | ||
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 5d7a51a01f5..4f0a1009e30 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -1509,15 +1509,11 @@ precedence. | |||
| 1509 | @cindex client frame | 1509 | @cindex client frame |
| 1510 | @item -c | 1510 | @item -c |
| 1511 | Create a new graphical @dfn{client frame}, instead of using an | 1511 | Create a new graphical @dfn{client frame}, instead of using an |
| 1512 | existing Emacs frame. If you omit a filename argument while supplying | 1512 | existing Emacs frame. See below for the special behavior of @kbd{C-x |
| 1513 | the @samp{-c} option, the new frame displays the @file{*scratch*} | 1513 | C-c} in a client frame. If Emacs cannot create a new graphical frame |
| 1514 | buffer (@pxref{Buffers}). See below for the special behavior of | 1514 | (e.g.@: if it cannot connect to the X server), it tries to create a |
| 1515 | @kbd{C-x C-c} in a client frame. | 1515 | text terminal client frame, as though you had supplied the @samp{-t} |
| 1516 | 1516 | option instead. | |
| 1517 | If Emacs is unable to create a new graphical frame (e.g.@: if it is | ||
| 1518 | unable to connect to the X server), it tries to create a text terminal | ||
| 1519 | client frame, as though you had supplied the @samp{-t} option instead | ||
| 1520 | (see below). | ||
| 1521 | 1517 | ||
| 1522 | On MS-Windows, a single Emacs session cannot display frames on both | 1518 | On MS-Windows, a single Emacs session cannot display frames on both |
| 1523 | graphical and text terminals, nor on multiple text terminals. Thus, | 1519 | graphical and text terminals, nor on multiple text terminals. Thus, |
| @@ -1525,6 +1521,11 @@ if the Emacs server is running on a text terminal, the @samp{-c} | |||
| 1525 | option, like the @samp{-t} option, creates a new frame in the server's | 1521 | option, like the @samp{-t} option, creates a new frame in the server's |
| 1526 | current text terminal. @xref{Windows Startup}. | 1522 | current text terminal. @xref{Windows Startup}. |
| 1527 | 1523 | ||
| 1524 | If you omit a filename argument while supplying the @samp{-c} option, | ||
| 1525 | the new frame displays the @file{*scratch*} buffer by default. If | ||
| 1526 | @code{initial-buffer-choice} is a string (@pxref{Entering Emacs}), the | ||
| 1527 | new frame displays that file or directory instead. | ||
| 1528 | |||
| 1528 | @item -F @var{alist} | 1529 | @item -F @var{alist} |
| 1529 | @itemx --frame-parameters=@var{alist} | 1530 | @itemx --frame-parameters=@var{alist} |
| 1530 | Set the parameters for a newly-created graphical frame | 1531 | Set the parameters for a newly-created graphical frame |
| @@ -1545,38 +1546,24 @@ evaluate, @emph{not} as a list of files to visit. | |||
| 1545 | @item -f @var{server-file} | 1546 | @item -f @var{server-file} |
| 1546 | @itemx --server-file=@var{server-file} | 1547 | @itemx --server-file=@var{server-file} |
| 1547 | @cindex @env{EMACS_SERVER_FILE} environment variable | 1548 | @cindex @env{EMACS_SERVER_FILE} environment variable |
| 1548 | @cindex server file | ||
| 1549 | @vindex server-use-tcp | ||
| 1550 | @vindex server-host | ||
| 1551 | Specify a @dfn{server file} for connecting to an Emacs server via TCP. | 1549 | Specify a @dfn{server file} for connecting to an Emacs server via TCP. |
| 1552 | 1550 | ||
| 1553 | An Emacs server usually uses an operating system feature called a | 1551 | An Emacs server usually uses an operating system feature called a |
| 1554 | ``local socket'' to listen for connections. Some operating systems, | 1552 | ``local socket'' to listen for connections. Some operating systems, |
| 1555 | such as Microsoft Windows, do not support local sockets; in that case, | 1553 | such as Microsoft Windows, do not support local sockets; in that case, |
| 1556 | Emacs uses TCP instead. When you start the Emacs server, Emacs | 1554 | the server communicates with @command{emacsclient} via TCP. |
| 1557 | creates a server file containing some TCP information that | ||
| 1558 | @command{emacsclient} needs for making the connection. By default, | ||
| 1559 | the server file is in @file{~/.emacs.d/server/}. On Microsoft | ||
| 1560 | Windows, if @command{emacsclient} does not find the server file there, | ||
| 1561 | it looks in the @file{.emacs.d/server/} subdirectory of the directory | ||
| 1562 | pointed to by the @env{APPDATA} environment variable. You can tell | ||
| 1563 | @command{emacsclient} to use a specific server file with the @samp{-f} | ||
| 1564 | or @samp{--server-file} option, or by setting the | ||
| 1565 | @env{EMACS_SERVER_FILE} environment variable. | ||
| 1566 | |||
| 1567 | Even if local sockets are available, you can tell Emacs to use TCP by | ||
| 1568 | setting the variable @code{server-use-tcp} to @code{t}. One advantage | ||
| 1569 | of TCP is that the server can accept connections from remote machines. | ||
| 1570 | For this to work, you must (i) set the variable @code{server-host} to | ||
| 1571 | the hostname or IP address of the machine on which the Emacs server | ||
| 1572 | runs, and (ii) provide @command{emacsclient} with the server file. | ||
| 1573 | (One convenient way to do the latter is to put the server file on a | ||
| 1574 | networked file system such as NFS.) | ||
| 1575 | 1555 | ||
| 1556 | @vindex server-auth-dir | ||
| 1557 | @cindex server file | ||
| 1576 | @vindex server-port | 1558 | @vindex server-port |
| 1577 | When the Emacs server is using TCP, the variable @code{server-port} | 1559 | When you start a TCP Emacs server, Emacs creates a @dfn{server file} |
| 1578 | determines the port number to listen on; the default value, | 1560 | containing the TCP information to be used by @command{emacsclient} to |
| 1579 | @code{nil}, means to choose a random port when the server starts. | 1561 | connect to the server. The variable @code{server-auth-dir} specifies |
| 1562 | the directory containing the server file; by default, this is | ||
| 1563 | @file{~/.emacs.d/server/}. To tell @command{emacsclient} to connect | ||
| 1564 | to the server over TCP with a specific server file, use the @samp{-f} | ||
| 1565 | or @samp{--server-file} option, or set the @env{EMACS_SERVER_FILE} | ||
| 1566 | environment variable. | ||
| 1580 | 1567 | ||
| 1581 | @item -n | 1568 | @item -n |
| 1582 | @itemx --no-wait | 1569 | @itemx --no-wait |
| @@ -1606,19 +1593,14 @@ server it finds. (This option is not supported on MS-Windows.) | |||
| 1606 | @itemx --tty | 1593 | @itemx --tty |
| 1607 | @itemx -nw | 1594 | @itemx -nw |
| 1608 | Create a new client frame on the current text terminal, instead of | 1595 | Create a new client frame on the current text terminal, instead of |
| 1609 | using an existing Emacs frame. This is similar to the @samp{-c} | 1596 | using an existing Emacs frame. This behaves just like the @samp{-c} |
| 1610 | option, above, except that it creates a text terminal frame | 1597 | option, described above, except that it creates a text terminal frame |
| 1611 | (@pxref{Non-Window Terminals}). If you omit a filename argument while | 1598 | (@pxref{Non-Window Terminals}). |
| 1612 | supplying this option, the new frame displays the @file{*scratch*} | 1599 | |
| 1613 | buffer (@pxref{Buffers}). See below for the special behavior of | 1600 | On MS-Windows, @samp{-t} behaves just like @samp{-c} if the Emacs |
| 1614 | @kbd{C-x C-c} in a client frame. | 1601 | server is using the graphical display, but if the Emacs server is |
| 1615 | 1602 | running on a text terminal, it creates a new frame in the current text | |
| 1616 | On MS-Windows, a single Emacs session cannot display frames on both | 1603 | terminal. |
| 1617 | graphical and text terminals, nor on multiple text terminals. Thus, | ||
| 1618 | if the Emacs server is using the graphical display, @samp{-t} behaves | ||
| 1619 | like @samp{-c} (see above); whereas if the Emacs server is running on | ||
| 1620 | a text terminal, it creates a new frame in its current text terminal. | ||
| 1621 | @xref{Windows Startup}. | ||
| 1622 | @end table | 1604 | @end table |
| 1623 | 1605 | ||
| 1624 | The new graphical or text terminal frames created by the @samp{-c} | 1606 | The new graphical or text terminal frames created by the @samp{-c} |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index d5c9783b772..21db02c8ab8 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -17,7 +17,6 @@ thing, but search for patterns instead of fixed strings. | |||
| 17 | (@pxref{Operating on Files}), or ask the @code{grep} program to do it | 17 | (@pxref{Operating on Files}), or ask the @code{grep} program to do it |
| 18 | (@pxref{Grep Searching}). | 18 | (@pxref{Grep Searching}). |
| 19 | 19 | ||
| 20 | |||
| 21 | @menu | 20 | @menu |
| 22 | * Incremental Search:: Search happens as you type the string. | 21 | * Incremental Search:: Search happens as you type the string. |
| 23 | * Nonincremental Search:: Specify entire string and then search. | 22 | * Nonincremental Search:: Specify entire string and then search. |
| @@ -218,6 +217,24 @@ search. | |||
| 218 | Some of the characters you type during incremental search have | 217 | Some of the characters you type during incremental search have |
| 219 | special effects. | 218 | special effects. |
| 220 | 219 | ||
| 220 | @cindex lax space matching | ||
| 221 | @kindex M-s SPC @r{(Incremental search)} | ||
| 222 | @kindex SPC @r{(Incremental search)} | ||
| 223 | @findex isearch-toggle-lax-whitespace | ||
| 224 | @vindex search-whitespace-regexp | ||
| 225 | By default, incremental search performs @dfn{lax space matching}: | ||
| 226 | each space, or sequence of spaces, matches any sequence of one or more | ||
| 227 | spaces in the text. Hence, @samp{foo bar} matches @samp{foo bar}, | ||
| 228 | @samp{foo bar}, @samp{foo bar}, and so on (but not @samp{foobar}). | ||
| 229 | More precisely, Emacs matches each sequence of space characters in the | ||
| 230 | search string to a regular expression specified by the variable | ||
| 231 | @code{search-whitespace-regexp}. For example, set it to | ||
| 232 | @samp{"[[:space:]\n]+"} to make spaces match sequences of newlines as | ||
| 233 | well as spaces. To toggle lax space matching, type @kbd{M-s SPC} | ||
| 234 | (@code{isearch-toggle-lax-whitespace}). To disable this feature | ||
| 235 | entirely, change @code{search-whitespace-regexp} to @code{nil}; then | ||
| 236 | each space in the search string matches exactly one space | ||
| 237 | |||
| 221 | If the search string you entered contains only lower-case letters, | 238 | If the search string you entered contains only lower-case letters, |
| 222 | the search is case-insensitive; as long as an upper-case letter exists | 239 | the search is case-insensitive; as long as an upper-case letter exists |
| 223 | in the search string, the search becomes case-sensitive. If you | 240 | in the search string, the search becomes case-sensitive. If you |
| @@ -492,12 +509,12 @@ Incremental regexp and non-regexp searches have independent defaults. | |||
| 492 | They also have separate search rings, which you can access with | 509 | They also have separate search rings, which you can access with |
| 493 | @kbd{M-p} and @kbd{M-n}. | 510 | @kbd{M-p} and @kbd{M-n}. |
| 494 | 511 | ||
| 495 | @vindex search-whitespace-regexp | 512 | Just as in ordinary incremental search, any @key{SPC} typed in |
| 496 | If you type @key{SPC} in incremental regexp search, it matches any | 513 | incremental regexp search matches any sequence of one or more |
| 497 | sequence of whitespace characters, including newlines. If you want to | 514 | whitespace characters. The variable @code{search-whitespace-regexp} |
| 498 | match just a space, type @kbd{C-q @key{SPC}}. You can control what a | 515 | specifies the regexp for the lax space matching, and @kbd{M-s SPC} |
| 499 | bare space matches by setting the variable | 516 | (@code{isearch-toggle-lax-whitespace}) toggles the feature. |
| 500 | @code{search-whitespace-regexp} to the desired regexp. | 517 | @xref{Special Isearch}. |
| 501 | 518 | ||
| 502 | In some cases, adding characters to the regexp in an incremental | 519 | In some cases, adding characters to the regexp in an incremental |
| 503 | regexp search can make the cursor move back and start again. For | 520 | regexp search can make the cursor move back and start again. For |
| @@ -974,6 +991,13 @@ instead (@pxref{Mark}). The basic replace commands replace one | |||
| 974 | is possible to perform several replacements in parallel, using the | 991 | is possible to perform several replacements in parallel, using the |
| 975 | command @code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}). | 992 | command @code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}). |
| 976 | 993 | ||
| 994 | @vindex replace-lax-whitespace | ||
| 995 | Unlike incremental search, the replacement commands do not use lax | ||
| 996 | space matching (@pxref{Special Isearch}) by default. To enable lax | ||
| 997 | space matching for replacement, change the variable | ||
| 998 | @code{replace-lax-whitespace} to @code{t}. (This only affects how | ||
| 999 | Emacs finds the text to replace, not the replacement text.) | ||
| 1000 | |||
| 977 | @menu | 1001 | @menu |
| 978 | * Unconditional Replace:: Replacing all matches for a string. | 1002 | * Unconditional Replace:: Replacing all matches for a string. |
| 979 | * Regexp Replace:: Replacing all matches for a regexp. | 1003 | * Regexp Replace:: Replacing all matches for a regexp. |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 76f06edaacb..b5c847b4b72 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,45 @@ | |||
| 1 | 2012-09-30 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * commands.texi (Click Events): Define "mouse position list". | ||
| 4 | Remove mention of unimplemented horizontal scroll bars. | ||
| 5 | (Drag Events, Motion Events): Refer to "mouse position list". | ||
| 6 | (Accessing Mouse): Document posnp. | ||
| 7 | |||
| 8 | * errors.texi (Standard Errors): Tweak arith-error description. | ||
| 9 | Tweak markup. Remove domain-error and friends, which seem to be | ||
| 10 | unused after the floating-point code revamp. | ||
| 11 | |||
| 12 | * functions.texi (Obsolete Functions): Obsolescence also affects | ||
| 13 | documentation commands. Various clarifications. | ||
| 14 | (Declare Form): New node. | ||
| 15 | |||
| 16 | * strings.texi (String Basics): Copyedits. | ||
| 17 | |||
| 18 | * os.texi (Idle Timers): Minor clarifications. | ||
| 19 | (User Identification): Add system-users and system-groups. | ||
| 20 | |||
| 21 | * macros.texi (Defining Macros): Move description of `declare' to | ||
| 22 | Declare Form node. | ||
| 23 | |||
| 24 | * loading.texi (Autoload): | ||
| 25 | * help.texi (Documentation Basics): The special sequences can | ||
| 26 | trigger autoloading. | ||
| 27 | |||
| 28 | * numbers.texi (Integer Basics): Copyedits. | ||
| 29 | (Float Basics): Consider IEEE floating point always available. | ||
| 30 | (Random Numbers): Document actual limits. | ||
| 31 | (Arithmetic Operations): Clarify division by zero. Don't mention | ||
| 32 | the machine-independence of negative division since it does not | ||
| 33 | happen in practice. | ||
| 34 | |||
| 35 | 2012-09-28 Chong Yidong <cyd@gnu.org> | ||
| 36 | |||
| 37 | * os.texi (Startup Summary): Document leim-list.el change. | ||
| 38 | |||
| 39 | 2012-09-25 Chong Yidong <cyd@gnu.org> | ||
| 40 | |||
| 41 | * functions.texi (Defining Functions): defun is now a macro. | ||
| 42 | |||
| 1 | 2012-09-28 Leo Liu <sdl.web@gmail.com> | 43 | 2012-09-28 Leo Liu <sdl.web@gmail.com> |
| 2 | 44 | ||
| 3 | * files.texi (Files): Fix typo. | 45 | * files.texi (Files): Fix typo. |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index dc0fa4c639d..93dba237013 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -1275,12 +1275,21 @@ describe events by their types; thus, if there is a key binding for | |||
| 1275 | @var{event-type} is @code{mouse-1}. | 1275 | @var{event-type} is @code{mouse-1}. |
| 1276 | 1276 | ||
| 1277 | @item @var{position} | 1277 | @item @var{position} |
| 1278 | This is the position where the mouse click occurred. The actual | 1278 | @cindex mouse position list |
| 1279 | format of @var{position} depends on what part of a window was clicked | 1279 | This is a @dfn{mouse position list} specifying where the mouse click |
| 1280 | on. | 1280 | occurred; see below for details. |
| 1281 | 1281 | ||
| 1282 | For mouse click events in the text area, mode line, header line, or in | 1282 | @item @var{click-count} |
| 1283 | the marginal areas, @var{position} has this form: | 1283 | This is the number of rapid repeated presses so far of the same mouse |
| 1284 | button. @xref{Repeat Events}. | ||
| 1285 | @end table | ||
| 1286 | |||
| 1287 | To access the contents of a mouse position list in the | ||
| 1288 | @var{position} slot of a click event, you should typically use the | ||
| 1289 | functions documented in @ref{Accessing Mouse}. The explicit format of | ||
| 1290 | the list depends on where the click occurred. For clicks in the text | ||
| 1291 | area, mode line, header line, or in the fringe or marginal areas, the | ||
| 1292 | mouse position list has the form | ||
| 1284 | 1293 | ||
| 1285 | @example | 1294 | @example |
| 1286 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} | 1295 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} |
| @@ -1289,18 +1298,16 @@ the marginal areas, @var{position} has this form: | |||
| 1289 | @end example | 1298 | @end example |
| 1290 | 1299 | ||
| 1291 | @noindent | 1300 | @noindent |
| 1292 | The meanings of these list elements are documented below. | 1301 | The meanings of these list elements are as follows: |
| 1293 | @xref{Accessing Mouse}, for functions that let you easily access these | ||
| 1294 | elements. | ||
| 1295 | 1302 | ||
| 1296 | @table @asis | 1303 | @table @asis |
| 1297 | @item @var{window} | 1304 | @item @var{window} |
| 1298 | This is the window in which the click occurred. | 1305 | The window in which the click occurred. |
| 1299 | 1306 | ||
| 1300 | @item @var{pos-or-area} | 1307 | @item @var{pos-or-area} |
| 1301 | This is the buffer position of the character clicked on in the text | 1308 | The buffer position of the character clicked on in the text area; or, |
| 1302 | area, or if clicked outside the text area, it is the window area in | 1309 | if the click was outside the text area, the window area where it |
| 1303 | which the click occurred. It is one of the symbols @code{mode-line}, | 1310 | occurred. It is one of the symbols @code{mode-line}, |
| 1304 | @code{header-line}, @code{vertical-line}, @code{left-margin}, | 1311 | @code{header-line}, @code{vertical-line}, @code{left-margin}, |
| 1305 | @code{right-margin}, @code{left-fringe}, or @code{right-fringe}. | 1312 | @code{right-margin}, @code{left-fringe}, or @code{right-fringe}. |
| 1306 | 1313 | ||
| @@ -1310,22 +1317,23 @@ happens after the imaginary prefix keys for the event are registered | |||
| 1310 | by Emacs. @xref{Key Sequence Input}. | 1317 | by Emacs. @xref{Key Sequence Input}. |
| 1311 | 1318 | ||
| 1312 | @item @var{x}, @var{y} | 1319 | @item @var{x}, @var{y} |
| 1313 | These are the relative pixel coordinates of the click. For clicks in | 1320 | The relative pixel coordinates of the click. For clicks in the text |
| 1314 | the text area of a window, the coordinate origin @code{(0 . 0)} is | 1321 | area of a window, the coordinate origin @code{(0 . 0)} is taken to be |
| 1315 | taken to be the top left corner of the text area. @xref{Window | 1322 | the top left corner of the text area. @xref{Window Sizes}. For |
| 1316 | Sizes}. For clicks in a mode line or header line, the coordinate | 1323 | clicks in a mode line or header line, the coordinate origin is the top |
| 1317 | origin is the top left corner of the window itself. For fringes, | 1324 | left corner of the window itself. For fringes, margins, and the |
| 1318 | margins, and the vertical border, @var{x} does not have meaningful | 1325 | vertical border, @var{x} does not have meaningful data. For fringes |
| 1319 | data. For fringes and margins, @var{y} is relative to the bottom edge | 1326 | and margins, @var{y} is relative to the bottom edge of the header |
| 1320 | of the header line. In all cases, the @var{x} and @var{y} coordinates | 1327 | line. In all cases, the @var{x} and @var{y} coordinates increase |
| 1321 | increase rightward and downward respectively. | 1328 | rightward and downward respectively. |
| 1322 | 1329 | ||
| 1323 | @item @var{timestamp} | 1330 | @item @var{timestamp} |
| 1324 | This is the time at which the event occurred, in milliseconds. | 1331 | The time at which the event occurred, as an integer number of |
| 1332 | milliseconds since a system-dependent initial time. | ||
| 1325 | 1333 | ||
| 1326 | @item @var{object} | 1334 | @item @var{object} |
| 1327 | This is either @code{nil} if there is no string-type text property at | 1335 | Either @code{nil} if there is no string-type text property at the |
| 1328 | the click position, or a cons cell of the form (@var{string} | 1336 | click position, or a cons cell of the form (@var{string} |
| 1329 | . @var{string-pos}) if there is one: | 1337 | . @var{string-pos}) if there is one: |
| 1330 | 1338 | ||
| 1331 | @table @asis | 1339 | @table @asis |
| @@ -1371,8 +1379,7 @@ These are the pixel width and height of @var{object} or, if this is | |||
| 1371 | @code{nil}, those of the character glyph clicked on. | 1379 | @code{nil}, those of the character glyph clicked on. |
| 1372 | @end table | 1380 | @end table |
| 1373 | 1381 | ||
| 1374 | @sp 1 | 1382 | For clicks on a scroll bar, @var{position} has this form: |
| 1375 | For mouse clicks on a scroll-bar, @var{position} has this form: | ||
| 1376 | 1383 | ||
| 1377 | @example | 1384 | @example |
| 1378 | (@var{window} @var{area} (@var{portion} . @var{whole}) @var{timestamp} @var{part}) | 1385 | (@var{window} @var{area} (@var{portion} . @var{whole}) @var{timestamp} @var{part}) |
| @@ -1380,32 +1387,35 @@ For mouse clicks on a scroll-bar, @var{position} has this form: | |||
| 1380 | 1387 | ||
| 1381 | @table @asis | 1388 | @table @asis |
| 1382 | @item @var{window} | 1389 | @item @var{window} |
| 1383 | This is the window whose scroll-bar was clicked on. | 1390 | The window whose scroll bar was clicked on. |
| 1384 | 1391 | ||
| 1385 | @item @var{area} | 1392 | @item @var{area} |
| 1386 | This is the scroll bar where the click occurred. It is one of the | 1393 | This is the symbol @code{vertical-scroll-bar}. |
| 1387 | symbols @code{vertical-scroll-bar} or @code{horizontal-scroll-bar}. | ||
| 1388 | 1394 | ||
| 1389 | @item @var{portion} | 1395 | @item @var{portion} |
| 1390 | This is the distance of the click from the top or left end of | 1396 | The number of pixels from the top of the scroll bar to the click |
| 1391 | the scroll bar. | 1397 | position. On some toolkits, including GTK+, Emacs cannot extract this |
| 1398 | data, so the value is always @code{0}. | ||
| 1392 | 1399 | ||
| 1393 | @item @var{whole} | 1400 | @item @var{whole} |
| 1394 | This is the length of the entire scroll bar. | 1401 | The total length, in pixels, of the scroll bar. On some toolkits, |
| 1402 | including GTK+, Emacs cannot extract this data, so the value is always | ||
| 1403 | @code{0}. | ||
| 1395 | 1404 | ||
| 1396 | @item @var{timestamp} | 1405 | @item @var{timestamp} |
| 1397 | This is the time at which the event occurred, in milliseconds. | 1406 | The time at which the event occurred, in milliseconds. On some |
| 1407 | toolkits, including GTK+, Emacs cannot extract this data, so the value | ||
| 1408 | is always @code{0}. | ||
| 1398 | 1409 | ||
| 1399 | @item @var{part} | 1410 | @item @var{part} |
| 1400 | This is the part of the scroll-bar which was clicked on. It is one | 1411 | The part of the scroll bar on which the click occurred. It is one of |
| 1401 | of the symbols @code{above-handle}, @code{handle}, @code{below-handle}, | 1412 | the symbols @code{handle} (the scroll bar handle), @code{above-handle} |
| 1402 | @code{up}, @code{down}, @code{top}, @code{bottom}, and @code{end-scroll}. | 1413 | (the area above the handle), @code{below-handle} (the area below the |
| 1414 | handle), @code{up} (the up arrow at one end of the scroll bar), or | ||
| 1415 | @code{down} (the down arrow at one end of the scroll bar). | ||
| 1416 | @c The `top', `bottom', and `end-scroll' codes don't seem to be used. | ||
| 1403 | @end table | 1417 | @end table |
| 1404 | 1418 | ||
| 1405 | @item @var{click-count} | ||
| 1406 | This is the number of rapid repeated presses so far of the same mouse | ||
| 1407 | button. @xref{Repeat Events}. | ||
| 1408 | @end table | ||
| 1409 | 1419 | ||
| 1410 | @node Drag Events | 1420 | @node Drag Events |
| 1411 | @subsection Drag Events | 1421 | @subsection Drag Events |
| @@ -1429,10 +1439,9 @@ For a drag event, the name of the symbol @var{event-type} contains the | |||
| 1429 | prefix @samp{drag-}. For example, dragging the mouse with button 2 | 1439 | prefix @samp{drag-}. For example, dragging the mouse with button 2 |
| 1430 | held down generates a @code{drag-mouse-2} event. The second and third | 1440 | held down generates a @code{drag-mouse-2} event. The second and third |
| 1431 | elements of the event give the starting and ending position of the | 1441 | elements of the event give the starting and ending position of the |
| 1432 | drag. They have the same form as @var{position} in a click event | 1442 | drag, as mouse position lists (@pxref{Click Events}). You can access |
| 1433 | (@pxref{Click Events}) that is not on the scroll bar part of the | 1443 | the second element of any mouse event in the same way, with no need to |
| 1434 | window. You can access the second element of any mouse event in the | 1444 | distinguish drag events from others. |
| 1435 | same way, with no need to distinguish drag events from others. | ||
| 1436 | 1445 | ||
| 1437 | The @samp{drag-} prefix follows the modifier key prefixes such as | 1446 | The @samp{drag-} prefix follows the modifier key prefixes such as |
| 1438 | @samp{C-} and @samp{M-}. | 1447 | @samp{C-} and @samp{M-}. |
| @@ -1575,13 +1584,14 @@ represented by lists that look like this: | |||
| 1575 | (mouse-movement POSITION) | 1584 | (mouse-movement POSITION) |
| 1576 | @end example | 1585 | @end example |
| 1577 | 1586 | ||
| 1578 | The second element of the list describes the current position of the | 1587 | @noindent |
| 1579 | mouse, just as in a click event (@pxref{Click Events}). | 1588 | @var{position} is a mouse position list (@pxref{Click Events}), |
| 1589 | specifying the current position of the mouse cursor. | ||
| 1580 | 1590 | ||
| 1581 | The special form @code{track-mouse} enables generation of motion events | 1591 | The special form @code{track-mouse} enables generation of motion |
| 1582 | within its body. Outside of @code{track-mouse} forms, Emacs does not | 1592 | events within its body. Outside of @code{track-mouse} forms, Emacs |
| 1583 | generate events for mere motion of the mouse, and these events do not | 1593 | does not generate events for mere motion of the mouse, and these |
| 1584 | appear. @xref{Mouse Tracking}. | 1594 | events do not appear. @xref{Mouse Tracking}. |
| 1585 | 1595 | ||
| 1586 | @node Focus Events | 1596 | @node Focus Events |
| 1587 | @subsection Focus Events | 1597 | @subsection Focus Events |
| @@ -1648,13 +1658,11 @@ frame has already been made visible, Emacs has no work to do. | |||
| 1648 | @cindex @code{wheel-up} event | 1658 | @cindex @code{wheel-up} event |
| 1649 | @cindex @code{wheel-down} event | 1659 | @cindex @code{wheel-down} event |
| 1650 | @item (wheel-up @var{position}) | 1660 | @item (wheel-up @var{position}) |
| 1651 | @item (wheel-down @var{position}) | 1661 | @itemx (wheel-down @var{position}) |
| 1652 | These kinds of event are generated by moving a mouse wheel. Their | 1662 | These kinds of event are generated by moving a mouse wheel. The |
| 1653 | usual meaning is a kind of scroll or zoom. | 1663 | @var{position} element is a mouse position list (@pxref{Click |
| 1654 | 1664 | Events}), specifying the position of the mouse cursor when the event | |
| 1655 | The element @var{position} is a list describing the position of the | 1665 | occurred. |
| 1656 | event, in the same format as used in a mouse-click event (@pxref{Click | ||
| 1657 | Events}). | ||
| 1658 | 1666 | ||
| 1659 | @vindex mouse-wheel-up-event | 1667 | @vindex mouse-wheel-up-event |
| 1660 | @vindex mouse-wheel-down-event | 1668 | @vindex mouse-wheel-down-event |
| @@ -1922,14 +1930,8 @@ must be the last element of the list. For example, | |||
| 1922 | This section describes convenient functions for accessing the data in | 1930 | This section describes convenient functions for accessing the data in |
| 1923 | a mouse button or motion event. | 1931 | a mouse button or motion event. |
| 1924 | 1932 | ||
| 1925 | These two functions return the starting or ending position of a | 1933 | The following two functions return a mouse position list |
| 1926 | mouse-button event, as a list of this form (@pxref{Click Events}): | 1934 | (@pxref{Click Events}), specifying the position of a mouse event. |
| 1927 | |||
| 1928 | @example | ||
| 1929 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} | ||
| 1930 | @var{object} @var{text-pos} (@var{col} . @var{row}) | ||
| 1931 | @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) | ||
| 1932 | @end example | ||
| 1933 | 1935 | ||
| 1934 | @defun event-start event | 1936 | @defun event-start event |
| 1935 | This returns the starting position of @var{event}. | 1937 | This returns the starting position of @var{event}. |
| @@ -1948,9 +1950,15 @@ event, the value is actually the starting position, which is the only | |||
| 1948 | position such events have. | 1950 | position such events have. |
| 1949 | @end defun | 1951 | @end defun |
| 1950 | 1952 | ||
| 1953 | @defun posnp object | ||
| 1954 | This function returns non-@code{nil} if @var{object} is a mouse | ||
| 1955 | oposition list, in either of the formats documented in @ref{Click | ||
| 1956 | Events}); and @code{nil} otherwise. | ||
| 1957 | @end defun | ||
| 1958 | |||
| 1951 | @cindex mouse position list, accessing | 1959 | @cindex mouse position list, accessing |
| 1952 | These functions take a position list as described above, and | 1960 | These functions take a mouse position list as argument, and return |
| 1953 | return various parts of it. | 1961 | various parts of it: |
| 1954 | 1962 | ||
| 1955 | @defun posn-window position | 1963 | @defun posn-window position |
| 1956 | Return the window that @var{position} is in. | 1964 | Return the window that @var{position} is in. |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index db770616820..d46cb071bf7 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -516,6 +516,7 @@ Functions | |||
| 516 | * Obsolete Functions:: Declaring functions obsolete. | 516 | * Obsolete Functions:: Declaring functions obsolete. |
| 517 | * Inline Functions:: Defining functions that the compiler | 517 | * Inline Functions:: Defining functions that the compiler |
| 518 | will expand inline. | 518 | will expand inline. |
| 519 | * Declare Form:: Adding additional information about a function. | ||
| 519 | * Declaring Functions:: Telling the compiler that a function is defined. | 520 | * Declaring Functions:: Telling the compiler that a function is defined. |
| 520 | * Function Safety:: Determining whether a function is safe to call. | 521 | * Function Safety:: Determining whether a function is safe to call. |
| 521 | * Related Topics:: Cross-references to specific Lisp primitives | 522 | * Related Topics:: Cross-references to specific Lisp primitives |
diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index a822a2d9608..b7b26c8708c 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi | |||
| @@ -37,78 +37,69 @@ handled. | |||
| 37 | 37 | ||
| 38 | @table @code | 38 | @table @code |
| 39 | @item error | 39 | @item error |
| 40 | @code{"error"}@* | 40 | The message is @samp{error}. @xref{Errors}. |
| 41 | @xref{Errors}. | ||
| 42 | 41 | ||
| 43 | @item quit | 42 | @item quit |
| 44 | @code{"Quit"}@* | 43 | The message is @samp{Quit}. @xref{Quitting}. |
| 45 | @xref{Quitting}. | ||
| 46 | 44 | ||
| 47 | @item args-out-of-range | 45 | @item args-out-of-range |
| 48 | @code{"Args out of range"}@* | 46 | The message is @samp{Args out of range}. This happens when trying to |
| 49 | This happens when trying to access an element beyond the range of a | 47 | access an element beyond the range of a sequence, buffer, or other |
| 50 | sequence or buffer.@* | 48 | container-like object. @xref{Sequences Arrays Vectors}, and |
| 51 | @xref{Sequences Arrays Vectors}, @xref{Text}. | 49 | @xref{Text}. |
| 52 | 50 | ||
| 53 | @item arith-error | 51 | @item arith-error |
| 54 | @code{"Arithmetic error"}@* | 52 | The message is @samp{Arithmetic error}. This occurs when trying to |
| 53 | perform integer division by zero. @xref{Numeric Conversions}, and | ||
| 55 | @xref{Arithmetic Operations}. | 54 | @xref{Arithmetic Operations}. |
| 56 | 55 | ||
| 57 | @item beginning-of-buffer | 56 | @item beginning-of-buffer |
| 58 | @code{"Beginning of buffer"}@* | 57 | The message is @samp{Beginning of buffer}. @xref{Character Motion}. |
| 59 | @xref{Character Motion}. | ||
| 60 | 58 | ||
| 61 | @item buffer-read-only | 59 | @item buffer-read-only |
| 62 | @code{"Buffer is read-only"}@* | 60 | The message is @samp{Buffer is read-only}. @xref{Read Only Buffers}. |
| 63 | @xref{Read Only Buffers}. | ||
| 64 | 61 | ||
| 65 | @item circular-list | 62 | @item circular-list |
| 66 | @code{"List contains a loop"}@* | 63 | The message is @samp{List contains a loop}. This happens when a |
| 67 | This happens when some operations (e.g. resolving face names) | 64 | circular structure is encountered. @xref{Circular Objects}. |
| 68 | encounter circular structures.@* | ||
| 69 | @xref{Circular Objects}. | ||
| 70 | 65 | ||
| 71 | @item cl-assertion-failed | 66 | @item cl-assertion-failed |
| 72 | @code{"Assertion failed"}@* | 67 | The message is @samp{Assertion failed}. This happens when the |
| 73 | This happens when the @code{assert} macro fails a test.@* | 68 | @code{assert} macro fails a test. @xref{Assertions,,, cl, Common Lisp |
| 74 | @xref{Assertions,,, cl, Common Lisp Extensions}. | 69 | Extensions}. |
| 75 | 70 | ||
| 76 | @item coding-system-error | 71 | @item coding-system-error |
| 77 | @code{"Invalid coding system"}@* | 72 | The message is @samp{Invalid coding system}. @xref{Lisp and Coding |
| 78 | @xref{Lisp and Coding Systems}. | 73 | Systems}. |
| 79 | 74 | ||
| 80 | @item cyclic-function-indirection | 75 | @item cyclic-function-indirection |
| 81 | @code{"Symbol's chain of function indirections contains a loop"}@* | 76 | The message is @samp{Symbol's chain of function indirections contains |
| 82 | @xref{Function Indirection}. | 77 | a loop}. @xref{Function Indirection}. |
| 83 | 78 | ||
| 84 | @item cyclic-variable-indirection | 79 | @item cyclic-variable-indirection |
| 85 | @code{"Symbol's chain of variable indirections contains a loop"}@* | 80 | The message is @samp{Symbol's chain of variable indirections contains |
| 86 | @xref{Variable Aliases}. | 81 | a loop}. @xref{Variable Aliases}. |
| 87 | 82 | ||
| 88 | @item dbus-error | 83 | @item dbus-error |
| 89 | @code{"D-Bus error"}@* | 84 | The message is @samp{D-Bus error}. This is only defined if Emacs was |
| 90 | This is only defined if Emacs was compiled with D-Bus support.@* | 85 | compiled with D-Bus support. @xref{Errors and Events,,, dbus, D-Bus |
| 91 | @xref{Errors and Events,,, dbus, D-Bus integration in Emacs}. | 86 | integration in Emacs}. |
| 92 | 87 | ||
| 93 | @item end-of-buffer | 88 | @item end-of-buffer |
| 94 | @code{"End of buffer"}@* | 89 | The message is @samp{End of buffer}. @xref{Character Motion}. |
| 95 | @xref{Character Motion}. | ||
| 96 | 90 | ||
| 97 | @item end-of-file | 91 | @item end-of-file |
| 98 | @code{"End of file during parsing"}@* | 92 | The message is @samp{End of file during parsing}. Note that this is |
| 99 | Note that this is not a subcategory of @code{file-error}, | 93 | not a subcategory of @code{file-error}, because it pertains to the |
| 100 | because it pertains to the Lisp reader, not to file I/O.@* | 94 | Lisp reader, not to file I/O. @xref{Input Functions}. |
| 101 | @xref{Input Functions}. | ||
| 102 | 95 | ||
| 103 | @item file-already-exists | 96 | @item file-already-exists |
| 104 | This is a subcategory of @code{file-error}.@* | 97 | This is a subcategory of @code{file-error}. @xref{Writing to Files}. |
| 105 | @xref{Writing to Files}. | ||
| 106 | 98 | ||
| 107 | @item file-date-error | 99 | @item file-date-error |
| 108 | This is a subcategory of @code{file-error}. It occurs when | 100 | This is a subcategory of @code{file-error}. It occurs when |
| 109 | @code{copy-file} tries and fails to set the last-modification time of | 101 | @code{copy-file} tries and fails to set the last-modification time of |
| 110 | the output file.@* | 102 | the output file. @xref{Changing Files}. |
| 111 | @xref{Changing Files}. | ||
| 112 | 103 | ||
| 113 | @item file-error | 104 | @item file-error |
| 114 | We do not list the error-strings of this error and its subcategories, | 105 | We do not list the error-strings of this error and its subcategories, |
| @@ -116,122 +107,109 @@ because the error message is normally constructed from the data items | |||
| 116 | alone when the error condition @code{file-error} is present. Thus, | 107 | alone when the error condition @code{file-error} is present. Thus, |
| 117 | the error-strings are not very relevant. However, these error symbols | 108 | the error-strings are not very relevant. However, these error symbols |
| 118 | do have @code{error-message} properties, and if no data is provided, | 109 | do have @code{error-message} properties, and if no data is provided, |
| 119 | the @code{error-message} property @emph{is} used.@* | 110 | the @code{error-message} property @emph{is} used. @xref{Files}. |
| 120 | @xref{Files}. | ||
| 121 | 111 | ||
| 122 | @c jka-compr.el | 112 | @c jka-compr.el |
| 123 | @item compression-error | 113 | @item compression-error |
| 124 | This is a subcategory of @code{file-error}, which results from | 114 | This is a subcategory of @code{file-error}, which results from |
| 125 | problems handling a compressed file.@* | 115 | problems handling a compressed file. @xref{How Programs Do Loading}. |
| 126 | @xref{How Programs Do Loading}. | ||
| 127 | 116 | ||
| 128 | @c userlock.el | 117 | @c userlock.el |
| 129 | @item file-locked | 118 | @item file-locked |
| 130 | This is a subcategory of @code{file-error}.@* | 119 | This is a subcategory of @code{file-error}. @xref{File Locks}. |
| 131 | @xref{File Locks}. | ||
| 132 | 120 | ||
| 133 | @c userlock.el | 121 | @c userlock.el |
| 134 | @item file-supersession | 122 | @item file-supersession |
| 135 | This is a subcategory of @code{file-error}.@* | 123 | This is a subcategory of @code{file-error}. @xref{Modification Time}. |
| 136 | @xref{Modification Time}. | ||
| 137 | 124 | ||
| 138 | @c net/ange-ftp.el | 125 | @c net/ange-ftp.el |
| 139 | @item ftp-error | 126 | @item ftp-error |
| 140 | This is a subcategory of @code{file-error}, which results from problems | 127 | This is a subcategory of @code{file-error}, which results from |
| 141 | in accessing a remote file using ftp.@* | 128 | problems in accessing a remote file using ftp. @xref{Remote Files,,, |
| 142 | @xref{Remote Files,,, emacs, The GNU Emacs Manual}. | 129 | emacs, The GNU Emacs Manual}. |
| 143 | 130 | ||
| 144 | @item invalid-function | 131 | @item invalid-function |
| 145 | @code{"Invalid function"}@* | 132 | The message is @samp{Invalid function}. @xref{Function Indirection}. |
| 146 | @xref{Function Indirection}. | ||
| 147 | 133 | ||
| 148 | @item invalid-read-syntax | 134 | @item invalid-read-syntax |
| 149 | @code{"Invalid read syntax"}@* | 135 | The message is @samp{Invalid read syntax}. @xref{Printed |
| 150 | @xref{Printed Representation}. | 136 | Representation}. |
| 151 | 137 | ||
| 152 | @item invalid-regexp | 138 | @item invalid-regexp |
| 153 | @code{"Invalid regexp"}@* | 139 | The message is @samp{Invalid regexp}. @xref{Regular Expressions}. |
| 154 | @xref{Regular Expressions}. | ||
| 155 | 140 | ||
| 156 | @c simple.el | 141 | @c simple.el |
| 157 | @item mark-inactive | 142 | @item mark-inactive |
| 158 | @code{"The mark is not active now"}@* | 143 | The message is @samp{The mark is not active now}. @xref{The Mark}. |
| 159 | @xref{The Mark}. | ||
| 160 | 144 | ||
| 161 | @item no-catch | 145 | @item no-catch |
| 162 | @code{"No catch for tag"}@* | 146 | The message is @samp{No catch for tag}. @xref{Catch and Throw}. |
| 163 | @xref{Catch and Throw}. | ||
| 164 | 147 | ||
| 165 | @ignore | 148 | @ignore |
| 166 | @c Not actually used for anything? Probably definition should be removed. | 149 | @c Not actually used for anything? Probably definition should be removed. |
| 167 | @item protected-field | 150 | @item protected-field |
| 168 | @code{"Attempt to modify a protected field"} | 151 | The message is @samp{Attempt to modify a protected fiel. |
| 169 | @end ignore | 152 | @end ignore |
| 170 | 153 | ||
| 171 | @item scan-error | 154 | @item scan-error |
| 172 | @code{"Scan error"}@* | 155 | The message is @samp{Scan error}. This happens when certain |
| 173 | This happens when certain syntax-parsing functions | 156 | syntax-parsing functions find invalid syntax or mismatched |
| 174 | find invalid syntax or mismatched parentheses.@* | 157 | parentheses. @xref{List Motion}, and @xref{Parsing Expressions}. |
| 175 | @xref{List Motion}, and @ref{Parsing Expressions}. | ||
| 176 | 158 | ||
| 177 | @item search-failed | 159 | @item search-failed |
| 178 | @code{"Search failed"}@* | 160 | The message is @samp{Search failed}. @xref{Searching and Matching}. |
| 179 | @xref{Searching and Matching}. | ||
| 180 | 161 | ||
| 181 | @item setting-constant | 162 | @item setting-constant |
| 182 | @code{"Attempt to set a constant symbol"}@* | 163 | The message is @samp{Attempt to set a constant symbol}. This happens |
| 183 | The values of the symbols @code{nil} and @code{t}, | 164 | when attempting to assign values to @code{nil}, @code{t}, and keyword |
| 184 | and any symbols that start with @samp{:}, | 165 | symbols. @xref{Constant Variables}. |
| 185 | may not be changed.@* | ||
| 186 | @xref{Constant Variables, , Variables that Never Change}. | ||
| 187 | 166 | ||
| 188 | @c simple.el | 167 | @c simple.el |
| 189 | @item text-read-only | 168 | @item text-read-only |
| 190 | @code{"Text is read-only"}@* | 169 | The message is @samp{Text is read-only}. This is a subcategory of |
| 191 | This is a subcategory of @code{buffer-read-only}.@* | 170 | @code{buffer-read-only}. @xref{Special Properties}. |
| 192 | @xref{Special Properties}. | ||
| 193 | 171 | ||
| 194 | @item undefined-color | 172 | @item undefined-color |
| 195 | @code{"Undefined color"}@* | 173 | The message is @samp{Undefined color}. @xref{Color Names}. |
| 196 | @xref{Color Names}. | ||
| 197 | 174 | ||
| 198 | @item void-function | 175 | @item void-function |
| 199 | @code{"Symbol's function definition is void"}@* | 176 | The message is @samp{Symbol's function definition is void}. |
| 200 | @xref{Function Cells}. | 177 | @xref{Function Cells}. |
| 201 | 178 | ||
| 202 | @item void-variable | 179 | @item void-variable |
| 203 | @code{"Symbol's value as variable is void"}@* | 180 | The message is @samp{Symbol's value as variable is void}. |
| 204 | @xref{Accessing Variables}. | 181 | @xref{Accessing Variables}. |
| 205 | 182 | ||
| 206 | @item wrong-number-of-arguments | 183 | @item wrong-number-of-arguments |
| 207 | @code{"Wrong number of arguments"}@* | 184 | The message is @samp{Wrong number of arguments}. @xref{Classifying |
| 208 | @xref{Classifying Lists}. | 185 | Lists}. |
| 209 | 186 | ||
| 210 | @item wrong-type-argument | 187 | @item wrong-type-argument |
| 211 | @code{"Wrong type argument"}@* | 188 | The message is @samp{Wrong type argument}. @xref{Type Predicates}. |
| 212 | @xref{Type Predicates}. | ||
| 213 | @end table | 189 | @end table |
| 214 | 190 | ||
| 191 | @ignore The following seem to be unused now. | ||
| 215 | The following kinds of error, which are classified as special cases of | 192 | The following kinds of error, which are classified as special cases of |
| 216 | @code{arith-error}, can occur on certain systems for invalid use of | 193 | @code{arith-error}, can occur on certain systems for invalid use of |
| 217 | mathematical functions. @xref{Math Functions}. | 194 | mathematical functions. @xref{Math Functions}. |
| 218 | 195 | ||
| 219 | @table @code | 196 | @table @code |
| 220 | @item domain-error | 197 | @item domain-error |
| 221 | @code{"Arithmetic domain error"} | 198 | The message is @samp{Arithmetic domain error}. |
| 222 | 199 | ||
| 223 | @item overflow-error | 200 | @item overflow-error |
| 224 | @code{"Arithmetic overflow error"}@* | 201 | The message is @samp{Arithmetic overflow error}. This is a subcategory |
| 225 | This is a subcategory of @code{domain-error}. | 202 | of @code{domain-error}. |
| 226 | 203 | ||
| 227 | @item range-error | 204 | @item range-error |
| 228 | @code{"Arithmetic range error"} | 205 | The message is @code{Arithmetic range error}. |
| 229 | 206 | ||
| 230 | @item singularity-error | 207 | @item singularity-error |
| 231 | @code{"Arithmetic singularity error"}@* | 208 | The mssage is @samp{Arithmetic singularity error}. This is a |
| 232 | This is a subcategory of @code{domain-error}. | 209 | subcategory of @code{domain-error}. |
| 233 | 210 | ||
| 234 | @item underflow-error | 211 | @item underflow-error |
| 235 | @code{"Arithmetic underflow error"}@* | 212 | The message is @samp{Arithmetic underflow error}. This is a |
| 236 | This is a subcategory of @code{domain-error}. | 213 | subcategory of @code{domain-error}. |
| 237 | @end table | 214 | @end table |
| 215 | @end ignore | ||
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 356a891fbcd..af6f4b4c079 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -1529,24 +1529,14 @@ track of such changes. @xref{Misc Events}. | |||
| 1529 | @node Raising and Lowering | 1529 | @node Raising and Lowering |
| 1530 | @section Raising and Lowering Frames | 1530 | @section Raising and Lowering Frames |
| 1531 | 1531 | ||
| 1532 | Most window systems use a desktop metaphor. Part of this metaphor is | 1532 | @cindex raising a frame |
| 1533 | the idea that windows are stacked in a notional third dimension | ||
| 1534 | perpendicular to the screen surface, and thus ordered from ``highest'' | ||
| 1535 | to ``lowest''. Where two windows overlap, the one higher up covers | ||
| 1536 | the one underneath. Even a window at the bottom of the stack can be | ||
| 1537 | seen if no other window overlaps it. | ||
| 1538 | |||
| 1539 | @c @cindex raising a frame redundant with raise-frame | ||
| 1540 | @cindex lowering a frame | 1533 | @cindex lowering a frame |
| 1541 | A window's place in this ordering is not fixed; in fact, users tend | 1534 | Most window systems use a desktop metaphor. Part of this metaphor |
| 1542 | to change the order frequently. @dfn{Raising} a window means moving | 1535 | is the idea that system-level windows (e.g.@: Emacs frames) are |
| 1543 | it ``up'', to the top of the stack. @dfn{Lowering} a window means | 1536 | stacked in a notional third dimension perpendicular to the screen |
| 1544 | moving it to the bottom of the stack. This motion is in the notional | 1537 | surface. Where two overlap, the one higher up covers the one |
| 1545 | third dimension only, and does not change the position of the window | 1538 | underneath. You can @dfn{raise} or @dfn{lower} a frame using the |
| 1546 | on the screen. | 1539 | functions @code{raise-frame} and @code{lower-frame}. |
| 1547 | |||
| 1548 | With Emacs, frames constitute the windows in the metaphor sketched | ||
| 1549 | above. You can raise and lower frames using these functions: | ||
| 1550 | 1540 | ||
| 1551 | @deffn Command raise-frame &optional frame | 1541 | @deffn Command raise-frame &optional frame |
| 1552 | This function raises frame @var{frame} (default, the selected frame). | 1542 | This function raises frame @var{frame} (default, the selected frame). |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 9e1d3f9c6ae..cab6d12a3d8 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -23,6 +23,7 @@ define them. | |||
| 23 | * Closures:: Functions that enclose a lexical environment. | 23 | * Closures:: Functions that enclose a lexical environment. |
| 24 | * Obsolete Functions:: Declaring functions obsolete. | 24 | * Obsolete Functions:: Declaring functions obsolete. |
| 25 | * Inline Functions:: Functions that the compiler will expand inline. | 25 | * Inline Functions:: Functions that the compiler will expand inline. |
| 26 | * Declare Form:: Adding additional information about a function. | ||
| 26 | * Declaring Functions:: Telling the compiler that a function is defined. | 27 | * Declaring Functions:: Telling the compiler that a function is defined. |
| 27 | * Function Safety:: Determining whether a function is safe to call. | 28 | * Function Safety:: Determining whether a function is safe to call. |
| 28 | * Related Topics:: Cross-references to specific Lisp primitives | 29 | * Related Topics:: Cross-references to specific Lisp primitives |
| @@ -521,7 +522,7 @@ Scheme.) | |||
| 521 | is called @dfn{defining a function}, and it is done with the | 522 | is called @dfn{defining a function}, and it is done with the |
| 522 | @code{defun} special form. | 523 | @code{defun} special form. |
| 523 | 524 | ||
| 524 | @defspec defun name argument-list body-forms... | 525 | @defmac defun name argument-list body-forms... |
| 525 | @code{defun} is the usual way to define new Lisp functions. It | 526 | @code{defun} is the usual way to define new Lisp functions. It |
| 526 | defines the symbol @var{name} as a function that looks like this: | 527 | defines the symbol @var{name} as a function that looks like this: |
| 527 | 528 | ||
| @@ -578,7 +579,7 @@ without any hesitation or notification. Emacs does not prevent you | |||
| 578 | from doing this, because redefining a function is sometimes done | 579 | from doing this, because redefining a function is sometimes done |
| 579 | deliberately, and there is no way to distinguish deliberate | 580 | deliberately, and there is no way to distinguish deliberate |
| 580 | redefinition from unintentional redefinition. | 581 | redefinition from unintentional redefinition. |
| 581 | @end defspec | 582 | @end defmac |
| 582 | 583 | ||
| 583 | @cindex function aliases | 584 | @cindex function aliases |
| 584 | @defun defalias name definition &optional docstring | 585 | @defun defalias name definition &optional docstring |
| @@ -1132,29 +1133,46 @@ examining or altering the structure of closure objects. | |||
| 1132 | @node Obsolete Functions | 1133 | @node Obsolete Functions |
| 1133 | @section Declaring Functions Obsolete | 1134 | @section Declaring Functions Obsolete |
| 1134 | 1135 | ||
| 1135 | You can use @code{make-obsolete} to declare a function obsolete. This | 1136 | You can mark a named function as @dfn{obsolete}, meaning that it may |
| 1136 | indicates that the function may be removed at some stage in the future. | 1137 | be removed at some point in the future. This causes Emacs to warn |
| 1138 | that the function is obsolete whenever it byte-compiles code | ||
| 1139 | containing that function, and whenever it displays the documentation | ||
| 1140 | for that function. In all other respects, an obsolete function | ||
| 1141 | behaves like any other function. | ||
| 1142 | |||
| 1143 | The easiest way to mark a function as obsolete is to put a | ||
| 1144 | @code{(declare (obsolete @dots{}))} form in the function's | ||
| 1145 | @code{defun} definition. @xref{Declare Form}. Alternatively, you can | ||
| 1146 | use the @code{make-obsolete} function, described below. | ||
| 1147 | |||
| 1148 | A macro (@pxref{Macros}) can also be marked obsolete with | ||
| 1149 | @code{make-obsolete}; this has the same effects as for a function. An | ||
| 1150 | alias for a function or macro can also be marked as obsolete; this | ||
| 1151 | makes the alias itself obsolete, not the function or macro which it | ||
| 1152 | resolves to. | ||
| 1137 | 1153 | ||
| 1138 | @defun make-obsolete obsolete-name current-name &optional when | 1154 | @defun make-obsolete obsolete-name current-name &optional when |
| 1139 | This function makes the byte compiler warn that the function | 1155 | This function marks @var{obsolete-name} as obsolete. |
| 1140 | @var{obsolete-name} is obsolete. If @var{current-name} is a symbol, the | 1156 | @var{obsolete-name} should be a symbol naming a function or macro, or |
| 1141 | warning message says to use @var{current-name} instead of | 1157 | an alias for a function or macro. |
| 1142 | @var{obsolete-name}. @var{current-name} does not need to be an alias for | 1158 | |
| 1143 | @var{obsolete-name}; it can be a different function with similar | 1159 | If @var{current-name} is a symbol, the warning message says to use |
| 1144 | functionality. If @var{current-name} is a string, it is the warning | 1160 | @var{current-name} instead of @var{obsolete-name}. @var{current-name} |
| 1145 | message. | 1161 | does not need to be an alias for @var{obsolete-name}; it can be a |
| 1162 | different function with similar functionality. @var{current-name} can | ||
| 1163 | also be a string, which serves as the warning message. The message | ||
| 1164 | should begin in lower case, and end with a period. It can also be | ||
| 1165 | @code{nil}, in which case the warning message provides no additional | ||
| 1166 | details. | ||
| 1146 | 1167 | ||
| 1147 | If provided, @var{when} should be a string indicating when the function | 1168 | If provided, @var{when} should be a string indicating when the function |
| 1148 | was first made obsolete---for example, a date or a release number. | 1169 | was first made obsolete---for example, a date or a release number. |
| 1149 | @end defun | 1170 | @end defun |
| 1150 | 1171 | ||
| 1151 | You can define a function as an alias and declare it obsolete at the | ||
| 1152 | same time using the macro @code{define-obsolete-function-alias}: | ||
| 1153 | |||
| 1154 | @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring | 1172 | @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring |
| 1155 | This macro marks the function @var{obsolete-name} obsolete and also | 1173 | This convenience macro marks the function @var{obsolete-name} obsolete |
| 1156 | defines it as an alias for the function @var{current-name}. It is | 1174 | and also defines it as an alias for the function @var{current-name}. |
| 1157 | equivalent to the following: | 1175 | It is equivalent to the following: |
| 1158 | 1176 | ||
| 1159 | @example | 1177 | @example |
| 1160 | (defalias @var{obsolete-name} @var{current-name} @var{docstring}) | 1178 | (defalias @var{obsolete-name} @var{current-name} @var{docstring}) |
| @@ -1236,6 +1254,63 @@ body uses the arguments, as you do for macros. | |||
| 1236 | After an inline function is defined, its inline expansion can be | 1254 | After an inline function is defined, its inline expansion can be |
| 1237 | performed later on in the same file, just like macros. | 1255 | performed later on in the same file, just like macros. |
| 1238 | 1256 | ||
| 1257 | @node Declare Form | ||
| 1258 | @section The @code{declare} Form | ||
| 1259 | @findex declare | ||
| 1260 | |||
| 1261 | @code{declare} is a special macro which can be used to add ``meta'' | ||
| 1262 | properties to a function or macro: for example, marking it as | ||
| 1263 | obsolete, or giving its forms a special @key{TAB} indentation | ||
| 1264 | convention in Emacs Lisp mode. | ||
| 1265 | |||
| 1266 | @anchor{Definition of declare} | ||
| 1267 | @defmac declare @var{specs}@dots{} | ||
| 1268 | This macro ignores its arguments and evaluates to @code{nil}; it has | ||
| 1269 | no run-time effect. However, when a @code{declare} form occurs as the | ||
| 1270 | @emph{very first form} in the body of a @code{defun} function | ||
| 1271 | definition or a @code{defmacro} macro definition (@pxref{Defining | ||
| 1272 | Macros}, for a description of @code{defmacro}), it appends the | ||
| 1273 | properties specified by @var{specs} to the function or macro. This | ||
| 1274 | work is specially performed by the @code{defun} and @code{defmacro} | ||
| 1275 | macros. | ||
| 1276 | |||
| 1277 | Note that if you put a @code{declare} form in an interactive function, | ||
| 1278 | it should go before the @code{interactive} form. | ||
| 1279 | |||
| 1280 | Each element in @var{specs} should have the form @code{(@var{property} | ||
| 1281 | @var{args}@dots{})}, which should not be quoted. These have the | ||
| 1282 | following effects: | ||
| 1283 | |||
| 1284 | @table @code | ||
| 1285 | @item (advertised-calling-convention @var{signature} @var{when}) | ||
| 1286 | This acts like a call to @code{set-advertised-calling-convention} | ||
| 1287 | (@pxref{Obsolete Functions}); @var{signature} specifies the correct | ||
| 1288 | argument list for calling the function or macro, and @var{when} should | ||
| 1289 | be a string indicating when the variable was first made obsolete. | ||
| 1290 | |||
| 1291 | @item (debug @var{edebug-form-spec}) | ||
| 1292 | This is valid for macros only. When stepping through the macro with | ||
| 1293 | Edebug, use @var{edebug-form-spec}. @xref{Instrumenting Macro Calls}. | ||
| 1294 | |||
| 1295 | @item (doc-string @var{n}) | ||
| 1296 | Use element number @var{n}, if any, as the documentation string. | ||
| 1297 | |||
| 1298 | @item (indent @var{indent-spec}) | ||
| 1299 | Indent calls to this function or macro according to @var{indent-spec}. | ||
| 1300 | This is typically used for macros, though it works for functions too. | ||
| 1301 | @xref{Indenting Macros}. | ||
| 1302 | |||
| 1303 | @item (obsolete @var{current-name} @var{when}) | ||
| 1304 | Mark the function or macro as obsolete, similar to a call to | ||
| 1305 | @code{make-obsolete} (@pxref{Obsolete Functions}). @var{current-name} | ||
| 1306 | should be a symbol (in which case the warning message says to use that | ||
| 1307 | instead), a string (specifying the warning message), or @code{nil} (in | ||
| 1308 | which case the warning message gives no extra details). @var{when} | ||
| 1309 | should be a string indicating when the function or macro was first | ||
| 1310 | made obsolete. | ||
| 1311 | @end table | ||
| 1312 | @end defmac | ||
| 1313 | |||
| 1239 | @node Declaring Functions | 1314 | @node Declaring Functions |
| 1240 | @section Telling the Compiler that a Function is Defined | 1315 | @section Telling the Compiler that a Function is Defined |
| 1241 | @cindex function declaration | 1316 | @cindex function declaration |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 5dd8f3c11f5..1375a057a5a 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -58,11 +58,17 @@ use @kbd{C-h f} (@code{describe-function}) or @kbd{C-h v} | |||
| 58 | are many other conventions for documentation strings; see | 58 | are many other conventions for documentation strings; see |
| 59 | @ref{Documentation Tips}. | 59 | @ref{Documentation Tips}. |
| 60 | 60 | ||
| 61 | Documentation strings can contain several special substrings, which | 61 | Documentation strings can contain several special text sequences, |
| 62 | stand for key bindings to be looked up in the current keymaps when the | 62 | referring to key bindings which are looked up in the current keymaps |
| 63 | documentation is displayed. This allows documentation strings to refer | 63 | when the user views the documentation. This allows the help commands |
| 64 | to the keys for related commands and be accurate even when a user | 64 | to display the correct keys even if a user rearranges the default key |
| 65 | rearranges the key bindings. (@xref{Keys in Documentation}.) | 65 | bindings. @xref{Keys in Documentation}. |
| 66 | |||
| 67 | In the documentation string of an autoloaded command | ||
| 68 | (@pxref{Autoload}), these special text sequences have an additional | ||
| 69 | special effect: they cause @kbd{C-h f} (@code{describe-function}) on | ||
| 70 | the command to trigger autoloading. (This is needed for correctly | ||
| 71 | setting up the hyperlinks in the @file{*Help*} buffer). | ||
| 66 | 72 | ||
| 67 | @vindex emacs-lisp-docstring-fill-column | 73 | @vindex emacs-lisp-docstring-fill-column |
| 68 | Emacs Lisp mode fills documentation strings to the width | 74 | Emacs Lisp mode fills documentation strings to the width |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 3c9bee96639..aa243185359 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -384,11 +384,13 @@ non-@acronym{ASCII} characters written as @code{?v@var{literal}}. | |||
| 384 | @section Autoload | 384 | @section Autoload |
| 385 | @cindex autoload | 385 | @cindex autoload |
| 386 | 386 | ||
| 387 | The @dfn{autoload} facility allows you to register the existence of | 387 | The @dfn{autoload} facility lets you register the existence of a |
| 388 | a function or macro, but put off loading the file that defines it. | 388 | function or macro, but put off loading the file that defines it. The |
| 389 | The first call to the function automatically reads the proper file, in | 389 | first call to the function automatically loads the proper library, in |
| 390 | order to install the real definition and other associated code, then | 390 | order to install the real definition and other associated code, then |
| 391 | runs the real definition as if it had been loaded all along. | 391 | runs the real definition as if it had been loaded all along. |
| 392 | Autoloading can also be triggered by looking up the documentation of | ||
| 393 | the function or macro (@pxref{Documentation Basics}). | ||
| 392 | 394 | ||
| 393 | There are two ways to set up an autoloaded function: by calling | 395 | There are two ways to set up an autoloaded function: by calling |
| 394 | @code{autoload}, and by writing a special ``magic'' comment in the | 396 | @code{autoload}, and by writing a special ``magic'' comment in the |
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi index efe298bf647..0a5152a43a1 100644 --- a/doc/lispref/macros.texi +++ b/doc/lispref/macros.texi | |||
| @@ -235,43 +235,8 @@ of constants and nonconstant parts. To make this easier, use the | |||
| 235 | @end example | 235 | @end example |
| 236 | 236 | ||
| 237 | The body of a macro definition can include a @code{declare} form, | 237 | The body of a macro definition can include a @code{declare} form, |
| 238 | which can specify how @key{TAB} should indent macro calls, and how to | 238 | which specifies additional properties about the macro. @xref{Declare |
| 239 | step through them for Edebug. | 239 | Form}. |
| 240 | |||
| 241 | @defmac declare @var{specs}@dots{} | ||
| 242 | @anchor{Definition of declare} | ||
| 243 | A @code{declare} form is used in a macro definition to specify various | ||
| 244 | additional information about it. The following specifications are | ||
| 245 | currently supported: | ||
| 246 | |||
| 247 | @table @code | ||
| 248 | @item (debug @var{edebug-form-spec}) | ||
| 249 | Specify how to step through macro calls for Edebug. | ||
| 250 | @xref{Instrumenting Macro Calls}. | ||
| 251 | |||
| 252 | @item (indent @var{indent-spec}) | ||
| 253 | Specify how to indent calls to this macro. @xref{Indenting Macros}, | ||
| 254 | for more details. | ||
| 255 | |||
| 256 | @item (doc-string @var{number}) | ||
| 257 | Specify which element of the macro is the documentation string, if | ||
| 258 | any. | ||
| 259 | @end table | ||
| 260 | |||
| 261 | A @code{declare} form only has its special effect in the body of a | ||
| 262 | @code{defmacro} form if it immediately follows the documentation | ||
| 263 | string, if present, or the argument list otherwise. (Strictly | ||
| 264 | speaking, @emph{several} @code{declare} forms can follow the | ||
| 265 | documentation string or argument list, but since a @code{declare} form | ||
| 266 | can have several @var{specs}, they can always be combined into a | ||
| 267 | single form.) When used at other places in a @code{defmacro} form, or | ||
| 268 | outside a @code{defmacro} form, @code{declare} just returns @code{nil} | ||
| 269 | without evaluating any @var{specs}. | ||
| 270 | @end defmac | ||
| 271 | |||
| 272 | No macro absolutely needs a @code{declare} form, because that form | ||
| 273 | has no effect on how the macro expands, on what the macro means in the | ||
| 274 | program. It only affects the secondary features listed above. | ||
| 275 | 240 | ||
| 276 | @node Problems with Macros | 241 | @node Problems with Macros |
| 277 | @section Common Problems Using Macros | 242 | @section Common Problems Using Macros |
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 7c9672a38c0..a086f2b3af1 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi | |||
| @@ -48,9 +48,8 @@ to | |||
| 48 | @tex | 48 | @tex |
| 49 | @math{2^{29}-1}), | 49 | @math{2^{29}-1}), |
| 50 | @end tex | 50 | @end tex |
| 51 | but some machines provide a wider range. Many examples in this | 51 | but many machines provide a wider range. Many examples in this |
| 52 | chapter assume that an integer has 30 bits and that floating point | 52 | chapter assume the minimum integer width of 30 bits. |
| 53 | numbers are IEEE double precision. | ||
| 54 | @cindex overflow | 53 | @cindex overflow |
| 55 | 54 | ||
| 56 | The Lisp reader reads an integer as a sequence of digits with optional | 55 | The Lisp reader reads an integer as a sequence of digits with optional |
| @@ -160,8 +159,9 @@ The value of this variable is the smallest integer that Emacs Lisp can | |||
| 160 | handle. It is negative. | 159 | handle. It is negative. |
| 161 | @end defvar | 160 | @end defvar |
| 162 | 161 | ||
| 163 | @xref{Character Codes, max-char}, for the maximum value of a valid | 162 | In Emacs Lisp, text characters are represented by integers. Any |
| 164 | character codepoint. | 163 | integer between zero and the value of @code{max-char}, inclusive, is |
| 164 | considered to be valid as a character. @xref{String Basics}. | ||
| 165 | 165 | ||
| 166 | @node Float Basics | 166 | @node Float Basics |
| 167 | @section Floating Point Basics | 167 | @section Floating Point Basics |
| @@ -171,8 +171,8 @@ character codepoint. | |||
| 171 | not integral. The precise range of floating point numbers is | 171 | not integral. The precise range of floating point numbers is |
| 172 | machine-specific; it is the same as the range of the C data type | 172 | machine-specific; it is the same as the range of the C data type |
| 173 | @code{double} on the machine you are using. Emacs uses the | 173 | @code{double} on the machine you are using. Emacs uses the |
| 174 | @acronym{IEEE} floating point standard where possible (the standard is | 174 | @acronym{IEEE} floating point standard, which is supported by all |
| 175 | supported by most modern computers). | 175 | modern computers. |
| 176 | 176 | ||
| 177 | The read syntax for floating point numbers requires either a decimal | 177 | The read syntax for floating point numbers requires either a decimal |
| 178 | point (with at least one digit following), an exponent, or both. For | 178 | point (with at least one digit following), an exponent, or both. For |
| @@ -316,17 +316,16 @@ compare them, then you test whether two values are the same | |||
| 316 | @emph{object}. By contrast, @code{=} compares only the numeric values | 316 | @emph{object}. By contrast, @code{=} compares only the numeric values |
| 317 | of the objects. | 317 | of the objects. |
| 318 | 318 | ||
| 319 | At present, each integer value has a unique Lisp object in Emacs Lisp. | 319 | In Emacs Lisp, each integer value is a unique Lisp object. |
| 320 | Therefore, @code{eq} is equivalent to @code{=} where integers are | 320 | Therefore, @code{eq} is equivalent to @code{=} where integers are |
| 321 | concerned. It is sometimes convenient to use @code{eq} for comparing an | 321 | concerned. It is sometimes convenient to use @code{eq} for comparing |
| 322 | unknown value with an integer, because @code{eq} does not report an | 322 | an unknown value with an integer, because @code{eq} does not report an |
| 323 | error if the unknown value is not a number---it accepts arguments of any | 323 | error if the unknown value is not a number---it accepts arguments of |
| 324 | type. By contrast, @code{=} signals an error if the arguments are not | 324 | any type. By contrast, @code{=} signals an error if the arguments are |
| 325 | numbers or markers. However, it is a good idea to use @code{=} if you | 325 | not numbers or markers. However, it is better programming practice to |
| 326 | can, even for comparing integers, just in case we change the | 326 | use @code{=} if you can, even for comparing integers. |
| 327 | representation of integers in a future Emacs version. | 327 | |
| 328 | 328 | Sometimes it is useful to compare numbers with @code{equal}, which | |
| 329 | Sometimes it is useful to compare numbers with @code{equal}; it | ||
| 330 | treats two numbers as equal if they have the same data type (both | 329 | treats two numbers as equal if they have the same data type (both |
| 331 | integers, or both floating point) and the same value. By contrast, | 330 | integers, or both floating point) and the same value. By contrast, |
| 332 | @code{=} can treat an integer and a floating point number as equal. | 331 | @code{=} can treat an integer and a floating point number as equal. |
| @@ -439,15 +438,16 @@ If @var{number} is already a floating point number, @code{float} returns | |||
| 439 | it unchanged. | 438 | it unchanged. |
| 440 | @end defun | 439 | @end defun |
| 441 | 440 | ||
| 442 | There are four functions to convert floating point numbers to integers; | 441 | There are four functions to convert floating point numbers to |
| 443 | they differ in how they round. All accept an argument @var{number} | 442 | integers; they differ in how they round. All accept an argument |
| 444 | and an optional argument @var{divisor}. Both arguments may be | 443 | @var{number} and an optional argument @var{divisor}. Both arguments |
| 445 | integers or floating point numbers. @var{divisor} may also be | 444 | may be integers or floating point numbers. @var{divisor} may also be |
| 446 | @code{nil}. If @var{divisor} is @code{nil} or omitted, these | 445 | @code{nil}. If @var{divisor} is @code{nil} or omitted, these |
| 447 | functions convert @var{number} to an integer, or return it unchanged | 446 | functions convert @var{number} to an integer, or return it unchanged |
| 448 | if it already is an integer. If @var{divisor} is non-@code{nil}, they | 447 | if it already is an integer. If @var{divisor} is non-@code{nil}, they |
| 449 | divide @var{number} by @var{divisor} and convert the result to an | 448 | divide @var{number} by @var{divisor} and convert the result to an |
| 450 | integer. An @code{arith-error} results if @var{divisor} is 0. | 449 | integer. integer. If @var{divisor} is zero (whether integer or |
| 450 | floating-point), Emacs signals an @code{arith-error} error. | ||
| 451 | 451 | ||
| 452 | @defun truncate number &optional divisor | 452 | @defun truncate number &optional divisor |
| 453 | This returns @var{number}, converted to an integer by rounding towards | 453 | This returns @var{number}, converted to an integer by rounding towards |
| @@ -524,14 +524,12 @@ depending on your machine. | |||
| 524 | @section Arithmetic Operations | 524 | @section Arithmetic Operations |
| 525 | @cindex arithmetic operations | 525 | @cindex arithmetic operations |
| 526 | 526 | ||
| 527 | Emacs Lisp provides the traditional four arithmetic operations: | 527 | Emacs Lisp provides the traditional four arithmetic operations |
| 528 | addition, subtraction, multiplication, and division. Remainder and modulus | 528 | (addition, subtraction, multiplication, and division), as well as |
| 529 | functions supplement the division functions. The functions to | 529 | remainder and modulus functions, and functions to add or subtract 1. |
| 530 | add or subtract 1 are provided because they are traditional in Lisp and | 530 | Except for @code{%}, each of these functions accepts both integer and |
| 531 | commonly used. | 531 | floating point arguments, and returns a floating point number if any |
| 532 | 532 | argument is a floating point number. | |
| 533 | All of these functions except @code{%} return a floating point value | ||
| 534 | if any argument is floating. | ||
| 535 | 533 | ||
| 536 | It is important to note that in Emacs Lisp, arithmetic functions | 534 | It is important to note that in Emacs Lisp, arithmetic functions |
| 537 | do not check for overflow. Thus @code{(1+ 536870911)} may evaluate to | 535 | do not check for overflow. Thus @code{(1+ 536870911)} may evaluate to |
| @@ -620,40 +618,49 @@ quotient. If there are additional arguments @var{divisors}, then it | |||
| 620 | divides @var{dividend} by each divisor in turn. Each argument may be a | 618 | divides @var{dividend} by each divisor in turn. Each argument may be a |
| 621 | number or a marker. | 619 | number or a marker. |
| 622 | 620 | ||
| 623 | If all the arguments are integers, then the result is an integer too. | 621 | If all the arguments are integers, the result is an integer, obtained |
| 624 | This means the result has to be rounded. On most machines, the result | 622 | by rounding the quotient towards zero after each division. |
| 625 | is rounded towards zero after each division, but some machines may round | 623 | (Hypothetically, some machines may have different rounding behavior |
| 626 | differently with negative arguments. This is because the Lisp function | 624 | for negative arguments, because @code{/} is implemented using the C |
| 627 | @code{/} is implemented using the C division operator, which also | 625 | division operator, which permits machine-dependent rounding; but this |
| 628 | permits machine-dependent rounding. As a practical matter, all known | 626 | does not happen in practice.) |
| 629 | machines round in the standard fashion. | ||
| 630 | |||
| 631 | @cindex @code{arith-error} in division | ||
| 632 | If you divide an integer by 0, an @code{arith-error} error is signaled. | ||
| 633 | (@xref{Errors}.) Floating point division by zero returns either | ||
| 634 | infinity or a NaN if your machine supports @acronym{IEEE} floating point; | ||
| 635 | otherwise, it signals an @code{arith-error} error. | ||
| 636 | 627 | ||
| 637 | @example | 628 | @example |
| 638 | @group | 629 | @group |
| 639 | (/ 6 2) | 630 | (/ 6 2) |
| 640 | @result{} 3 | 631 | @result{} 3 |
| 641 | @end group | 632 | @end group |
| 633 | @group | ||
| 642 | (/ 5 2) | 634 | (/ 5 2) |
| 643 | @result{} 2 | 635 | @result{} 2 |
| 636 | @end group | ||
| 637 | @group | ||
| 644 | (/ 5.0 2) | 638 | (/ 5.0 2) |
| 645 | @result{} 2.5 | 639 | @result{} 2.5 |
| 640 | @end group | ||
| 641 | @group | ||
| 646 | (/ 5 2.0) | 642 | (/ 5 2.0) |
| 647 | @result{} 2.5 | 643 | @result{} 2.5 |
| 644 | @end group | ||
| 645 | @group | ||
| 648 | (/ 5.0 2.0) | 646 | (/ 5.0 2.0) |
| 649 | @result{} 2.5 | 647 | @result{} 2.5 |
| 648 | @end group | ||
| 649 | @group | ||
| 650 | (/ 25 3 2) | 650 | (/ 25 3 2) |
| 651 | @result{} 4 | 651 | @result{} 4 |
| 652 | @end group | ||
| 652 | @group | 653 | @group |
| 653 | (/ -17 6) | 654 | (/ -17 6) |
| 654 | @result{} -2 @r{(could in theory be @minus{}3 on some machines)} | 655 | @result{} -2 |
| 655 | @end group | 656 | @end group |
| 656 | @end example | 657 | @end example |
| 658 | |||
| 659 | @cindex @code{arith-error} in division | ||
| 660 | If you divide an integer by the integer 0, Emacs signals an | ||
| 661 | @code{arith-error} error (@pxref{Errors}). If you divide a floating | ||
| 662 | point number by 0, or divide by the floating point number 0.0, the | ||
| 663 | result is either positive or negative infinity (@pxref{Float Basics}). | ||
| 657 | @end defun | 664 | @end defun |
| 658 | 665 | ||
| 659 | @defun % dividend divisor | 666 | @defun % dividend divisor |
| @@ -661,10 +668,18 @@ otherwise, it signals an @code{arith-error} error. | |||
| 661 | This function returns the integer remainder after division of @var{dividend} | 668 | This function returns the integer remainder after division of @var{dividend} |
| 662 | by @var{divisor}. The arguments must be integers or markers. | 669 | by @var{divisor}. The arguments must be integers or markers. |
| 663 | 670 | ||
| 664 | For negative arguments, the remainder is in principle machine-dependent | 671 | For any two integers @var{dividend} and @var{divisor}, |
| 665 | since the quotient is; but in practice, all known machines behave alike. | 672 | |
| 673 | @example | ||
| 674 | @group | ||
| 675 | (+ (% @var{dividend} @var{divisor}) | ||
| 676 | (* (/ @var{dividend} @var{divisor}) @var{divisor})) | ||
| 677 | @end group | ||
| 678 | @end example | ||
| 666 | 679 | ||
| 667 | An @code{arith-error} results if @var{divisor} is 0. | 680 | @noindent |
| 681 | always equals @var{dividend}. If @var{divisor} is zero, Emacs signals | ||
| 682 | an @code{arith-error} error. | ||
| 668 | 683 | ||
| 669 | @example | 684 | @example |
| 670 | (% 9 4) | 685 | (% 9 4) |
| @@ -676,18 +691,6 @@ An @code{arith-error} results if @var{divisor} is 0. | |||
| 676 | (% -9 -4) | 691 | (% -9 -4) |
| 677 | @result{} -1 | 692 | @result{} -1 |
| 678 | @end example | 693 | @end example |
| 679 | |||
| 680 | For any two integers @var{dividend} and @var{divisor}, | ||
| 681 | |||
| 682 | @example | ||
| 683 | @group | ||
| 684 | (+ (% @var{dividend} @var{divisor}) | ||
| 685 | (* (/ @var{dividend} @var{divisor}) @var{divisor})) | ||
| 686 | @end group | ||
| 687 | @end example | ||
| 688 | |||
| 689 | @noindent | ||
| 690 | always equals @var{dividend}. | ||
| 691 | @end defun | 694 | @end defun |
| 692 | 695 | ||
| 693 | @defun mod dividend divisor | 696 | @defun mod dividend divisor |
| @@ -697,10 +700,9 @@ in other words, the remainder after division of @var{dividend} | |||
| 697 | by @var{divisor}, but with the same sign as @var{divisor}. | 700 | by @var{divisor}, but with the same sign as @var{divisor}. |
| 698 | The arguments must be numbers or markers. | 701 | The arguments must be numbers or markers. |
| 699 | 702 | ||
| 700 | Unlike @code{%}, @code{mod} returns a well-defined result for negative | 703 | Unlike @code{%}, @code{mod} permits floating point arguments; it |
| 701 | arguments. It also permits floating point arguments; it rounds the | 704 | rounds the quotient downward (towards minus infinity) to an integer, |
| 702 | quotient downward (towards minus infinity) to an integer, and uses that | 705 | and uses that quotient to compute the remainder. |
| 703 | quotient to compute the remainder. | ||
| 704 | 706 | ||
| 705 | If @var{divisor} is zero, @code{mod} signals an @code{arith-error} | 707 | If @var{divisor} is zero, @code{mod} signals an @code{arith-error} |
| 706 | error if both arguments are integers, and returns a NaN otherwise. | 708 | error if both arguments are integers, and returns a NaN otherwise. |
| @@ -1086,8 +1088,8 @@ numbers as arguments. | |||
| 1086 | @defun sin arg | 1088 | @defun sin arg |
| 1087 | @defunx cos arg | 1089 | @defunx cos arg |
| 1088 | @defunx tan arg | 1090 | @defunx tan arg |
| 1089 | These are the ordinary trigonometric functions, with argument measured | 1091 | These are the basic trigonometric functions, with argument @var{arg} |
| 1090 | in radians. | 1092 | measured in radians. |
| 1091 | @end defun | 1093 | @end defun |
| 1092 | 1094 | ||
| 1093 | @defun asin arg | 1095 | @defun asin arg |
| @@ -1154,20 +1156,6 @@ This function returns the logarithm of @var{arg}, with base | |||
| 1154 | returns a NaN. | 1156 | returns a NaN. |
| 1155 | @end defun | 1157 | @end defun |
| 1156 | 1158 | ||
| 1157 | @ignore | ||
| 1158 | @defun expm1 arg | ||
| 1159 | This function returns @code{(1- (exp @var{arg}))}, but it is more | ||
| 1160 | accurate than that when @var{arg} is negative and @code{(exp @var{arg})} | ||
| 1161 | is close to 1. | ||
| 1162 | @end defun | ||
| 1163 | |||
| 1164 | @defun log1p arg | ||
| 1165 | This function returns @code{(log (1+ @var{arg}))}, but it is more | ||
| 1166 | accurate than that when @var{arg} is so small that adding 1 to it would | ||
| 1167 | lose accuracy. | ||
| 1168 | @end defun | ||
| 1169 | @end ignore | ||
| 1170 | |||
| 1171 | @defun log10 arg | 1159 | @defun log10 arg |
| 1172 | This function returns the logarithm of @var{arg}, with base 10: | 1160 | This function returns the logarithm of @var{arg}, with base 10: |
| 1173 | @code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}. | 1161 | @code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}. |
| @@ -1201,20 +1189,20 @@ The mathematical constant @math{pi} (3.14159@dots{}). | |||
| 1201 | @section Random Numbers | 1189 | @section Random Numbers |
| 1202 | @cindex random numbers | 1190 | @cindex random numbers |
| 1203 | 1191 | ||
| 1204 | A deterministic computer program cannot generate true random numbers. | 1192 | A deterministic computer program cannot generate true random |
| 1205 | For most purposes, @dfn{pseudo-random numbers} suffice. A series of | 1193 | numbers. For most purposes, @dfn{pseudo-random numbers} suffice. A |
| 1206 | pseudo-random numbers is generated in a deterministic fashion. The | 1194 | series of pseudo-random numbers is generated in a deterministic |
| 1207 | numbers are not truly random, but they have certain properties that | 1195 | fashion. The numbers are not truly random, but they have certain |
| 1208 | mimic a random series. For example, all possible values occur equally | 1196 | properties that mimic a random series. For example, all possible |
| 1209 | often in a pseudo-random series. | 1197 | values occur equally often in a pseudo-random series. |
| 1210 | 1198 | ||
| 1211 | In Emacs, pseudo-random numbers are generated from a ``seed''. | 1199 | Pseudo-random numbers are generated from a ``seed''. Starting from |
| 1212 | Starting from any given seed, the @code{random} function always | 1200 | any given seed, the @code{random} function always generates the same |
| 1213 | generates the same sequence of numbers. Emacs typically starts with a | 1201 | sequence of numbers. By default, Emacs initializes the random seed at |
| 1214 | different seed each time, so the sequence of values of @code{random} | 1202 | startup, in such a way that the sequence of values of @code{random} |
| 1215 | typically differs in each Emacs run. | 1203 | (with overwhelming likelihood) differs in each Emacs run. |
| 1216 | 1204 | ||
| 1217 | Sometimes you want the random number sequence to be repeatable. For | 1205 | Sometimes you want the random number sequence to be repeatable. For |
| 1218 | example, when debugging a program whose behavior depends on the random | 1206 | example, when debugging a program whose behavior depends on the random |
| 1219 | number sequence, it is helpful to get the same behavior in each | 1207 | number sequence, it is helpful to get the same behavior in each |
| 1220 | program run. To make the sequence repeat, execute @code{(random "")}. | 1208 | program run. To make the sequence repeat, execute @code{(random "")}. |
| @@ -1227,8 +1215,10 @@ This function returns a pseudo-random integer. Repeated calls return a | |||
| 1227 | series of pseudo-random integers. | 1215 | series of pseudo-random integers. |
| 1228 | 1216 | ||
| 1229 | If @var{limit} is a positive integer, the value is chosen to be | 1217 | If @var{limit} is a positive integer, the value is chosen to be |
| 1230 | nonnegative and less than @var{limit}. Otherwise, the value | 1218 | nonnegative and less than @var{limit}. Otherwise, the value might be |
| 1231 | might be any integer representable in Lisp. | 1219 | any integer representable in Lisp, i.e.@: an integer between |
| 1220 | @code{most-negative-fixnum} and @code{most-positive-fixnum} | ||
| 1221 | (@pxref{Integer Basics}). | ||
| 1232 | 1222 | ||
| 1233 | If @var{limit} is @code{t}, it means to choose a new seed based on the | 1223 | If @var{limit} is @code{t}, it means to choose a new seed based on the |
| 1234 | current time of day and on Emacs's process @acronym{ID} number. | 1224 | current time of day and on Emacs's process @acronym{ID} number. |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 68e53c78972..54754f8e5e9 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -70,13 +70,11 @@ in their turn. The files @file{subdirs.el} are normally generated | |||
| 70 | automatically when Emacs is installed. | 70 | automatically when Emacs is installed. |
| 71 | 71 | ||
| 72 | @item | 72 | @item |
| 73 | It registers input methods by loading any @file{leim-list.el} file | 73 | If the library @file{leim-list.el} exists, Emacs loads it. This |
| 74 | found in the @code{load-path}. | 74 | optional library is intended for registering input methods; Emacs |
| 75 | 75 | looks for it in @code{load-path} (@pxref{Library Search}), skipping | |
| 76 | @c It removes PWD from the environment if it is not accurate. | 76 | those directories containing the standard Emacs libraries (since |
| 77 | @c It abbreviates default-directory. | 77 | @file{leim-list.el} should not exist in those directories). |
| 78 | |||
| 79 | @c Now normal-top-level calls command-line. | ||
| 80 | 78 | ||
| 81 | @vindex before-init-time | 79 | @vindex before-init-time |
| 82 | @item | 80 | @item |
| @@ -1159,6 +1157,20 @@ This function returns the effective @acronym{UID} of the user. | |||
| 1159 | The value may be a floating point number. | 1157 | The value may be a floating point number. |
| 1160 | @end defun | 1158 | @end defun |
| 1161 | 1159 | ||
| 1160 | @defun system-users | ||
| 1161 | This function returns a list of strings, listing the user names on the | ||
| 1162 | system. If Emacs cannot retrieve this information, the return value | ||
| 1163 | is a list containing just the value of @code{user-real-login-name}. | ||
| 1164 | @end defun | ||
| 1165 | |||
| 1166 | @cindex user groups | ||
| 1167 | @defun system-groups | ||
| 1168 | This function returns a list of strings, listing the names of user | ||
| 1169 | groups on the system. If Emacs cannot retrieve this information, the | ||
| 1170 | return value is @code{nil}. | ||
| 1171 | @end defun | ||
| 1172 | |||
| 1173 | |||
| 1162 | @node Time of Day | 1174 | @node Time of Day |
| 1163 | @section Time of Day | 1175 | @section Time of Day |
| 1164 | 1176 | ||
| @@ -1812,6 +1824,29 @@ minutes, and even if there have been garbage collections and autosaves. | |||
| 1812 | input. Then it becomes idle again, and all the idle timers that are | 1824 | input. Then it becomes idle again, and all the idle timers that are |
| 1813 | set up to repeat will subsequently run another time, one by one. | 1825 | set up to repeat will subsequently run another time, one by one. |
| 1814 | 1826 | ||
| 1827 | Do not write an idle timer function containing a loop which does a | ||
| 1828 | certain amount of processing each time around, and exits when | ||
| 1829 | @code{(input-pending-p)} is non-@code{nil}. This approach seems very | ||
| 1830 | natural but has two problems: | ||
| 1831 | |||
| 1832 | @itemize | ||
| 1833 | @item | ||
| 1834 | It blocks out all process output (since Emacs accepts process output | ||
| 1835 | only while waiting). | ||
| 1836 | |||
| 1837 | @item | ||
| 1838 | It blocks out any idle timers that ought to run during that time. | ||
| 1839 | @end itemize | ||
| 1840 | |||
| 1841 | @noindent | ||
| 1842 | Similarly, do not write an idle timer function that sets up another | ||
| 1843 | idle timer (including the same idle timer) with @var{secs} argument | ||
| 1844 | less than or equal to the current idleness time. Such a timer will | ||
| 1845 | run almost immediately, and continue running again and again, instead | ||
| 1846 | of waiting for the next time Emacs becomes idle. The correct approach | ||
| 1847 | is to reschedule with an appropriate increment of the current value of | ||
| 1848 | the idleness time, as described below. | ||
| 1849 | |||
| 1815 | @defun current-idle-time | 1850 | @defun current-idle-time |
| 1816 | If Emacs is idle, this function returns the length of time Emacs has | 1851 | If Emacs is idle, this function returns the length of time Emacs has |
| 1817 | been idle, as a list of four integers: @code{(@var{sec-high} | 1852 | been idle, as a list of four integers: @code{(@var{sec-high} |
| @@ -1820,60 +1855,34 @@ been idle, as a list of four integers: @code{(@var{sec-high} | |||
| 1820 | 1855 | ||
| 1821 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | 1856 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. |
| 1822 | This is a convenient way to test whether Emacs is idle. | 1857 | This is a convenient way to test whether Emacs is idle. |
| 1858 | @end defun | ||
| 1823 | 1859 | ||
| 1824 | The main use of this function is when an idle timer function wants to | 1860 | The main use of @code{current-idle-time} is when an idle timer |
| 1825 | ``take a break'' for a while. It can set up another idle timer to | 1861 | function wants to ``take a break'' for a while. It can set up another |
| 1826 | call the same function again, after a few seconds more idleness. | 1862 | idle timer to call the same function again, after a few seconds more |
| 1827 | Here's an example: | 1863 | idleness. Here's an example: |
| 1828 | 1864 | ||
| 1829 | @smallexample | 1865 | @example |
| 1830 | (defvar resume-timer nil | 1866 | (defvar my-resume-timer nil |
| 1831 | "Timer that `timer-function' used to reschedule itself, or nil.") | 1867 | "Timer for `my-timer-function' to reschedule itself, or nil.") |
| 1832 | 1868 | ||
| 1833 | (defun timer-function () | 1869 | (defun my-timer-function () |
| 1834 | ;; @r{If the user types a command while @code{resume-timer}} | 1870 | ;; @r{If the user types a command while @code{my-resume-timer}} |
| 1835 | ;; @r{is active, the next time this function is called from} | 1871 | ;; @r{is active, the next time this function is called from} |
| 1836 | ;; @r{its main idle timer, deactivate @code{resume-timer}.} | 1872 | ;; @r{its main idle timer, deactivate @code{my-resume-timer}.} |
| 1837 | (when resume-timer | 1873 | (when my-resume-timer |
| 1838 | (cancel-timer resume-timer)) | 1874 | (cancel-timer my-resume-timer)) |
| 1839 | ...@var{do the work for a while}... | 1875 | ...@var{do the work for a while}... |
| 1840 | (when @var{taking-a-break} | 1876 | (when @var{taking-a-break} |
| 1841 | (setq resume-timer | 1877 | (setq my-resume-timer |
| 1842 | (run-with-idle-timer | 1878 | (run-with-idle-timer |
| 1843 | ;; Compute an idle time @var{break-length} | 1879 | ;; Compute an idle time @var{break-length} |
| 1844 | ;; more than the current value. | 1880 | ;; more than the current value. |
| 1845 | (time-add (current-idle-time) | 1881 | (time-add (current-idle-time) |
| 1846 | (seconds-to-time @var{break-length})) | 1882 | (seconds-to-time @var{break-length})) |
| 1847 | nil | 1883 | nil |
| 1848 | 'timer-function)))) | 1884 | 'my-timer-function)))) |
| 1849 | @end smallexample | 1885 | @end example |
| 1850 | @end defun | ||
| 1851 | |||
| 1852 | Do not write an idle timer function containing a loop which does a | ||
| 1853 | certain amount of processing each time around, and exits when | ||
| 1854 | @code{(input-pending-p)} is non-@code{nil}. This approach seems very | ||
| 1855 | natural but has two problems: | ||
| 1856 | |||
| 1857 | @itemize | ||
| 1858 | @item | ||
| 1859 | It blocks out all process output (since Emacs accepts process output | ||
| 1860 | only while waiting). | ||
| 1861 | |||
| 1862 | @item | ||
| 1863 | It blocks out any idle timers that ought to run during that time. | ||
| 1864 | @end itemize | ||
| 1865 | |||
| 1866 | @noindent | ||
| 1867 | For similar reasons, do not write an idle timer function that sets | ||
| 1868 | up another idle time (including the same idle timer) with the | ||
| 1869 | @var{secs} argument less or equal to the current idleness time. Such | ||
| 1870 | a timer will run almost immediately, and continue running again and | ||
| 1871 | again, instead of waiting for the next time Emacs becomes idle. | ||
| 1872 | |||
| 1873 | @noindent | ||
| 1874 | The correct approach is for the idle timer to reschedule itself after | ||
| 1875 | a brief pause, using the method in the @code{timer-function} example | ||
| 1876 | above. | ||
| 1877 | 1886 | ||
| 1878 | @node Terminal Input | 1887 | @node Terminal Input |
| 1879 | @section Terminal Input | 1888 | @section Terminal Input |
| @@ -1907,7 +1916,6 @@ If @var{flow} is non-@code{nil}, then Emacs uses @sc{xon/xoff} | |||
| 1907 | (@kbd{C-q}, @kbd{C-s}) flow control for output to the terminal. This | 1916 | (@kbd{C-q}, @kbd{C-s}) flow control for output to the terminal. This |
| 1908 | has no effect except in @sc{cbreak} mode. | 1917 | has no effect except in @sc{cbreak} mode. |
| 1909 | 1918 | ||
| 1910 | @c Emacs 19 feature | ||
| 1911 | The argument @var{meta} controls support for input character codes | 1919 | The argument @var{meta} controls support for input character codes |
| 1912 | above 127. If @var{meta} is @code{t}, Emacs converts characters with | 1920 | above 127. If @var{meta} is @code{t}, Emacs converts characters with |
| 1913 | the 8th bit set into Meta characters. If @var{meta} is @code{nil}, | 1921 | the 8th bit set into Meta characters. If @var{meta} is @code{nil}, |
| @@ -1916,7 +1924,6 @@ it as a parity bit. If @var{meta} is neither @code{t} nor @code{nil}, | |||
| 1916 | Emacs uses all 8 bits of input unchanged. This is good for terminals | 1924 | Emacs uses all 8 bits of input unchanged. This is good for terminals |
| 1917 | that use 8-bit character sets. | 1925 | that use 8-bit character sets. |
| 1918 | 1926 | ||
| 1919 | @c Emacs 19 feature | ||
| 1920 | If @var{quit-char} is non-@code{nil}, it specifies the character to | 1927 | If @var{quit-char} is non-@code{nil}, it specifies the character to |
| 1921 | use for quitting. Normally this character is @kbd{C-g}. | 1928 | use for quitting. Normally this character is @kbd{C-g}. |
| 1922 | @xref{Quitting}. | 1929 | @xref{Quitting}. |
| @@ -1925,7 +1932,6 @@ use for quitting. Normally this character is @kbd{C-g}. | |||
| 1925 | The @code{current-input-mode} function returns the input mode settings | 1932 | The @code{current-input-mode} function returns the input mode settings |
| 1926 | Emacs is currently using. | 1933 | Emacs is currently using. |
| 1927 | 1934 | ||
| 1928 | @c Emacs 19 feature | ||
| 1929 | @defun current-input-mode | 1935 | @defun current-input-mode |
| 1930 | This function returns the current mode for reading keyboard input. It | 1936 | This function returns the current mode for reading keyboard input. It |
| 1931 | returns a list, corresponding to the arguments of @code{set-input-mode}, | 1937 | returns a list, corresponding to the arguments of @code{set-input-mode}, |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index b7097e057c0..865435c91b3 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -35,28 +35,31 @@ keyboard character events. | |||
| 35 | @node String Basics | 35 | @node String Basics |
| 36 | @section String and Character Basics | 36 | @section String and Character Basics |
| 37 | 37 | ||
| 38 | Characters are represented in Emacs Lisp as integers; | 38 | A character is a Lisp object which represents a single character of |
| 39 | whether an integer is a character or not is determined only by how it is | 39 | text. In Emacs Lisp, characters are simply integers; whether an |
| 40 | used. Thus, strings really contain integers. @xref{Character Codes}, | 40 | integer is a character or not is determined only by how it is used. |
| 41 | for details about character representation in Emacs. | 41 | @xref{Character Codes}, for details about character representation in |
| 42 | 42 | Emacs. | |
| 43 | The length of a string (like any array) is fixed, and cannot be | 43 | |
| 44 | altered once the string exists. Strings in Lisp are @emph{not} | 44 | A string is a fixed sequence of characters. It is a type of |
| 45 | terminated by a distinguished character code. (By contrast, strings in | 45 | sequence called a @dfn{array}, meaning that its length is fixed and |
| 46 | C are terminated by a character with @acronym{ASCII} code 0.) | 46 | cannot be altered once it is created (@pxref{Sequences Arrays |
| 47 | Vectors}). Unlike in C, Emacs Lisp strings are @emph{not} terminated | ||
| 48 | by a distinguished character code. | ||
| 47 | 49 | ||
| 48 | Since strings are arrays, and therefore sequences as well, you can | 50 | Since strings are arrays, and therefore sequences as well, you can |
| 49 | operate on them with the general array and sequence functions. | 51 | operate on them with the general array and sequence functions |
| 50 | (@xref{Sequences Arrays Vectors}.) For example, you can access or | 52 | documented in @ref{Sequences Arrays Vectors}. For example, you can |
| 51 | change individual characters in a string using the functions @code{aref} | 53 | access or change individual characters in a string using the functions |
| 52 | and @code{aset} (@pxref{Array Functions}). However, note that | 54 | @code{aref} and @code{aset} (@pxref{Array Functions}). However, note |
| 53 | @code{length} should @emph{not} be used for computing the width of a | 55 | that @code{length} should @emph{not} be used for computing the width |
| 54 | string on display; use @code{string-width} (@pxref{Width}) instead. | 56 | of a string on display; use @code{string-width} (@pxref{Width}) |
| 55 | 57 | instead. | |
| 56 | There are two text representations for non-@acronym{ASCII} characters in | 58 | |
| 57 | Emacs strings (and in buffers): unibyte and multibyte (@pxref{Text | 59 | There are two text representations for non-@acronym{ASCII} |
| 58 | Representations}). For most Lisp programming, you don't need to be | 60 | characters in Emacs strings (and in buffers): unibyte and multibyte. |
| 59 | concerned with these two representations. | 61 | For most Lisp programming, you don't need to be concerned with these |
| 62 | two representations. @xref{Text Representations}, for details. | ||
| 60 | 63 | ||
| 61 | Sometimes key sequences are represented as unibyte strings. When a | 64 | Sometimes key sequences are represented as unibyte strings. When a |
| 62 | unibyte string is a key sequence, string elements in the range 128 to | 65 | unibyte string is a key sequence, string elements in the range 128 to |
| @@ -88,7 +91,7 @@ for information about the syntax of characters and strings. | |||
| 88 | representations and to encode and decode character codes. | 91 | representations and to encode and decode character codes. |
| 89 | 92 | ||
| 90 | @node Predicates for Strings | 93 | @node Predicates for Strings |
| 91 | @section The Predicates for Strings | 94 | @section Predicates for Strings |
| 92 | 95 | ||
| 93 | For more information about general sequence and array predicates, | 96 | For more information about general sequence and array predicates, |
| 94 | see @ref{Sequences Arrays Vectors}, and @ref{Arrays}. | 97 | see @ref{Sequences Arrays Vectors}, and @ref{Arrays}. |
| @@ -76,6 +76,7 @@ You can explicitly require a specific version by passing | |||
| 76 | 76 | ||
| 77 | * Startup Changes in Emacs 24.3 | 77 | * Startup Changes in Emacs 24.3 |
| 78 | 78 | ||
| 79 | +++ | ||
| 79 | ** Emacs no longer searches for `leim-list.el' files beneath the standard | 80 | ** Emacs no longer searches for `leim-list.el' files beneath the standard |
| 80 | lisp/ directory. There should not be any there anyway. If you have | 81 | lisp/ directory. There should not be any there anyway. If you have |
| 81 | been adding them there, put them somewhere else, eg site-lisp. | 82 | been adding them there, put them somewhere else, eg site-lisp. |
| @@ -89,10 +90,12 @@ been adding them there, put them somewhere else, eg site-lisp. | |||
| 89 | ** minibuffer-electric-default-mode can rewrite (default ...) to [...]. | 90 | ** minibuffer-electric-default-mode can rewrite (default ...) to [...]. |
| 90 | Just set minibuffer-eldef-shorten-default to t before enabling the mode. | 91 | Just set minibuffer-eldef-shorten-default to t before enabling the mode. |
| 91 | 92 | ||
| 93 | +++ | ||
| 92 | ** Most y-or-n prompts now allow you to scroll the selected window. | 94 | ** Most y-or-n prompts now allow you to scroll the selected window. |
| 93 | Typing C-v or M-v at a y-or-n prompt scrolls forward or backward | 95 | Typing C-v or M-v at a y-or-n prompt scrolls forward or backward |
| 94 | respectively, without exiting from the prompt. | 96 | respectively, without exiting from the prompt. |
| 95 | 97 | ||
| 98 | --- | ||
| 96 | ** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the | 99 | ** In minibuffer filename prompts, `C-M-f' and `C-M-b' now move to the |
| 97 | next and previous path separator, respectively. | 100 | next and previous path separator, respectively. |
| 98 | 101 | ||
| @@ -107,12 +110,14 @@ invokes `set-buffer-file-coding-system'. | |||
| 107 | 110 | ||
| 108 | ** Help changes | 111 | ** Help changes |
| 109 | 112 | ||
| 113 | +++ | ||
| 110 | *** `C-h f' (describe-function) can now perform autoloading. | 114 | *** `C-h f' (describe-function) can now perform autoloading. |
| 111 | When this command is called for an autoloaded function whose docstring | 115 | When this command is called for an autoloaded function whose docstring |
| 112 | contains a key substitution construct, that function's library is | 116 | contains a key substitution construct, that function's library is |
| 113 | automatically loaded, so that the documentation can be shown | 117 | automatically loaded, so that the documentation can be shown |
| 114 | correctly. To disable this, set `help-enable-auto-load' to nil. | 118 | correctly. To disable this, set `help-enable-auto-load' to nil. |
| 115 | 119 | ||
| 120 | --- | ||
| 116 | *** `C-h f' now reports previously-autoloaded functions as "autoloaded", | 121 | *** `C-h f' now reports previously-autoloaded functions as "autoloaded", |
| 117 | even after their associated libraries have been loaded (and the | 122 | even after their associated libraries have been loaded (and the |
| 118 | autoloads have been redefined as functions). | 123 | autoloads have been redefined as functions). |
| @@ -136,11 +141,11 @@ treated as images. | |||
| 136 | :background image spec property. | 141 | :background image spec property. |
| 137 | 142 | ||
| 138 | ** Server and client changes | 143 | ** Server and client changes |
| 139 | 144 | +++ | |
| 140 | *** emacsclient now obeys string values for `initial-buffer-choice', | 145 | *** emacsclient now obeys string values for `initial-buffer-choice', |
| 141 | if it is told to open a new frame without specifying any file to visit | 146 | if it is told to open a new frame without specifying any file to visit |
| 142 | or expression to evaluate. | 147 | or expression to evaluate. |
| 143 | 148 | --- | |
| 144 | *** New option `server-auth-key' specifies a shared server key. | 149 | *** New option `server-auth-key' specifies a shared server key. |
| 145 | 150 | ||
| 146 | ** In the Package Menu, newly-available packages are listed as "new", | 151 | ** In the Package Menu, newly-available packages are listed as "new", |
| @@ -155,6 +160,7 @@ On encountering a fatal error, Emacs now outputs a textual description | |||
| 155 | of the fatal signal, and a short backtrace on platforms like glibc | 160 | of the fatal signal, and a short backtrace on platforms like glibc |
| 156 | that support backtraces. | 161 | that support backtraces. |
| 157 | 162 | ||
| 163 | --- | ||
| 158 | ** If your Emacs was built from a bzr checkout, the new variable | 164 | ** If your Emacs was built from a bzr checkout, the new variable |
| 159 | `emacs-bzr-version' contains information about the bzr revision used. | 165 | `emacs-bzr-version' contains information about the bzr revision used. |
| 160 | 166 | ||
| @@ -185,38 +191,25 @@ The PCL-CVS commands are still available via the keyboard. | |||
| 185 | * Editing Changes in Emacs 24.3 | 191 | * Editing Changes in Emacs 24.3 |
| 186 | 192 | ||
| 187 | ** Navigation command changes | 193 | ** Navigation command changes |
| 188 | 194 | +++ | |
| 189 | *** New binding `M-g c' for `goto-char'. | 195 | *** New binding `M-g c' for `goto-char'. |
| 190 | 196 | +++ | |
| 191 | *** New binding `M-g TAB' for `move-to-column'. | 197 | *** New binding `M-g TAB' for `move-to-column'. |
| 192 | 198 | +++ | |
| 193 | *** `M-g TAB' (`move-to-column') prompts for a column number if called | 199 | *** `M-g TAB' (`move-to-column') prompts for a column number if called |
| 194 | interactively with no prefix arg. Previously, it moved to column 1. | 200 | interactively with no prefix arg. Previously, it moved to column 1. |
| 195 | 201 | ||
| 196 | +++ | ||
| 197 | ** `C-x 8 RET' is now bound to `insert-char', which is now a command. | ||
| 198 | `ucs-insert' is now an obsolete alias for `insert-char'. | ||
| 199 | |||
| 200 | --- | ||
| 201 | ** The `z' key no longer has a binding in most special modes. | ||
| 202 | It used to be bound to `kill-this-buffer', but `z' is too easy to | ||
| 203 | accidentally type. | ||
| 204 | |||
| 205 | ** New option `delete-trailing-lines' specifies whether | ||
| 206 | M-x delete-trailing-whitespace should delete trailing lines at the end | ||
| 207 | of the buffer. It defaults to t. | ||
| 208 | |||
| 209 | ** Search and Replace changes | 202 | ** Search and Replace changes |
| 210 | 203 | +++ | |
| 211 | *** Non-regexp Isearch now performs "lax" space matching. | 204 | *** Non-regexp Isearch now performs "lax" space matching. |
| 212 | Each sequence of spaces in the supplied search string may match any | 205 | Each sequence of spaces in the supplied search string may match any |
| 213 | sequence of one or more whitespace characters, as specified by the | 206 | sequence of one or more whitespace characters, as specified by the |
| 214 | variable `search-whitespace-regexp'. (This variable is also used by a | 207 | variable `search-whitespace-regexp'. (This variable is also used by a |
| 215 | similar existing feature for regexp Isearch). | 208 | similar existing feature for regexp Isearch). |
| 216 | 209 | +++ | |
| 217 | *** New Isearch command `M-s SPC' toggles lax space matching. | 210 | *** New Isearch command `M-s SPC' toggles lax space matching. |
| 218 | This applies to both ordinary and regexp Isearch. | 211 | This applies to both ordinary and regexp Isearch. |
| 219 | 212 | +++ | |
| 220 | *** New option `replace-lax-whitespace'. | 213 | *** New option `replace-lax-whitespace'. |
| 221 | If non-nil, `query-replace' uses flexible whitespace matching too. | 214 | If non-nil, `query-replace' uses flexible whitespace matching too. |
| 222 | The default is nil. | 215 | The default is nil. |
| @@ -225,6 +218,20 @@ The default is nil. | |||
| 225 | and `M-s _' in Isearch toggles symbol search mode. | 218 | and `M-s _' in Isearch toggles symbol search mode. |
| 226 | `M-s c' in Isearch toggles search case-sensitivity. | 219 | `M-s c' in Isearch toggles search case-sensitivity. |
| 227 | 220 | ||
| 221 | +++ | ||
| 222 | ** `C-x 8 RET' is now bound to `insert-char', which is now a command. | ||
| 223 | `ucs-insert' is now an obsolete alias for `insert-char'. | ||
| 224 | |||
| 225 | --- | ||
| 226 | ** The `z' key no longer has a binding in most special modes. | ||
| 227 | It used to be bound to `kill-this-buffer', but `z' is too easy to | ||
| 228 | accidentally type. | ||
| 229 | |||
| 230 | +++ | ||
| 231 | ** New option `delete-trailing-lines' specifies whether | ||
| 232 | M-x delete-trailing-whitespace should delete trailing lines at the end | ||
| 233 | of the buffer. It defaults to t. | ||
| 234 | |||
| 228 | ** Register changes | 235 | ** Register changes |
| 229 | +++ | 236 | +++ |
| 230 | *** `C-x r +' is now overloaded to invoke `append-to-register. | 237 | *** `C-x r +' is now overloaded to invoke `append-to-register. |
| @@ -233,8 +240,10 @@ and `M-s _' in Isearch toggles symbol search mode. | |||
| 233 | the text to put between collected texts for use with M-x | 240 | the text to put between collected texts for use with M-x |
| 234 | append-to-register and M-x prepend-to-register. | 241 | append-to-register and M-x prepend-to-register. |
| 235 | 242 | ||
| 243 | +++ | ||
| 236 | ** `C-u M-=' now counts lines/words/characters in the entire buffer. | 244 | ** `C-u M-=' now counts lines/words/characters in the entire buffer. |
| 237 | 245 | ||
| 246 | +++ | ||
| 238 | ** New command `C-x r M-w' (copy-rectangle-as-kill). | 247 | ** New command `C-x r M-w' (copy-rectangle-as-kill). |
| 239 | It copies the region-rectangle as the last rectangle kill. | 248 | It copies the region-rectangle as the last rectangle kill. |
| 240 | 249 | ||
| @@ -246,17 +255,17 @@ just removing them, as done by `yank-excluded-properties'. | |||
| 246 | * Changes in Specialized Modes and Packages in Emacs 24.3 | 255 | * Changes in Specialized Modes and Packages in Emacs 24.3 |
| 247 | 256 | ||
| 248 | ** Apropos | 257 | ** Apropos |
| 249 | 258 | --- | |
| 250 | *** The faces used by Apropos are now directly customizable. | 259 | *** The faces used by Apropos are now directly customizable. |
| 251 | These faces are named `apropos-symbol', `apropos-keybinding', and so on; | 260 | These faces are named `apropos-symbol', `apropos-keybinding', and so on; |
| 252 | see the `apropos' Custom group for details. | 261 | see the `apropos' Custom group for details. |
| 253 | 262 | --- | |
| 254 | **** The old options whose values specified faces to use were removed | 263 | *** The old options whose values specified faces to use were removed |
| 255 | (i.e. `apropos-symbol-face', `apropos-keybinding-face', etc.). | 264 | (i.e. `apropos-symbol-face', `apropos-keybinding-face', etc.). |
| 256 | 265 | ||
| 257 | ** Buffer Menu | 266 | ** Buffer Menu |
| 258 | This package has been rewritten to use Tabulated List mode. | 267 | This package has been rewritten to use Tabulated List mode. |
| 259 | 268 | --- | |
| 260 | *** Option `Buffer-menu-buffer+size-width' is now obsolete. | 269 | *** Option `Buffer-menu-buffer+size-width' is now obsolete. |
| 261 | Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead. | 270 | Use `Buffer-menu-name-width' and `Buffer-menu-size-width' instead. |
| 262 | 271 | ||
| @@ -580,22 +589,22 @@ enabled. | |||
| 580 | 589 | ||
| 581 | 590 | ||
| 582 | ** Obsolete packages: | 591 | ** Obsolete packages: |
| 583 | 592 | +++ | |
| 584 | *** assoc.el | 593 | *** assoc.el |
| 585 | In most cases, assoc+member+push+delq work just as well. | 594 | In most cases, assoc+member+push+delq work just as well. |
| 586 | And in any case it's just a terrible package: ugly semantics, terrible | 595 | And in any case it's just a terrible package: ugly semantics, terrible |
| 587 | inefficiency, and not namespace-clean. | 596 | inefficiency, and not namespace-clean. |
| 588 | 597 | --- | |
| 589 | *** bruce.el | 598 | *** bruce.el |
| 590 | 599 | --- | |
| 591 | *** ledit.el | 600 | *** ledit.el |
| 592 | 601 | --- | |
| 593 | *** mailpost.el | 602 | *** mailpost.el |
| 594 | 603 | +++ | |
| 595 | *** mouse-sel.el | 604 | *** mouse-sel.el |
| 596 | 605 | --- | |
| 597 | *** patcomp.el | 606 | *** patcomp.el |
| 598 | 607 | +++ | |
| 599 | *** cust-print.el | 608 | *** cust-print.el |
| 600 | 609 | ||
| 601 | 610 | ||
| @@ -603,11 +612,13 @@ inefficiency, and not namespace-clean. | |||
| 603 | 612 | ||
| 604 | * Incompatible Lisp Changes in Emacs 24.3 | 613 | * Incompatible Lisp Changes in Emacs 24.3 |
| 605 | 614 | ||
| 615 | +++ | ||
| 606 | ** (random) by default now returns a different random sequence in | 616 | ** (random) by default now returns a different random sequence in |
| 607 | every Emacs run. Use (random S), where S is a string, to set the | 617 | every Emacs run. Use (random S), where S is a string, to set the |
| 608 | random seed to a value based on S, in order to get a repeatable | 618 | random seed to a value based on S, in order to get a repeatable |
| 609 | sequence in later calls. | 619 | sequence in later calls. |
| 610 | 620 | ||
| 621 | --- | ||
| 611 | ** The function `x-select-font' can return a font spec, instead of a | 622 | ** The function `x-select-font' can return a font spec, instead of a |
| 612 | font name as a string. Whether it returns a font spec or a font name | 623 | font name as a string. Whether it returns a font spec or a font name |
| 613 | depends on the graphical library. | 624 | depends on the graphical library. |
| @@ -628,6 +639,7 @@ and are now undefined. For backwards compatibility, defun and | |||
| 628 | defmacro currently return the name of the newly defined function/macro | 639 | defmacro currently return the name of the newly defined function/macro |
| 629 | but this should not be relied upon. | 640 | but this should not be relied upon. |
| 630 | 641 | ||
| 642 | --- | ||
| 631 | ** `face-spec-set' no longer sets frame-specific attributes when the | 643 | ** `face-spec-set' no longer sets frame-specific attributes when the |
| 632 | third argument is a frame (that usage was obsolete since Emacs 22.2). | 644 | third argument is a frame (that usage was obsolete since Emacs 22.2). |
| 633 | 645 | ||
| @@ -772,23 +784,24 @@ in Emacs 24.1: | |||
| 772 | **** `display-buffer-function' | 784 | **** `display-buffer-function' |
| 773 | 785 | ||
| 774 | ** Time | 786 | ** Time |
| 775 | 787 | --- | |
| 776 | *** `current-time-string' no longer requires that its argument's year | 788 | *** `current-time-string' no longer requires that its argument's year |
| 777 | must be in the range 1000..9999. It now works with any year supported | 789 | must be in the range 1000..9999. It now works with any year supported |
| 778 | by the underlying C implementation. | 790 | by the underlying C implementation. |
| 779 | 791 | --- | |
| 780 | *** `current-time' now returns extended-format time stamps | 792 | *** `current-time' now returns extended-format time stamps |
| 781 | (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds. | 793 | (HIGH LOW USEC PSEC), where the new PSEC slot specifies picoseconds. |
| 782 | PSEC is typically a multiple of 1000 on current machines. Other | 794 | PSEC is typically a multiple of 1000 on current machines. Other |
| 783 | functions that use this format, such as file-attributes and | 795 | functions that use this format, such as file-attributes and |
| 784 | format-time-string, have been changed accordingly. Old-format time | 796 | format-time-string, have been changed accordingly. Old-format time |
| 785 | stamps are still accepted. | 797 | stamps are still accepted. |
| 786 | 798 | --- | |
| 787 | *** The format of timers in timer-list and timer-idle-list is now | 799 | *** The format of timers in timer-list and timer-idle-list is now |
| 788 | [TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY PSECS]. | 800 | [TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY PSECS]. |
| 789 | The PSECS slot is new, and uses picosecond resolution. It can be | 801 | The PSECS slot is new, and uses picosecond resolution. It can be |
| 790 | accessed via the new timer--psecs accessor. | 802 | accessed via the new timer--psecs accessor. |
| 791 | 803 | ||
| 804 | +++ | ||
| 792 | ** Floating point functions now always return special values like NaN, | 805 | ** Floating point functions now always return special values like NaN, |
| 793 | instead of signaling errors, if given invalid args, e.g. (log -1.0). | 806 | instead of signaling errors, if given invalid args, e.g. (log -1.0). |
| 794 | Previously, they returned NaNs on some platforms but signaled errors | 807 | Previously, they returned NaNs on some platforms but signaled errors |
| @@ -806,18 +819,22 @@ result in a warning describing the cycle. | |||
| 806 | 819 | ||
| 807 | *** `autoloadp' | 820 | *** `autoloadp' |
| 808 | *** `autoload-do-load'. | 821 | *** `autoload-do-load'. |
| 822 | +++ | ||
| 809 | *** `buffer-narrowed-p' tests if the buffer is narrowed. | 823 | *** `buffer-narrowed-p' tests if the buffer is narrowed. |
| 810 | *** `file-name-base' returns a file name sans directory and extension. | 824 | *** `file-name-base' returns a file name sans directory and extension. |
| 811 | *** `function-get' fetches a function property, following aliases. | 825 | *** `function-get' fetches a function property, following aliases. |
| 826 | +++ | ||
| 812 | *** `posnp' tests if an object is a `posn'. | 827 | *** `posnp' tests if an object is a `posn'. |
| 813 | *** `set-temporary-overlay-map' sets up a temporary overlay map. | 828 | *** `set-temporary-overlay-map' sets up a temporary overlay map. |
| 829 | +++ | ||
| 814 | *** `system-users' returns the user names on the system. | 830 | *** `system-users' returns the user names on the system. |
| 831 | +++ | ||
| 815 | *** `system-groups' returns the group names on the system. | 832 | *** `system-groups' returns the group names on the system. |
| 816 | *** `tty-top-frame' returns the topmost frame of a text terminal. | 833 | *** `tty-top-frame' returns the topmost frame of a text terminal. |
| 817 | 834 | ||
| 818 | ** New macros `setq-local' and `defvar-local'. | 835 | ** New macros `setq-local' and `defvar-local'. |
| 819 | 836 | ||
| 820 | ** New fringe bitmap exclamation-mark. | 837 | ** New fringe bitmap `exclamation-mark'. |
| 821 | 838 | ||
| 822 | ** Face underlining can now use a wave. | 839 | ** Face underlining can now use a wave. |
| 823 | See the "Face Attributes" section of the Elisp manual. | 840 | See the "Face Attributes" section of the Elisp manual. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e1b93ae3ba..d7b8163ae9e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -34,6 +34,13 @@ | |||
| 34 | 34 | ||
| 35 | 2012-09-30 Chong Yidong <cyd@gnu.org> | 35 | 2012-09-30 Chong Yidong <cyd@gnu.org> |
| 36 | 36 | ||
| 37 | * server.el (server-host): Document the security implications. | ||
| 38 | (server-auth-key): Doc fix. | ||
| 39 | |||
| 40 | * startup.el (initial-buffer-choice): Doc fix. | ||
| 41 | |||
| 42 | * minibuffer.el (minibuffer-local-filename-syntax): Doc fix. | ||
| 43 | |||
| 37 | * simple.el (delete-trailing-whitespace): Avoid an unnecessary | 44 | * simple.el (delete-trailing-whitespace): Avoid an unnecessary |
| 38 | restriction change. | 45 | restriction change. |
| 39 | 46 | ||
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 27c53744d54..cf990019abc 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -2332,7 +2332,7 @@ and `read-file-name-function'." | |||
| 2332 | (modify-syntax-entry c "." table)) | 2332 | (modify-syntax-entry c "." table)) |
| 2333 | '(?/ ?: ?\\)) | 2333 | '(?/ ?: ?\\)) |
| 2334 | table) | 2334 | table) |
| 2335 | "Syntax table to be used in minibuffer for reading file name.") | 2335 | "Syntax table used when reading a file name in the minibuffer.") |
| 2336 | 2336 | ||
| 2337 | ;; minibuffer-completing-file-name is a variable used internally in minibuf.c | 2337 | ;; minibuffer-completing-file-name is a variable used internally in minibuf.c |
| 2338 | ;; to determine whether to use minibuffer-local-filename-completion-map or | 2338 | ;; to determine whether to use minibuffer-local-filename-completion-map or |
diff --git a/lisp/server.el b/lisp/server.el index 4fd55bcf6d1..73c253a87a6 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -101,7 +101,12 @@ | |||
| 101 | 101 | ||
| 102 | (defcustom server-host nil | 102 | (defcustom server-host nil |
| 103 | "The name or IP address to use as host address of the server process. | 103 | "The name or IP address to use as host address of the server process. |
| 104 | If set, the server accepts remote connections; otherwise it is local." | 104 | If set, the server accepts remote connections; otherwise it is local. |
| 105 | |||
| 106 | DO NOT give this a non-nil value unless you know what you are | ||
| 107 | doing! On unsecured networks, accepting remote connections is | ||
| 108 | very dangerous, because server-client communication (including | ||
| 109 | session authentication) is not encrypted." | ||
| 105 | :group 'server | 110 | :group 'server |
| 106 | :type '(choice | 111 | :type '(choice |
| 107 | (string :tag "Name or IP address") | 112 | (string :tag "Name or IP address") |
| @@ -140,12 +145,12 @@ directory residing in a NTFS partition instead." | |||
| 140 | 145 | ||
| 141 | (defcustom server-auth-key nil | 146 | (defcustom server-auth-key nil |
| 142 | "Server authentication key. | 147 | "Server authentication key. |
| 148 | This is only used if `server-use-tcp' is non-nil. | ||
| 143 | 149 | ||
| 144 | Normally, the authentication key is randomly generated when the | 150 | Normally, the authentication key is randomly generated when the |
| 145 | server starts, which guarantees some level of security. It is | 151 | server starts. It is recommended to leave it that way. Using a |
| 146 | recommended to leave it that way. Using a long-lived shared key | 152 | long-lived shared key will decrease security (especially since |
| 147 | will decrease security (especially since the key is transmitted as | 153 | the key is transmitted as plain-text). |
| 148 | plain text). | ||
| 149 | 154 | ||
| 150 | In some situations however, it can be difficult to share randomly | 155 | In some situations however, it can be difficult to share randomly |
| 151 | generated passwords with remote hosts (eg. no shared directory), | 156 | generated passwords with remote hosts (eg. no shared directory), |
| @@ -153,11 +158,13 @@ so you can set the key with this variable and then copy the | |||
| 153 | server file to the remote host (with possible changes to IP | 158 | server file to the remote host (with possible changes to IP |
| 154 | address and/or port if that applies). | 159 | address and/or port if that applies). |
| 155 | 160 | ||
| 156 | The key must consist of 64 ASCII printable characters except for | 161 | Note that the usual security risks of using the server over |
| 157 | space (this means characters from ! to ~; or from code 33 to 126). | 162 | remote TCP, arising from the fact that client-server |
| 163 | communications are unencrypted, still apply. | ||
| 158 | 164 | ||
| 159 | You can use \\[server-generate-key] to get a random authentication | 165 | The key must consist of 64 ASCII printable characters except for |
| 160 | key." | 166 | space (this means characters from ! to ~; or from code 33 to |
| 167 | 126). You can use \\[server-generate-key] to get a random key." | ||
| 161 | :group 'server | 168 | :group 'server |
| 162 | :type '(choice | 169 | :type '(choice |
| 163 | (const :tag "Random" nil) | 170 | (const :tag "Random" nil) |
diff --git a/lisp/startup.el b/lisp/startup.el index 243c9621752..6658e16683b 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -43,7 +43,10 @@ | |||
| 43 | If the value is nil and `inhibit-startup-screen' is nil, show the | 43 | If the value is nil and `inhibit-startup-screen' is nil, show the |
| 44 | startup screen. If the value is a string, visit the specified file | 44 | startup screen. If the value is a string, visit the specified file |
| 45 | or directory using `find-file'. If t, open the `*scratch*' | 45 | or directory using `find-file'. If t, open the `*scratch*' |
| 46 | buffer." | 46 | buffer. |
| 47 | |||
| 48 | A string value also causes emacsclient to open the specified file | ||
| 49 | or directory when no target file is specified." | ||
| 47 | :type '(choice | 50 | :type '(choice |
| 48 | (const :tag "Startup screen" nil) | 51 | (const :tag "Startup screen" nil) |
| 49 | (directory :tag "Directory" :value "~/") | 52 | (directory :tag "Directory" :value "~/") |
diff --git a/src/ChangeLog b/src/ChangeLog index 12992f1de0a..122dbd903fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-09-30 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * fns.c (Frandom): Doc fix. | ||
| 4 | |||
| 1 | 2012-09-30 Martin Rudalics <rudalics@gmx.at> | 5 | 2012-09-30 Martin Rudalics <rudalics@gmx.at> |
| 2 | 6 | ||
| 3 | * window.c (Vwindow_combination_limit): New default value. | 7 | * window.c (Vwindow_combination_limit): New default value. |
| @@ -61,8 +61,9 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, | |||
| 61 | 61 | ||
| 62 | DEFUN ("random", Frandom, Srandom, 0, 1, 0, | 62 | DEFUN ("random", Frandom, Srandom, 0, 1, 0, |
| 63 | doc: /* Return a pseudo-random number. | 63 | doc: /* Return a pseudo-random number. |
| 64 | All integers representable in Lisp are equally likely. | 64 | All integers representable in Lisp, i.e. between `most-negative-fixnum' |
| 65 | On most systems, this is 29 bits' worth. | 65 | and `most-positive-fixnum', inclusive, are equally likely. |
| 66 | |||
| 66 | With positive integer LIMIT, return random number in interval [0,LIMIT). | 67 | With positive integer LIMIT, return random number in interval [0,LIMIT). |
| 67 | With argument t, set the random number seed from the current time and pid. | 68 | With argument t, set the random number seed from the current time and pid. |
| 68 | Other values of LIMIT are ignored. */) | 69 | Other values of LIMIT are ignored. */) |