diff options
| author | K. Handa | 2016-01-03 17:53:43 +0900 |
|---|---|---|
| committer | K. Handa | 2016-01-03 17:53:43 +0900 |
| commit | fb6d826c69939c2d016c1b824d4e9bcb53d9e643 (patch) | |
| tree | b9ce862d6cbe25e740203421984df21e4cbadbf4 /doc/lispref | |
| parent | 536f48e9a2251b9e654ea974bd90ff2f40218753 (diff) | |
| parent | 91917dd58ec5278e555b9c693a830749083e8f89 (diff) | |
| download | emacs-fb6d826c69939c2d016c1b824d4e9bcb53d9e643.tar.gz emacs-fb6d826c69939c2d016c1b824d4e9bcb53d9e643.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/buffers.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 40 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 20 | ||||
| -rw-r--r-- | doc/lispref/eval.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 32 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 40 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 17 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/loading.texi | 61 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 63 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 17 | ||||
| -rw-r--r-- | doc/lispref/positions.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/processes.texi | 48 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/syntax.texi | 8 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 166 | ||||
| -rw-r--r-- | doc/lispref/tips.texi | 16 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 128 |
19 files changed, 606 insertions, 104 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 45a21c8e806..55fa5bcd6f0 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -716,7 +716,9 @@ The special commands of these modes bind @code{buffer-read-only} to | |||
| 716 | 716 | ||
| 717 | @defvar buffer-read-only | 717 | @defvar buffer-read-only |
| 718 | This buffer-local variable specifies whether the buffer is read-only. | 718 | This buffer-local variable specifies whether the buffer is read-only. |
| 719 | The buffer is read-only if this variable is non-@code{nil}. | 719 | The buffer is read-only if this variable is non-@code{nil}. However, |
| 720 | characters that have the @code{inhibit-read-only} text property can | ||
| 721 | still be modified. @xref{Special Properties, inhibit-read-only}. | ||
| 720 | @end defvar | 722 | @end defvar |
| 721 | 723 | ||
| 722 | @defvar inhibit-read-only | 724 | @defvar inhibit-read-only |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index ad248b116ed..d1ac85a7cab 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -330,7 +330,7 @@ support them, then @code{message-box} uses the echo area, like | |||
| 330 | @code{message}. | 330 | @code{message}. |
| 331 | @end defun | 331 | @end defun |
| 332 | 332 | ||
| 333 | @defun display-message-or-buffer message &optional buffer-name not-this-window frame | 333 | @defun display-message-or-buffer message &optional buffer-name action frame |
| 334 | This function displays the message @var{message}, which may be either a | 334 | This function displays the message @var{message}, which may be either a |
| 335 | string or a buffer. If it is shorter than the maximum height of the | 335 | string or a buffer. If it is shorter than the maximum height of the |
| 336 | echo area, as defined by @code{max-mini-window-height}, it is displayed | 336 | echo area, as defined by @code{max-mini-window-height}, it is displayed |
| @@ -346,7 +346,7 @@ pop-up buffer is used, defaulting to @file{*Message*}. In the case | |||
| 346 | where @var{message} is a string and displayed in the echo area, it is | 346 | where @var{message} is a string and displayed in the echo area, it is |
| 347 | not specified whether the contents are inserted into the buffer anyway. | 347 | not specified whether the contents are inserted into the buffer anyway. |
| 348 | 348 | ||
| 349 | The optional arguments @var{not-this-window} and @var{frame} are as for | 349 | The optional arguments @var{action} and @var{frame} are as for |
| 350 | @code{display-buffer}, and only used if a buffer is displayed. | 350 | @code{display-buffer}, and only used if a buffer is displayed. |
| 351 | @end defun | 351 | @end defun |
| 352 | 352 | ||
| @@ -1889,12 +1889,13 @@ end of the result if it falls short of @var{width}. It is also used at | |||
| 1889 | the beginning of the result if one multi-column character in | 1889 | the beginning of the result if one multi-column character in |
| 1890 | @var{string} extends across the column @var{start-column}. | 1890 | @var{string} extends across the column @var{start-column}. |
| 1891 | 1891 | ||
| 1892 | @vindex truncate-string-ellipsis | ||
| 1892 | If @var{ellipsis} is non-@code{nil}, it should be a string which will | 1893 | If @var{ellipsis} is non-@code{nil}, it should be a string which will |
| 1893 | replace the end of @var{string} (including any padding) if it extends | 1894 | replace the end of @var{string} (including any padding) if it extends |
| 1894 | beyond @var{width}, unless the display width of @var{string} is equal | 1895 | beyond @var{width}, unless the display width of @var{string} is equal |
| 1895 | to or less than the display width of @var{ellipsis}. If | 1896 | to or less than the display width of @var{ellipsis}. If |
| 1896 | @var{ellipsis} is non-@code{nil} and not a string, it stands for | 1897 | @var{ellipsis} is non-@code{nil} and not a string, it stands for |
| 1897 | @code{"..."}. | 1898 | the value of the variable @code{truncate-string-ellipsis}. |
| 1898 | 1899 | ||
| 1899 | @example | 1900 | @example |
| 1900 | (truncate-string-to-width "\tab\t" 12 4) | 1901 | (truncate-string-to-width "\tab\t" 12 4) |
| @@ -3659,6 +3660,39 @@ tag (or @code{nil}, which stands for the default langsys), and each | |||
| 3659 | @end table | 3660 | @end table |
| 3660 | @end defun | 3661 | @end defun |
| 3661 | 3662 | ||
| 3663 | @cindex font information for layout | ||
| 3664 | The following four functions return size information about fonts used | ||
| 3665 | by various faces, allowing various layout considerations in Lisp | ||
| 3666 | programs. These functions take face remapping into consideration, | ||
| 3667 | returning information about the remapped face, if the face in question | ||
| 3668 | was remapped. @xref{Face Remapping}. | ||
| 3669 | |||
| 3670 | @defun default-font-width | ||
| 3671 | This function returns the average width in pixels of the font used by | ||
| 3672 | the current buffer's default face. | ||
| 3673 | @end defun | ||
| 3674 | |||
| 3675 | @defun default-font-height | ||
| 3676 | This function returns the height in pixels of the font used by the | ||
| 3677 | current buffer's default face. | ||
| 3678 | @end defun | ||
| 3679 | |||
| 3680 | @defun window-font-width &optional window face | ||
| 3681 | This function returns the average width in pixels for the font used by | ||
| 3682 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3683 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3684 | selected window, and @var{face} defaults to the default face in | ||
| 3685 | @var{window}. | ||
| 3686 | @end defun | ||
| 3687 | |||
| 3688 | @defun window-font-height &optional window face | ||
| 3689 | This function returns the height in pixels for the font used by | ||
| 3690 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3691 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3692 | selected window, and @var{face} defaults to the default face in | ||
| 3693 | @var{window}. | ||
| 3694 | @end defun | ||
| 3695 | |||
| 3662 | @node Fringes | 3696 | @node Fringes |
| 3663 | @section Fringes | 3697 | @section Fringes |
| 3664 | @cindex fringes | 3698 | @cindex fringes |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 2d3548f65ba..56d303e2e9e 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -467,6 +467,10 @@ Control Structures | |||
| 467 | * Generators:: Generic sequences and coroutines. | 467 | * Generators:: Generic sequences and coroutines. |
| 468 | * Nonlocal Exits:: Jumping out of a sequence. | 468 | * Nonlocal Exits:: Jumping out of a sequence. |
| 469 | 469 | ||
| 470 | Conditionals | ||
| 471 | |||
| 472 | * Pattern matching case statement:: How to use @code{pcase}. | ||
| 473 | |||
| 470 | Nonlocal Exits | 474 | Nonlocal Exits |
| 471 | 475 | ||
| 472 | * Catch and Throw:: Nonlocal exits for the program's own purposes. | 476 | * Catch and Throw:: Nonlocal exits for the program's own purposes. |
| @@ -535,6 +539,7 @@ Functions | |||
| 535 | * Function Cells:: Accessing or setting the function definition | 539 | * Function Cells:: Accessing or setting the function definition |
| 536 | of a symbol. | 540 | of a symbol. |
| 537 | * Closures:: Functions that enclose a lexical environment. | 541 | * Closures:: Functions that enclose a lexical environment. |
| 542 | * Advising Functions:: Adding to the definition of a function. | ||
| 538 | * Obsolete Functions:: Declaring functions obsolete. | 543 | * Obsolete Functions:: Declaring functions obsolete. |
| 539 | * Inline Functions:: Defining functions that the compiler | 544 | * Inline Functions:: Defining functions that the compiler |
| 540 | will expand inline. | 545 | will expand inline. |
| @@ -552,6 +557,13 @@ Lambda Expressions | |||
| 552 | * Argument List:: Details and special features of argument lists. | 557 | * Argument List:: Details and special features of argument lists. |
| 553 | * Function Documentation:: How to put documentation in a function. | 558 | * Function Documentation:: How to put documentation in a function. |
| 554 | 559 | ||
| 560 | Advising Emacs Lisp Functions | ||
| 561 | |||
| 562 | * Core Advising Primitives:: Primitives to manipulate advice. | ||
| 563 | * Advising Named Functions:: Advising named functions. | ||
| 564 | * Advice combinators:: Ways to compose advice. | ||
| 565 | * Porting old advice:: Adapting code using the old defadvice. | ||
| 566 | |||
| 555 | Macros | 567 | Macros |
| 556 | 568 | ||
| 557 | * Simple Macro:: A basic example. | 569 | * Simple Macro:: A basic example. |
| @@ -602,6 +614,7 @@ Loading | |||
| 602 | * Unloading:: How to unload a library that was loaded. | 614 | * Unloading:: How to unload a library that was loaded. |
| 603 | * Hooks for Loading:: Providing code to be run when | 615 | * Hooks for Loading:: Providing code to be run when |
| 604 | particular libraries are loaded. | 616 | particular libraries are loaded. |
| 617 | * Dynamic Modules:: Modules provide additional Lisp primitives. | ||
| 605 | 618 | ||
| 606 | Byte Compilation | 619 | Byte Compilation |
| 607 | 620 | ||
| @@ -1191,6 +1204,10 @@ Text Properties | |||
| 1191 | * Not Intervals:: Why text properties do not use | 1204 | * Not Intervals:: Why text properties do not use |
| 1192 | Lisp-visible text intervals. | 1205 | Lisp-visible text intervals. |
| 1193 | 1206 | ||
| 1207 | Parsing HTML and XML | ||
| 1208 | |||
| 1209 | * Document Object Model:: Access, manipulate and search the @acronym{DOM}. | ||
| 1210 | |||
| 1194 | Non-@acronym{ASCII} Characters | 1211 | Non-@acronym{ASCII} Characters |
| 1195 | 1212 | ||
| 1196 | * Text Representations:: How Emacs represents text. | 1213 | * Text Representations:: How Emacs represents text. |
| @@ -1530,9 +1547,12 @@ GNU Emacs Internals | |||
| 1530 | * Building Emacs:: How the dumped Emacs is made. | 1547 | * Building Emacs:: How the dumped Emacs is made. |
| 1531 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. | 1548 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 1532 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 1549 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 1550 | * Stack-allocated Objects:: Temporary conses and strings on C stack. | ||
| 1533 | * Memory Usage:: Info about total size of Lisp objects made so far. | 1551 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 1552 | * C Dialect:: What C variant Emacs is written in. | ||
| 1534 | * Writing Emacs Primitives:: Writing C code for Emacs. | 1553 | * Writing Emacs Primitives:: Writing C code for Emacs. |
| 1535 | * Object Internals:: Data formats of buffers, windows, processes. | 1554 | * Object Internals:: Data formats of buffers, windows, processes. |
| 1555 | * C Integer Types:: How C integer types are used inside Emacs. | ||
| 1536 | 1556 | ||
| 1537 | Object Internals | 1557 | Object Internals |
| 1538 | 1558 | ||
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index 067dbd2d99f..dfad9fb709d 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi | |||
| @@ -780,7 +780,8 @@ to specify this function, but it is more robust to use the | |||
| 780 | @deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print | 780 | @deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print |
| 781 | This is similar to @code{eval-region}, but the arguments provide | 781 | This is similar to @code{eval-region}, but the arguments provide |
| 782 | different optional features. @code{eval-buffer} operates on the | 782 | different optional features. @code{eval-buffer} operates on the |
| 783 | entire accessible portion of buffer @var{buffer-or-name}. | 783 | entire accessible portion of buffer @var{buffer-or-name} |
| 784 | (@pxref{Narrowing,,, emacs, The GNU Emacs Manual}). | ||
| 784 | @var{buffer-or-name} can be a buffer, a buffer name (a string), or | 785 | @var{buffer-or-name} can be a buffer, a buffer name (a string), or |
| 785 | @code{nil} (or omitted), which means to use the current buffer. | 786 | @code{nil} (or omitted), which means to use the current buffer. |
| 786 | @var{stream} is used as in @code{eval-region}, unless @var{stream} is | 787 | @var{stream} is used as in @code{eval-region}, unless @var{stream} is |
| @@ -833,9 +834,9 @@ The value of this variable is a list of the values returned by all the | |||
| 833 | expressions that were read, evaluated, and printed from buffers | 834 | expressions that were read, evaluated, and printed from buffers |
| 834 | (including the minibuffer) by the standard Emacs commands which do | 835 | (including the minibuffer) by the standard Emacs commands which do |
| 835 | this. (Note that this does @emph{not} include evaluation in | 836 | this. (Note that this does @emph{not} include evaluation in |
| 836 | @file{*ielm*} buffers, nor evaluation using @kbd{C-j} in | 837 | @file{*ielm*} buffers, nor evaluation using @kbd{C-j}, @kbd{C-x C-e}, |
| 837 | @code{lisp-interaction-mode}.) The elements are ordered most recent | 838 | and similar evaluation commands in @code{lisp-interaction-mode}.) The |
| 838 | first. | 839 | elements are ordered most recent first. |
| 839 | 840 | ||
| 840 | @example | 841 | @example |
| 841 | @group | 842 | @group |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 9a1b2cd217f..918bf5becbd 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2030,11 +2030,6 @@ form. | |||
| 2030 | @end example | 2030 | @end example |
| 2031 | @end defun | 2031 | @end defun |
| 2032 | 2032 | ||
| 2033 | @defun directory-name-p filename | ||
| 2034 | This function returns non-@code{nil} if @var{filename} ends with a | ||
| 2035 | forward slash (@samp{/}) character. | ||
| 2036 | @end defun | ||
| 2037 | |||
| 2038 | @node Directory Names | 2033 | @node Directory Names |
| 2039 | @subsection Directory Names | 2034 | @subsection Directory Names |
| 2040 | @cindex directory name | 2035 | @cindex directory name |
| @@ -2076,6 +2071,13 @@ string (if it does not already end in one). | |||
| 2076 | @end example | 2071 | @end example |
| 2077 | @end defun | 2072 | @end defun |
| 2078 | 2073 | ||
| 2074 | @defun directory-name-p filename | ||
| 2075 | This function returns non-@code{nil} if @var{filename} ends with a | ||
| 2076 | directory separator character. This is the forward slash @samp{/} on | ||
| 2077 | Unix and GNU systems; MS-Windows and MS-DOS recognize both the forward | ||
| 2078 | slash and the backslash @samp{\} as directory separators. | ||
| 2079 | @end defun | ||
| 2080 | |||
| 2079 | @defun directory-file-name dirname | 2081 | @defun directory-file-name dirname |
| 2080 | This function returns a string representing @var{dirname} in a form | 2082 | This function returns a string representing @var{dirname} in a form |
| 2081 | that the operating system will interpret as the name of a file (a | 2083 | that the operating system will interpret as the name of a file (a |
| @@ -2632,12 +2634,20 @@ An error is signaled if @var{directory} is not the name of a directory | |||
| 2632 | that can be read. | 2634 | that can be read. |
| 2633 | @end defun | 2635 | @end defun |
| 2634 | 2636 | ||
| 2635 | @defun directory-files-recursively directory match &optional include-directories | 2637 | @defun directory-files-recursively directory regexp &optional include-directories |
| 2636 | Return all files under @var{directory} whose file names match | 2638 | Return all files under @var{directory} whose names match @var{regexp}. |
| 2637 | @var{match} recursively. The file names are returned depth first, | 2639 | This function searches the specified @var{directory} and its |
| 2638 | meaning that contents of sub-directories are returned before contents | 2640 | sub-directories, recursively, for files whose basenames (i.e., without |
| 2639 | of the directories. If @var{include-directories} is non-@code{nil}, | 2641 | the leading directories) match the specified @var{regexp}, and returns |
| 2640 | also return directory names that have matching names. | 2642 | a list of the absolute file names of the matching files |
| 2643 | (@pxref{Relative File Names, absolute file names}). The file names | ||
| 2644 | are returned in depth-first order, meaning that files in some | ||
| 2645 | sub-directory are returned before the files in its parent directory. | ||
| 2646 | In addition, matching files found in each subdirectory are sorted | ||
| 2647 | alphabetically by their basenames. By default, directories whose | ||
| 2648 | names match @var{regexp} are omitted from the list, but if the | ||
| 2649 | optional argument @var{include-directories} is non-@code{nil}, they | ||
| 2650 | are included. | ||
| 2641 | @end defun | 2651 | @end defun |
| 2642 | 2652 | ||
| 2643 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format | 2653 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 3ae33082fc4..80a4af29f1a 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -557,7 +557,7 @@ The top left corner of the native frame specifies the @dfn{native | |||
| 557 | position} of the frame. (1)--(3) in the drawing above indicate that | 557 | position} of the frame. (1)--(3) in the drawing above indicate that |
| 558 | position for the various builds: | 558 | position for the various builds: |
| 559 | 559 | ||
| 560 | @itemize @w | 560 | @itemize @w{} |
| 561 | @item (1) non-toolkit and terminal frames | 561 | @item (1) non-toolkit and terminal frames |
| 562 | 562 | ||
| 563 | @item (2) Lucid, Motif and Windows frames | 563 | @item (2) Lucid, Motif and Windows frames |
| @@ -1001,18 +1001,40 @@ parameters of @var{frame} and their values. If @var{frame} is | |||
| 1001 | @end defun | 1001 | @end defun |
| 1002 | 1002 | ||
| 1003 | @defun modify-frame-parameters frame alist | 1003 | @defun modify-frame-parameters frame alist |
| 1004 | This function alters the parameters of frame @var{frame} based on the | 1004 | This function alters the frame @var{frame} based on the elements of |
| 1005 | elements of @var{alist}. Each element of @var{alist} has the form | 1005 | @var{alist}. Each element of @var{alist} has the form |
| 1006 | @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a | 1006 | @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming |
| 1007 | parameter. If you don't mention a parameter in @var{alist}, its value | 1007 | a parameter. If you don't mention a parameter in @var{alist}, its |
| 1008 | doesn't change. If @var{frame} is @code{nil}, it defaults to the selected | 1008 | value doesn't change. If @var{frame} is @code{nil}, it defaults to |
| 1009 | frame. | 1009 | the selected frame. |
| 1010 | |||
| 1011 | Some parameters are only meaningful for frames on certain kinds of | ||
| 1012 | display (@pxref{Frames}). If @var{alist} includes parameters that are | ||
| 1013 | not meaningful for the @var{frame}'s display, this function will | ||
| 1014 | change its value in the frame's parameter list, but will otherwise | ||
| 1015 | ignore it. | ||
| 1016 | |||
| 1017 | When @var{alist} specifies more than one parameter whose value can | ||
| 1018 | affect the new size of @var{frame}, the final size of the frame may | ||
| 1019 | differ according to the toolkit used. For example, specifying that a | ||
| 1020 | frame should from now on have a menu and/or tool bar instead of none and | ||
| 1021 | simultaneously specifying the new height of the frame will inevitably | ||
| 1022 | lead to a recalculation of the frame's height. Conceptually, in such | ||
| 1023 | case, this function will try to have the explicit height specification | ||
| 1024 | prevail. It cannot be excluded, however, that the addition (or removal) | ||
| 1025 | of the menu or tool bar, when eventually performed by the toolkit, will | ||
| 1026 | defeat this intention. | ||
| 1027 | |||
| 1028 | Sometimes, binding @code{frame-inhibit-implied-resize} (@pxref{Implied | ||
| 1029 | Frame Resizing}) to a non-@code{nil} value around calls to this function | ||
| 1030 | may fix the problem sketched here. Sometimes, however, exactly such | ||
| 1031 | binding may be hit by the problem. | ||
| 1010 | @end defun | 1032 | @end defun |
| 1011 | 1033 | ||
| 1012 | @defun set-frame-parameter frame parm value | 1034 | @defun set-frame-parameter frame parm value |
| 1013 | This function sets the frame parameter @var{parm} to the specified | 1035 | This function sets the frame parameter @var{parm} to the specified |
| 1014 | @var{value}. If @var{frame} is @code{nil}, it defaults to the | 1036 | @var{value}. If @var{frame} is @code{nil}, it defaults to the selected |
| 1015 | selected frame. | 1037 | frame. |
| 1016 | @end defun | 1038 | @end defun |
| 1017 | 1039 | ||
| 1018 | @defun modify-all-frames-parameters alist | 1040 | @defun modify-all-frames-parameters alist |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 8835667b82d..7cc041fa77e 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -861,15 +861,18 @@ into a list. @code{mapc} always returns @var{sequence}. | |||
| 861 | 861 | ||
| 862 | @defun mapconcat function sequence separator | 862 | @defun mapconcat function sequence separator |
| 863 | @code{mapconcat} applies @var{function} to each element of | 863 | @code{mapconcat} applies @var{function} to each element of |
| 864 | @var{sequence}: the results, which must be strings, are concatenated. | 864 | @var{sequence}; the results, which must be sequences of characters |
| 865 | Between each pair of result strings, @code{mapconcat} inserts the string | 865 | (strings, vectors, or lists), are concatenated into a single string |
| 866 | @var{separator}. Usually @var{separator} contains a space or comma or | 866 | return value. Between each pair of result sequences, @code{mapconcat} |
| 867 | other suitable punctuation. | 867 | inserts the characters from @var{separator}, which also must be a |
| 868 | string, or a vector or list of characters. @xref{Sequences Arrays | ||
| 869 | Vectors}. | ||
| 868 | 870 | ||
| 869 | The argument @var{function} must be a function that can take one | 871 | The argument @var{function} must be a function that can take one |
| 870 | argument and return a string. The argument @var{sequence} can be any | 872 | argument and returns a sequence of characters: a string, a vector, or |
| 871 | kind of sequence except a char-table; that is, a list, a vector, a | 873 | a list. The argument @var{sequence} can be any kind of sequence |
| 872 | bool-vector, or a string. | 874 | except a char-table; that is, a list, a vector, a bool-vector, or a |
| 875 | string. | ||
| 873 | 876 | ||
| 874 | @example | 877 | @example |
| 875 | @group | 878 | @group |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 387587a4203..685995b395f 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -352,16 +352,16 @@ string in Emacs Lisp. | |||
| 352 | @defvar text-quoting-style | 352 | @defvar text-quoting-style |
| 353 | @cindex curved quotes | 353 | @cindex curved quotes |
| 354 | @cindex curly quotes | 354 | @cindex curly quotes |
| 355 | The value of this variable specifies the style used to generate text | 355 | The value of this variable is a symbol that specifies the style Emacs |
| 356 | quotes. If the variable's value is @code{curve}, the style is | 356 | should use for single quotes in the wording of help and messages. |
| 357 | If the variable's value is @code{curve}, the style is | ||
| 357 | @t{‘like this’} with curved single quotes. If the value is | 358 | @t{‘like this’} with curved single quotes. If the value is |
| 358 | @code{straight}, the style is @t{'like this'} with straight | 359 | @code{straight}, the style is @t{'like this'} with straight |
| 359 | apostrophes. If the value is @code{grave}, the style is @t{`like | 360 | apostrophes. If the value is @code{grave}, the style is @t{`like |
| 360 | this'} with grave accent and apostrophe. The default value @code{nil} | 361 | this'} with grave accent and apostrophe, the standard style |
| 362 | before Emacs version 25. The default value @code{nil} | ||
| 361 | acts like @code{curve} if curved single quotes are displayable, and | 363 | acts like @code{curve} if curved single quotes are displayable, and |
| 362 | like @code{grave} otherwise. To use the traditional @code{grave} | 364 | like @code{grave} otherwise. |
| 363 | style, put the line @code{(setq text-quoting-style 'grave)} into your | ||
| 364 | @file{~/.emacs} file. | ||
| 365 | @end defvar | 365 | @end defvar |
| 366 | 366 | ||
| 367 | @defun substitute-command-keys string | 367 | @defun substitute-command-keys string |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index e620da0b4ff..e111d358ba0 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -32,7 +32,9 @@ executable. You don't have to know this material to build and install | |||
| 32 | Emacs, since the makefiles do all these things automatically. This | 32 | Emacs, since the makefiles do all these things automatically. This |
| 33 | information is pertinent to Emacs developers. | 33 | information is pertinent to Emacs developers. |
| 34 | 34 | ||
| 35 | Compilation of the C source files in the @file{src} directory | 35 | Building Emacs requires GNU Make version 3.81 or later. |
| 36 | |||
| 37 | Compilation of the C source files in the @file{src} directory | ||
| 36 | produces an executable file called @file{temacs}, also called a | 38 | produces an executable file called @file{temacs}, also called a |
| 37 | @dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and | 39 | @dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and |
| 38 | I/O routines, but not the editing commands. | 40 | I/O routines, but not the editing commands. |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 82de765876e..e01f3161731 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -29,7 +29,15 @@ into a buffer and evaluated there. (Indeed, most code is tested this | |||
| 29 | way.) Most often, the forms are function definitions and variable | 29 | way.) Most often, the forms are function definitions and variable |
| 30 | definitions. | 30 | definitions. |
| 31 | 31 | ||
| 32 | For on-demand loading of external libraries, @pxref{Dynamic Libraries}. | 32 | Emacs can also load compiled dynamic modules: shared libraries that |
| 33 | provide additional functionality for use in Emacs Lisp programs, just | ||
| 34 | like a package written in Emacs Lisp would. When a dynamic module is | ||
| 35 | loaded, Emacs calls a specially-named initialization function which | ||
| 36 | the module needs to implement, and which exposes the additional | ||
| 37 | functions and variables to Emacs Lisp programs. | ||
| 38 | |||
| 39 | For on-demand loading of external libraries which are known in advance | ||
| 40 | to be required by certain Emacs primitives, @pxref{Dynamic Libraries}. | ||
| 33 | 41 | ||
| 34 | @menu | 42 | @menu |
| 35 | * How Programs Do Loading:: The @code{load} function and others. | 43 | * How Programs Do Loading:: The @code{load} function and others. |
| @@ -43,6 +51,7 @@ For on-demand loading of external libraries, @pxref{Dynamic Libraries}. | |||
| 43 | * Unloading:: How to unload a library that was loaded. | 51 | * Unloading:: How to unload a library that was loaded. |
| 44 | * Hooks for Loading:: Providing code to be run when | 52 | * Hooks for Loading:: Providing code to be run when |
| 45 | particular libraries are loaded. | 53 | particular libraries are loaded. |
| 54 | * Dynamic Modules:: Modules provide additional Lisp primitives. | ||
| 46 | @end menu | 55 | @end menu |
| 47 | 56 | ||
| 48 | @node How Programs Do Loading | 57 | @node How Programs Do Loading |
| @@ -1076,3 +1085,53 @@ defined in another library (those meant for outside use), you can do | |||
| 1076 | it immediately---there is no need to wait until the library is loaded. | 1085 | it immediately---there is no need to wait until the library is loaded. |
| 1077 | If you need to call functions defined by that library, you should load | 1086 | If you need to call functions defined by that library, you should load |
| 1078 | the library, preferably with @code{require} (@pxref{Named Features}). | 1087 | the library, preferably with @code{require} (@pxref{Named Features}). |
| 1088 | |||
| 1089 | @node Dynamic Modules | ||
| 1090 | @section Emacs Dynamic Modules | ||
| 1091 | @cindex dynamic modules | ||
| 1092 | |||
| 1093 | @c FIXME: This is intentionally incomplete, as the module integration | ||
| 1094 | @c is not yet finished. To be refined later. | ||
| 1095 | A @dfn{dynamic Emacs module} is a shared library that provides | ||
| 1096 | additional functionality for use in Emacs Lisp programs, just like a | ||
| 1097 | package written in Emacs Lisp would. | ||
| 1098 | |||
| 1099 | Functions that load Emacs Lisp packages can also load dynamic | ||
| 1100 | modules. They recognize dynamic modules by looking at their file-name | ||
| 1101 | extension, a.k.a.@: ``suffix''. This suffix is platform-dependent. | ||
| 1102 | |||
| 1103 | @defvar module-file-suffix | ||
| 1104 | This variable holds the system-dependent value of the file-name | ||
| 1105 | extension of the module files. Its value is @file{.so} on Posix hosts | ||
| 1106 | and @file{.dll} on MS-Windows. | ||
| 1107 | @end defvar | ||
| 1108 | |||
| 1109 | @findex emacs_module_init | ||
| 1110 | @vindex plugin_is_GPL_compatible | ||
| 1111 | Every dynamic module should export a C-callable function named | ||
| 1112 | @code{emacs_module_init}, which Emacs will call as part of the call to | ||
| 1113 | @code{load} or @code{require} which loads the module. It should also | ||
| 1114 | export a symbol named @code{plugin_is_GPL_compatible} to indicate that | ||
| 1115 | its code is released under the GPL or compatible license; Emacs will | ||
| 1116 | refuse to load modules that don't export such a symbol. | ||
| 1117 | |||
| 1118 | If a module needs to call Emacs functions, it should do so through the | ||
| 1119 | API defined and documented in the header file @file{emacs-module.h} | ||
| 1120 | that is part of the Emacs distribution. | ||
| 1121 | |||
| 1122 | @cindex user-ptr object | ||
| 1123 | Modules can create @code{user-ptr} Lisp objects that embed pointers to | ||
| 1124 | C struct's defined by the module. This is useful for keeping around | ||
| 1125 | complex data structures created by a module, to be passed back to the | ||
| 1126 | module's functions. User-ptr objects can also have associated | ||
| 1127 | @dfn{finalizers} -- functions to be run when the object is GC'ed; this | ||
| 1128 | is useful for freeing any resources allocated for the underlying data | ||
| 1129 | structure, such as memory, open file descriptors, etc. | ||
| 1130 | |||
| 1131 | @defun user-ptrp object | ||
| 1132 | This function returns @code{t} if its argument is a @code{user-ptr} | ||
| 1133 | object. | ||
| 1134 | @end defun | ||
| 1135 | |||
| 1136 | Loadable modules in Emacs are enabled by using the | ||
| 1137 | @kbd{--with-modules} option at configure time. | ||
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index a1747707d11..3b8550e13b9 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -2509,6 +2509,53 @@ Search-based fontification happens second. | |||
| 2509 | @node Font Lock Basics | 2509 | @node Font Lock Basics |
| 2510 | @subsection Font Lock Basics | 2510 | @subsection Font Lock Basics |
| 2511 | 2511 | ||
| 2512 | The Font Lock functionality is based on several basic functions. | ||
| 2513 | Each of these calls the function specified by the corresponding | ||
| 2514 | variable. This indirection allows major modes to modify the way | ||
| 2515 | fontification works in the buffers of that mode, and even use the Font | ||
| 2516 | Lock mechanisms for features that have nothing to do with | ||
| 2517 | fontification. (This is why the description below says ``should'' | ||
| 2518 | when it describes what the functions do: the major mode can customize | ||
| 2519 | the values of the corresponding variables to do something entirely | ||
| 2520 | different.) The variables mentioned below are described in @ref{Other | ||
| 2521 | Font Lock Variables}. | ||
| 2522 | |||
| 2523 | @ftable @code | ||
| 2524 | @item font-lock-fontify-buffer | ||
| 2525 | This function should fontify the current buffer's accessible portion, | ||
| 2526 | by calling the function specified by | ||
| 2527 | @code{font-lock-fontify-buffer-function}. | ||
| 2528 | |||
| 2529 | @item font-lock-unfontify-buffer | ||
| 2530 | Used when turning Font Lock off to remove the fontification. Calls | ||
| 2531 | the function specified by @code{font-lock-unfontify-buffer-function}. | ||
| 2532 | |||
| 2533 | @item font-lock-fontify-region beg end &optional loudly | ||
| 2534 | Should fontify the region between @var{beg} and @var{end}. If | ||
| 2535 | @var{loudly} is non-@code{nil}, should display status messages while | ||
| 2536 | fontifying. Calls the function specified by | ||
| 2537 | @code{font-lock-fontify-region-function}. | ||
| 2538 | |||
| 2539 | @item font-lock-unfontify-region beg end | ||
| 2540 | Should remove fontification from the region between @var{beg} and | ||
| 2541 | @var{end}. Calls the function specified by | ||
| 2542 | @code{font-lock-unfontify-region-function}. | ||
| 2543 | |||
| 2544 | @item font-lock-flush &optional beg end | ||
| 2545 | This function should mark the fontification of the region between | ||
| 2546 | @var{beg} and @var{end} as outdated. If not specified or @code{nil}, | ||
| 2547 | @var{beg} and @var{end} default to the beginning and end of the | ||
| 2548 | buffer's accessible portion. Calls the function specified by | ||
| 2549 | @code{font-lock-flush-function}. | ||
| 2550 | |||
| 2551 | @item font-lock-ensure &optional beg end | ||
| 2552 | This function should make sure the region between @var{beg} and | ||
| 2553 | @var{end} has been fontified. The optional arguments @var{beg} and | ||
| 2554 | @var{end} default to the beginning and the end of the buffer's | ||
| 2555 | accessible portion. Calls the function specified by | ||
| 2556 | @code{font-lock-ensure-function}. | ||
| 2557 | @end ftable | ||
| 2558 | |||
| 2512 | There are several variables that control how Font Lock mode highlights | 2559 | There are several variables that control how Font Lock mode highlights |
| 2513 | text. But major modes should not set any of these variables directly. | 2560 | text. But major modes should not set any of these variables directly. |
| 2514 | Instead, they should set @code{font-lock-defaults} as a buffer-local | 2561 | Instead, they should set @code{font-lock-defaults} as a buffer-local |
| @@ -2936,6 +2983,22 @@ arguments, the beginning and end of the region. The default value is | |||
| 2936 | @code{font-lock-default-unfontify-region}. | 2983 | @code{font-lock-default-unfontify-region}. |
| 2937 | @end defvar | 2984 | @end defvar |
| 2938 | 2985 | ||
| 2986 | @defvar font-lock-flush-function | ||
| 2987 | Function to use for declaring that a region's fontification is out of | ||
| 2988 | date. It takes two arguments, the beginning and end of the region. | ||
| 2989 | The default value of this variable is | ||
| 2990 | @code{font-lock-after-change-function}. | ||
| 2991 | @end defvar | ||
| 2992 | |||
| 2993 | @defvar font-lock-ensure-function | ||
| 2994 | Function to use for making sure a region of the current buffer has | ||
| 2995 | been fontified. It is called with two arguments, the beginning and | ||
| 2996 | end of the region. The default value of this variable is a function | ||
| 2997 | that calls @code{font-lock-default-fontify-buffer} if the buffer is | ||
| 2998 | not fontified; the effect is to make sure the entire accessible | ||
| 2999 | portion of the buffer is fontified. | ||
| 3000 | @end defvar | ||
| 3001 | |||
| 2939 | @defun jit-lock-register function &optional contextual | 3002 | @defun jit-lock-register function &optional contextual |
| 2940 | This function tells Font Lock mode to run the Lisp function | 3003 | This function tells Font Lock mode to run the Lisp function |
| 2941 | @var{function} any time it has to fontify or refontify part of the | 3004 | @var{function} any time it has to fontify or refontify part of the |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 17a0b47ad06..92e3ee2b33c 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -902,6 +902,9 @@ Hewlett-Packard HPUX operating system. | |||
| 902 | @item irix | 902 | @item irix |
| 903 | Silicon Graphics Irix system. | 903 | Silicon Graphics Irix system. |
| 904 | 904 | ||
| 905 | @item nacl | ||
| 906 | Google Native Client (@acronym{NaCl}) sandboxing system. | ||
| 907 | |||
| 905 | @item ms-dos | 908 | @item ms-dos |
| 906 | Microsoft's DOS@. Emacs compiled with DJGPP for MS-DOS binds | 909 | Microsoft's DOS@. Emacs compiled with DJGPP for MS-DOS binds |
| 907 | @code{system-type} to @code{ms-dos} even when you run it on MS-Windows. | 910 | @code{system-type} to @code{ms-dos} even when you run it on MS-Windows. |
| @@ -911,7 +914,7 @@ AT&T Unix System V. | |||
| 911 | 914 | ||
| 912 | @item windows-nt | 915 | @item windows-nt |
| 913 | Microsoft Windows NT, 9X and later. The value of @code{system-type} | 916 | Microsoft Windows NT, 9X and later. The value of @code{system-type} |
| 914 | is always @code{windows-nt}, e.g., even on Windows 7. | 917 | is always @code{windows-nt}, e.g., even on Windows 10. |
| 915 | 918 | ||
| 916 | @end table | 919 | @end table |
| 917 | 920 | ||
| @@ -2922,6 +2925,18 @@ means complete; it is intended to give you an idea of the security | |||
| 2922 | issues involved, rather than to be a security checklist. | 2925 | issues involved, rather than to be a security checklist. |
| 2923 | 2926 | ||
| 2924 | @table @asis | 2927 | @table @asis |
| 2928 | @item File local variables | ||
| 2929 | @cindex file local variables | ||
| 2930 | A file that Emacs visits can contain variable settings that affects | ||
| 2931 | the buffer visiting that file; @xref{File Local Variables}. | ||
| 2932 | Similarly, a directory can specify local variable values common to all | ||
| 2933 | files in that directory; @xref{Directory Local Variables}. Although | ||
| 2934 | Emacs takes some effort to protect against misuse of these variables, | ||
| 2935 | a security hole can be created merely by a package setting | ||
| 2936 | @code{safe-local-variable} too optimistically, a problem that is all | ||
| 2937 | too common. To disable this feature for both files and directories, | ||
| 2938 | set @code{enable-local-variables} to @code{nil}. | ||
| 2939 | |||
| 2925 | @item Access control | 2940 | @item Access control |
| 2926 | Although Emacs normally respects access permissions of the underlying | 2941 | Although Emacs normally respects access permissions of the underlying |
| 2927 | operating system, in some cases it handles accesses specially. For | 2942 | operating system, in some cases it handles accesses specially. For |
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 72b76ce5c8f..9daf5cef059 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -572,6 +572,18 @@ The value returned is the window line number point has moved to, with | |||
| 572 | the top line in the window numbered 0. | 572 | the top line in the window numbered 0. |
| 573 | @end deffn | 573 | @end deffn |
| 574 | 574 | ||
| 575 | @vindex move-to-window-group-line-function | ||
| 576 | @defun move-to-window-group-line count | ||
| 577 | This function is like @code{move-to-window-line}, except that when the | ||
| 578 | selected window is a part of a group of windows (@pxref{Window | ||
| 579 | Group}), @code{move-to-window-group-line} will move to a position with | ||
| 580 | respect to the entire group, not just the single window. This | ||
| 581 | condition holds when the buffer local variable | ||
| 582 | @code{move-to-window-group-line-function} is set to a function. In | ||
| 583 | this case, @code{move-to-window-group-line} calls the function with | ||
| 584 | the argument @var{count}, then returns its result. | ||
| 585 | @end defun | ||
| 586 | |||
| 575 | @defun compute-motion from frompos to topos width offsets window | 587 | @defun compute-motion from frompos to topos width offsets window |
| 576 | This function scans the current buffer, calculating screen positions. | 588 | This function scans the current buffer, calculating screen positions. |
| 577 | It scans the buffer forward from position @var{from}, assuming that is | 589 | It scans the buffer forward from position @var{from}, assuming that is |
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 0ce696ad533..41255e7e8d0 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -737,10 +737,12 @@ If @var{stopped} is non-@code{nil}, start the process in the | |||
| 737 | stopped state. | 737 | stopped state. |
| 738 | 738 | ||
| 739 | @item :filter @var{filter} | 739 | @item :filter @var{filter} |
| 740 | Initialize the process filter to @var{filter}. | 740 | Initialize the process filter to @var{filter}. If not specified, a |
| 741 | default filter will be provided. @xref{Filter Functions}. | ||
| 741 | 742 | ||
| 742 | @item :sentinel @var{sentinel} | 743 | @item :sentinel @var{sentinel} |
| 743 | Initialize the process sentinel to @var{sentinel}. | 744 | Initialize the process sentinel to @var{sentinel}. If not specified, |
| 745 | a default sentinel will be used. @xref{Sentinels}. | ||
| 744 | 746 | ||
| 745 | @item :stderr @var{stderr} | 747 | @item :stderr @var{stderr} |
| 746 | Associate @var{stderr} with the standard error of the process. | 748 | Associate @var{stderr} with the standard error of the process. |
| @@ -789,10 +791,12 @@ If @var{stopped} is non-@code{nil}, start the process in the | |||
| 789 | stopped state. | 791 | stopped state. |
| 790 | 792 | ||
| 791 | @item :filter @var{filter} | 793 | @item :filter @var{filter} |
| 792 | Initialize the process filter to @var{filter}. | 794 | Initialize the process filter to @var{filter}. If not specified, a |
| 795 | default filter will be provided. @xref{Filter Functions}. | ||
| 793 | 796 | ||
| 794 | @item :sentinel @var{sentinel} | 797 | @item :sentinel @var{sentinel} |
| 795 | Initialize the process sentinel to @var{sentinel}. | 798 | Initialize the process sentinel to @var{sentinel}. If not specified, |
| 799 | a default sentinel will be used. @xref{Sentinels}. | ||
| 796 | @end table | 800 | @end table |
| 797 | 801 | ||
| 798 | The original argument list, modified with the actual connection | 802 | The original argument list, modified with the actual connection |
| @@ -922,9 +926,10 @@ For a network process, the values include (see | |||
| 922 | @item :buffer | 926 | @item :buffer |
| 923 | The associated value is the process buffer. | 927 | The associated value is the process buffer. |
| 924 | @item :filter | 928 | @item :filter |
| 925 | The associated value is the process filter function. | 929 | The associated value is the process filter function. @xref{Filter |
| 930 | Functions}. | ||
| 926 | @item :sentinel | 931 | @item :sentinel |
| 927 | The associated value is the process sentinel function. | 932 | The associated value is the process sentinel function. @xref{Sentinels}. |
| 928 | @item :remote | 933 | @item :remote |
| 929 | In a connection, the address in internal format of the remote peer. | 934 | In a connection, the address in internal format of the remote peer. |
| 930 | @item :local | 935 | @item :local |
| @@ -1379,6 +1384,7 @@ subprocess with a @code{SIGHUP} signal (@pxref{Signals to Processes}). | |||
| 1379 | @cindex filter function | 1384 | @cindex filter function |
| 1380 | @cindex process filter | 1385 | @cindex process filter |
| 1381 | 1386 | ||
| 1387 | @cindex default filter function of a process | ||
| 1382 | A process @dfn{filter function} is a function that receives the | 1388 | A process @dfn{filter function} is a function that receives the |
| 1383 | standard output from the associated process. @emph{All} output from | 1389 | standard output from the associated process. @emph{All} output from |
| 1384 | that process is passed to the filter. The default filter simply | 1390 | that process is passed to the filter. The default filter simply |
| @@ -1632,21 +1638,43 @@ also called if the process exits. The sentinel receives two | |||
| 1632 | arguments: the process for which the event occurred, and a string | 1638 | arguments: the process for which the event occurred, and a string |
| 1633 | describing the type of event. | 1639 | describing the type of event. |
| 1634 | 1640 | ||
| 1641 | @cindex default sentinel function of a process | ||
| 1642 | If no sentinel function was specified for a process, it will use the | ||
| 1643 | default sentinel function, which inserts a message in the process's | ||
| 1644 | buffer with the process name and the string describing the event. | ||
| 1645 | |||
| 1635 | The string describing the event looks like one of the following: | 1646 | The string describing the event looks like one of the following: |
| 1636 | 1647 | ||
| 1637 | @c FIXME? Also "killed\n" - see example below? | ||
| 1638 | @itemize @bullet | 1648 | @itemize @bullet |
| 1639 | @item | 1649 | @item |
| 1640 | @code{"finished\n"}. | 1650 | @code{"finished\n"}. |
| 1641 | 1651 | ||
| 1642 | @item | 1652 | @item |
| 1643 | @code{"exited abnormally with code @var{exitcode}\n"}. | 1653 | @code{"deleted\n"}. |
| 1654 | |||
| 1655 | @item | ||
| 1656 | @code{"exited abnormally with code @var{exitcode} (core dumped)\n"}. | ||
| 1657 | The ``core dumped'' part is optional, and only appears if the process | ||
| 1658 | dumped core. | ||
| 1659 | |||
| 1660 | @item | ||
| 1661 | @code{"failed with code @var{fail-code}\n"}. | ||
| 1662 | |||
| 1663 | @item | ||
| 1664 | @code{"@var{signal-description} (core dumped)\n"}. The | ||
| 1665 | @var{signal-description} is a system-dependent textual description of | ||
| 1666 | a signal, e.g., @code{"killed"} for @code{SIGKILL}. The ``core | ||
| 1667 | dumped'' part is optional, and only appears if the process dumped | ||
| 1668 | core. | ||
| 1669 | |||
| 1670 | @item | ||
| 1671 | @code{"open from @var{host-name}\n"}. | ||
| 1644 | 1672 | ||
| 1645 | @item | 1673 | @item |
| 1646 | @code{"@var{name-of-signal}\n"}. | 1674 | @code{"open\n"}. |
| 1647 | 1675 | ||
| 1648 | @item | 1676 | @item |
| 1649 | @code{"@var{name-of-signal} (core dumped)\n"}. | 1677 | @code{"connection broken by remote peer\n"}. |
| 1650 | @end itemize | 1678 | @end itemize |
| 1651 | 1679 | ||
| 1652 | A sentinel runs only while Emacs is waiting (e.g., for terminal | 1680 | A sentinel runs only while Emacs is waiting (e.g., for terminal |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index f8685d9312c..8aa4539bd78 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -465,6 +465,7 @@ Representations}. | |||
| 465 | @code{string-equal} is another name for @code{string=}. | 465 | @code{string-equal} is another name for @code{string=}. |
| 466 | @end defun | 466 | @end defun |
| 467 | 467 | ||
| 468 | @cindex locale-dependent string equivalence | ||
| 468 | @defun string-collate-equalp string1 string2 &optional locale ignore-case | 469 | @defun string-collate-equalp string1 string2 &optional locale ignore-case |
| 469 | This function returns @code{t} if @var{string1} and @var{string2} are | 470 | This function returns @code{t} if @var{string1} and @var{string2} are |
| 470 | equal with respect to collation rules. A collation rule is not only | 471 | equal with respect to collation rules. A collation rule is not only |
| @@ -493,6 +494,7 @@ systems. | |||
| 493 | If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case | 494 | If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case |
| 494 | before comparing them. | 495 | before comparing them. |
| 495 | 496 | ||
| 497 | @vindex w32-collate-ignore-punctuation | ||
| 496 | To emulate Unicode-compliant collation on MS-Windows systems, | 498 | To emulate Unicode-compliant collation on MS-Windows systems, |
| 497 | bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since | 499 | bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since |
| 498 | the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. | 500 | the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. |
| @@ -518,7 +520,7 @@ optional argument @var{ignore-case} is non-@code{nil}, the comparison | |||
| 518 | ignores case differences. | 520 | ignores case differences. |
| 519 | @end defun | 521 | @end defun |
| 520 | 522 | ||
| 521 | @cindex lexical comparison | 523 | @cindex lexical comparison of strings |
| 522 | @defun string< string1 string2 | 524 | @defun string< string1 string2 |
| 523 | @c (findex string< causes problems for permuted index!!) | 525 | @c (findex string< causes problems for permuted index!!) |
| 524 | This function compares two strings a character at a time. It | 526 | This function compares two strings a character at a time. It |
| @@ -576,6 +578,7 @@ are used. | |||
| 576 | @code{string-lessp} is another name for @code{string<}. | 578 | @code{string-lessp} is another name for @code{string<}. |
| 577 | @end defun | 579 | @end defun |
| 578 | 580 | ||
| 581 | @cindex locale-dependent string comparison | ||
| 579 | @defun string-collate-lessp string1 string2 &optional locale ignore-case | 582 | @defun string-collate-lessp string1 string2 &optional locale ignore-case |
| 580 | This function returns @code{t} if @var{string1} is less than | 583 | This function returns @code{t} if @var{string1} is less than |
| 581 | @var{string2} in collation order. A collation order is not only | 584 | @var{string2} in collation order. A collation order is not only |
| @@ -594,15 +597,15 @@ for sorting (@pxref{Sequence Functions}): | |||
| 594 | @end group | 597 | @end group |
| 595 | @end example | 598 | @end example |
| 596 | 599 | ||
| 597 | This behavior is system-dependent; punctuation and whitespace are | 600 | This behavior is system-dependent; e.g., punctuation and whitespace |
| 598 | never ignored on Cygwin, regardless of locale. | 601 | are never ignored on Cygwin, regardless of locale. |
| 599 | 602 | ||
| 600 | The optional argument @var{locale}, a string, overrides the setting of | 603 | The optional argument @var{locale}, a string, overrides the setting of |
| 601 | your current locale identifier for collation. The value is system | 604 | your current locale identifier for collation. The value is system |
| 602 | dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX | 605 | dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX |
| 603 | systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows | 606 | systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows |
| 604 | systems. The @var{locale} @code{"POSIX"} lets @code{string-collate-lessp} | 607 | systems. The @var{locale} value of @code{"POSIX"} or @code{"C"} lets |
| 605 | behave like @code{string-lessp}: | 608 | @code{string-collate-lessp} behave like @code{string-lessp}: |
| 606 | 609 | ||
| 607 | @example | 610 | @example |
| 608 | @group | 611 | @group |
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 7a984e3d87b..831ebd12f55 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -945,6 +945,14 @@ whitespace by the functions in this section and by @code{forward-sexp}, | |||
| 945 | The behavior of @code{parse-partial-sexp} is also affected by | 945 | The behavior of @code{parse-partial-sexp} is also affected by |
| 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). | 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). |
| 947 | 947 | ||
| 948 | @defvar comment-end-can-be-escaped | ||
| 949 | If this buffer local variable is non-@code{nil}, a single character | ||
| 950 | which usually terminates a comment doesn't do so when that character | ||
| 951 | is escaped. This is used in C and C++ Modes, where line comments | ||
| 952 | starting with @samp{//} can be continued onto the next line by | ||
| 953 | escaping the newline with @samp{\}. | ||
| 954 | @end defvar | ||
| 955 | |||
| 948 | You can use @code{forward-comment} to move forward or backward over | 956 | You can use @code{forward-comment} to move forward or backward over |
| 949 | one comment or several comments. | 957 | one comment or several comments. |
| 950 | 958 | ||
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 6d9d26f0ad1..f3679a88f74 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -899,13 +899,25 @@ adds it to the most recent element. It determines automatically (using | |||
| 899 | @code{last-command}) whether the previous command was a kill command, | 899 | @code{last-command}) whether the previous command was a kill command, |
| 900 | and if so appends the killed text to the most recent entry. | 900 | and if so appends the killed text to the most recent entry. |
| 901 | 901 | ||
| 902 | @deffn Command kill-region start end | 902 | @cindex filtering killed text |
| 903 | This function kills the text in the region defined by @var{start} and | 903 | The commands described below can filter the killed text before they |
| 904 | @var{end}. The text is deleted but saved in the kill ring, along with | 904 | save it in the kill ring. They call @code{filter-buffer-substring} |
| 905 | its text properties. The value is always @code{nil}. | 905 | (@pxref{Buffer Contents}) to perform the filtering. By default, |
| 906 | there's no filtering, but major and minor modes and hook functions can | ||
| 907 | set up filtering, so that text saved in the kill ring is different | ||
| 908 | from what was in the buffer. | ||
| 909 | |||
| 910 | @deffn Command kill-region start end &optional region | ||
| 911 | This function kills the stretch of text between @var{start} and | ||
| 912 | @var{end}; but if the optional argument @var{region} is | ||
| 913 | non-@code{nil}, it ignores @var{start} and @var{end}, and kills the | ||
| 914 | text in the current region instead. The text is deleted but saved in | ||
| 915 | the kill ring, along with its text properties. The value is always | ||
| 916 | @code{nil}. | ||
| 906 | 917 | ||
| 907 | In an interactive call, @var{start} and @var{end} are point and | 918 | In an interactive call, @var{start} and @var{end} are point and |
| 908 | the mark. | 919 | the mark, and @var{region} is always non-@code{nil}, so the command |
| 920 | always kills the text in the current region. | ||
| 909 | 921 | ||
| 910 | If the buffer or text is read-only, @code{kill-region} modifies the kill | 922 | If the buffer or text is read-only, @code{kill-region} modifies the kill |
| 911 | ring just the same, then signals an error without modifying the buffer. | 923 | ring just the same, then signals an error without modifying the buffer. |
| @@ -919,18 +931,20 @@ error if the buffer or text is read-only. Instead, it simply returns, | |||
| 919 | updating the kill ring but not changing the buffer. | 931 | updating the kill ring but not changing the buffer. |
| 920 | @end defopt | 932 | @end defopt |
| 921 | 933 | ||
| 922 | @deffn Command copy-region-as-kill start end | 934 | @deffn Command copy-region-as-kill start end &optional region |
| 923 | This command saves the region defined by @var{start} and @var{end} on | 935 | This function saves the stretch of text between @var{start} and |
| 924 | the kill ring (including text properties), but does not delete the text | 936 | @var{end} on the kill ring (including text properties), but does not |
| 925 | from the buffer. It returns @code{nil}. | 937 | delete the text from the buffer. However, if the optional argument |
| 938 | @var{region} is non-@code{nil}, the function ignores @var{start} and | ||
| 939 | @var{end}, and saves the current region instead. It always returns | ||
| 940 | @code{nil}. | ||
| 941 | |||
| 942 | In an interactive call, @var{start} and @var{end} are point and | ||
| 943 | the mark, and @var{region} is always non-@code{nil}, so the command | ||
| 944 | always saves the text in the current region. | ||
| 926 | 945 | ||
| 927 | The command does not set @code{this-command} to @code{kill-region}, so a | 946 | The command does not set @code{this-command} to @code{kill-region}, so a |
| 928 | subsequent kill command does not append to the same kill ring entry. | 947 | subsequent kill command does not append to the same kill ring entry. |
| 929 | |||
| 930 | @c FIXME Why is it better? Why isn't copy-region-as-kill obsolete then? | ||
| 931 | @c Why is it used in many places in Emacs? | ||
| 932 | In Lisp programs, it is better to use @code{kill-new} or | ||
| 933 | @code{kill-append} instead of this command. @xref{Low-Level Kill Ring}. | ||
| 934 | @end deffn | 948 | @end deffn |
| 935 | 949 | ||
| 936 | @node Yanking | 950 | @node Yanking |
| @@ -1343,27 +1357,39 @@ This function places a boundary element in the undo list. The undo | |||
| 1343 | command stops at such a boundary, and successive undo commands undo | 1357 | command stops at such a boundary, and successive undo commands undo |
| 1344 | to earlier and earlier boundaries. This function returns @code{nil}. | 1358 | to earlier and earlier boundaries. This function returns @code{nil}. |
| 1345 | 1359 | ||
| 1346 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1347 | before executing each key sequence, so that each undo normally undoes | ||
| 1348 | the effects of one command. As an exception, the command | ||
| 1349 | @code{self-insert-command}, which produces self-inserting input | ||
| 1350 | characters (@pxref{Commands for Insertion}), may remove the boundary | ||
| 1351 | inserted by the command loop: a boundary is accepted for the first | ||
| 1352 | such character, the next 19 consecutive self-inserting input | ||
| 1353 | characters do not have boundaries, and then the 20th does; and so on | ||
| 1354 | as long as the self-inserting characters continue. Hence, sequences | ||
| 1355 | of consecutive character insertions can be undone as a group. | ||
| 1356 | |||
| 1357 | All buffer modifications add a boundary whenever the previous undoable | ||
| 1358 | change was made in some other buffer. This is to ensure that | ||
| 1359 | each command makes a boundary in each buffer where it makes changes. | ||
| 1360 | |||
| 1361 | Calling this function explicitly is useful for splitting the effects of | 1360 | Calling this function explicitly is useful for splitting the effects of |
| 1362 | a command into more than one unit. For example, @code{query-replace} | 1361 | a command into more than one unit. For example, @code{query-replace} |
| 1363 | calls @code{undo-boundary} after each replacement, so that the user can | 1362 | calls @code{undo-boundary} after each replacement, so that the user can |
| 1364 | undo individual replacements one by one. | 1363 | undo individual replacements one by one. |
| 1364 | |||
| 1365 | Mostly, however, this function is called automatically at an | ||
| 1366 | appropriate time. | ||
| 1367 | @end defun | ||
| 1368 | |||
| 1369 | @defun undo-auto-amalgamate | ||
| 1370 | @cindex amalgamating commands, and undo | ||
| 1371 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1372 | before executing each key sequence, so that each undo normally undoes | ||
| 1373 | the effects of one command. A few exceptional commands are | ||
| 1374 | @dfn{amalgamating}: these commands generally cause small changes to | ||
| 1375 | buffers, so with these a boundary is inserted only every 20th command, | ||
| 1376 | allowing to undo them as a group. By default, commands | ||
| 1377 | @code{self-insert-command}, which produces self-inserting input | ||
| 1378 | characters (@pxref{Commands for Insertion}), and @code{delete-char} | ||
| 1379 | which deletes characters (@pxref{Deletion}) are amalgamating. | ||
| 1380 | Where a command affects the contents of several buffers, as may happen, | ||
| 1381 | for example, when a function on the @code{post-command-hook} affects a | ||
| 1382 | buffer other than the @code{current-buffer}, then @code{undo-boundary} | ||
| 1383 | will be called in each of the affected buffers. | ||
| 1365 | @end defun | 1384 | @end defun |
| 1366 | 1385 | ||
| 1386 | @defvar undo-auto-current-boundary-timer | ||
| 1387 | Some buffers, such as process buffers, can change even when no | ||
| 1388 | commands are executing. In these cases, @code{undo-boundary} is | ||
| 1389 | normally called periodically by the timer in this variable. Setting | ||
| 1390 | this variable to non-@code{nil} prevents this behavior. | ||
| 1391 | @end defvar | ||
| 1392 | |||
| 1367 | @defvar undo-in-progress | 1393 | @defvar undo-in-progress |
| 1368 | This variable is normally @code{nil}, but the undo commands bind it to | 1394 | This variable is normally @code{nil}, but the undo commands bind it to |
| 1369 | @code{t}. This is so that various kinds of change hooks can tell when | 1395 | @code{t}. This is so that various kinds of change hooks can tell when |
| @@ -2336,6 +2362,84 @@ already indented, it calls @code{completion-at-point} to complete the | |||
| 2336 | text at point (@pxref{Completion in Buffers}). | 2362 | text at point (@pxref{Completion in Buffers}). |
| 2337 | @end defopt | 2363 | @end defopt |
| 2338 | 2364 | ||
| 2365 | @cindex literate programming | ||
| 2366 | @cindex multi-mode indentation | ||
| 2367 | Some major modes need to support embedded regions of text whose | ||
| 2368 | syntax belongs to a different major mode. Examples include | ||
| 2369 | @dfn{literate programming} source files that combine documentation and | ||
| 2370 | snippets of source code, Yacc/Bison programs that include snippets of | ||
| 2371 | plain C code, etc. To correctly indent the embedded chunks, the major | ||
| 2372 | mode needs to delegate the indentation to another mode's indentation | ||
| 2373 | engine (e.g., call @code{c-indent-defun} for C code or | ||
| 2374 | @code{python-indent-line} for Python), while providing it with some | ||
| 2375 | context to guide the indentation. The following facilities support | ||
| 2376 | such multi-mode indentation. | ||
| 2377 | |||
| 2378 | @defvar prog-indentation-context | ||
| 2379 | This variable, when non-@code{nil}, holds the indentation context for | ||
| 2380 | the sub-mode's indentation engine provided by the superior major mode. | ||
| 2381 | The value should be a list of the form @code{(@var{first-column} | ||
| 2382 | @w{(@var{start} . @var{end})} @code{prev-chunk})}. The members of the | ||
| 2383 | list have the following meaning: | ||
| 2384 | |||
| 2385 | @table @var | ||
| 2386 | @item first-column | ||
| 2387 | The column to be used for top-level constructs. This replaces the | ||
| 2388 | default value of the top-level column used by the sub-mode, usually | ||
| 2389 | zero. | ||
| 2390 | @item start | ||
| 2391 | @itemx end | ||
| 2392 | The region of the code chunk to be indented by the sub-mode. The | ||
| 2393 | value of @var{end} can be @code{nil}, which stands for the value of | ||
| 2394 | @code{point-max}. | ||
| 2395 | @item prev-chunk | ||
| 2396 | If this is non-@code{nil}, it should provide the sub-mode's | ||
| 2397 | indentation engine with a virtual context of the code chunk. Valid | ||
| 2398 | values include: | ||
| 2399 | |||
| 2400 | @itemize @minus | ||
| 2401 | @item | ||
| 2402 | A string whose contents is the text the sub-mode's indentation engine | ||
| 2403 | should consider to precede the code chunk. The sub-mode's indentation | ||
| 2404 | engine can add text properties to that string, to be reused in | ||
| 2405 | repeated calls with the same string, thus using it as a cache. An | ||
| 2406 | example where this is useful is code chunks that need to be indented | ||
| 2407 | as function bodies, but lack the function's preamble---the string | ||
| 2408 | could then include that missing preamble. | ||
| 2409 | @item | ||
| 2410 | A function. It is expected to be called with the start position of | ||
| 2411 | the current chunk, and should return a cons cell | ||
| 2412 | @w{@code{(@var{prev-start} . @var{prev-end})}} that specifies the | ||
| 2413 | region of the previous code chunk, or @code{nil} if there is no previous | ||
| 2414 | chunk. This is useful in literate-programming sources, where code is | ||
| 2415 | split into chunks, and correct indentation needs to access previous | ||
| 2416 | chunks. | ||
| 2417 | @end itemize | ||
| 2418 | @end table | ||
| 2419 | @end defvar | ||
| 2420 | |||
| 2421 | The following convenience functions should be used by major mode's | ||
| 2422 | indentation engine in support of invocations as sub-modes of another | ||
| 2423 | major mode. | ||
| 2424 | |||
| 2425 | @defun prog-first-column | ||
| 2426 | Call this function instead of using a literal value (usually, zero) of | ||
| 2427 | the column number for indenting top-level program constructs. The | ||
| 2428 | function's value is the column number to use for top-level constructs. | ||
| 2429 | When no superior mode is in effect, this function returns zero. | ||
| 2430 | @end defun | ||
| 2431 | |||
| 2432 | @defun prog-widen | ||
| 2433 | Call this function instead of @code{widen} to remove any restrictions | ||
| 2434 | imposed by the mode's indentation engine and restore the restrictions | ||
| 2435 | recorded in @code{prog-indentation-context}. This prevents the | ||
| 2436 | indentation engine of a sub-mode from inadvertently operating on text | ||
| 2437 | outside of the chunk it was supposed to indent, and preserves the | ||
| 2438 | restriction imposed by the superior mode. When no superior mode is in | ||
| 2439 | effect, this function just calls @code{widen}. | ||
| 2440 | @end defun | ||
| 2441 | |||
| 2442 | |||
| 2339 | @node Region Indent | 2443 | @node Region Indent |
| 2340 | @subsection Indenting an Entire Region | 2444 | @subsection Indenting an Entire Region |
| 2341 | 2445 | ||
| @@ -3256,8 +3360,8 @@ and then remove the property. @xref{Read Only Buffers}. | |||
| 3256 | 3360 | ||
| 3257 | @item inhibit-read-only | 3361 | @item inhibit-read-only |
| 3258 | @kindex inhibit-read-only @r{(text property)} | 3362 | @kindex inhibit-read-only @r{(text property)} |
| 3259 | If a character has the property @code{inhibit-read-only}, and the | 3363 | Characters that have the property @code{inhibit-read-only} can be |
| 3260 | buffer is read-only, editing the character in question is allowed. | 3364 | edited even in read-only buffers. @xref{Read Only Buffers}. |
| 3261 | 3365 | ||
| 3262 | @item invisible | 3366 | @item invisible |
| 3263 | @kindex invisible @r{(text property)} | 3367 | @kindex invisible @r{(text property)} |
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index d9cbf473306..ffce920bf4e 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi | |||
| @@ -14,11 +14,17 @@ it gives advice on making effective use of the features described in the | |||
| 14 | previous chapters, and describes conventions Emacs Lisp programmers | 14 | previous chapters, and describes conventions Emacs Lisp programmers |
| 15 | should follow. | 15 | should follow. |
| 16 | 16 | ||
| 17 | @findex checkdoc | ||
| 18 | @findex checkdoc-current-buffer | ||
| 19 | @findex checkdoc-file | ||
| 17 | You can automatically check some of the conventions described below by | 20 | You can automatically check some of the conventions described below by |
| 18 | running the command @kbd{M-x checkdoc RET} when visiting a Lisp file. | 21 | running the command @kbd{M-x checkdoc RET} when visiting a Lisp file. |
| 19 | It cannot check all of the conventions, and not all the warnings it | 22 | It cannot check all of the conventions, and not all the warnings it |
| 20 | gives necessarily correspond to problems, but it is worth examining them | 23 | gives necessarily correspond to problems, but it is worth examining them |
| 21 | all. | 24 | all. Alternatively, use the command @kbd{M-x checkdoc-current-buffer RET} |
| 25 | to check the conventions in the current buffer, or @code{checkdoc-file} | ||
| 26 | when you want to check a file in batch mode, e.g., with a command run by | ||
| 27 | @kbd{@w{M-x compile RET}}. | ||
| 22 | 28 | ||
| 23 | @menu | 29 | @menu |
| 24 | * Coding Conventions:: Conventions for clean and robust programs. | 30 | * Coding Conventions:: Conventions for clean and robust programs. |
| @@ -1007,8 +1013,14 @@ of multiple files, we recommend not writing the version in every file, | |||
| 1007 | but only the main one. | 1013 | but only the main one. |
| 1008 | 1014 | ||
| 1009 | @item Keywords | 1015 | @item Keywords |
| 1016 | @vindex checkdoc-package-keywords-flag | ||
| 1017 | @findex checkdoc-package-keywords | ||
| 1010 | This line lists keywords for the @code{finder-by-keyword} help command. | 1018 | This line lists keywords for the @code{finder-by-keyword} help command. |
| 1011 | Please use that command to see a list of the meaningful keywords. | 1019 | Please use that command to see a list of the meaningful keywords. The |
| 1020 | command @kbd{M-x checkdoc-package-keywords RET} will find and display | ||
| 1021 | any keywords that are not in @code{finder-known-keywords}. If you set | ||
| 1022 | the variable @code{checkdoc-package-keywords-flag} non-@code{nil}, | ||
| 1023 | checkdoc commands will include the keyword verification in its checks. | ||
| 1012 | 1024 | ||
| 1013 | This field is how people will find your package when they're looking | 1025 | This field is how people will find your package when they're looking |
| 1014 | for things by topic. To separate the keywords, you can use spaces, | 1026 | for things by topic. To separate the keywords, you can use spaces, |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 357247ef433..e45201b0570 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -133,6 +133,30 @@ This function returns the selected window (which is always a live | |||
| 133 | window). | 133 | window). |
| 134 | @end defun | 134 | @end defun |
| 135 | 135 | ||
| 136 | @anchor{Window Group}Sometimes several windows collectively and | ||
| 137 | cooperatively display a buffer, for example, under the management of | ||
| 138 | Follow Mode (@pxref{Follow Mode,,, emacs}), where the windows together | ||
| 139 | display a bigger portion of the buffer than one window could alone. | ||
| 140 | It is often useful to consider such a @dfn{window group} as a single | ||
| 141 | entity. Several functions such as @code{window-group-start} | ||
| 142 | (@pxref{Window Start and End}) allow you to do this by supplying, as | ||
| 143 | an argument, one of the windows as a stand in for the whole group. | ||
| 144 | |||
| 145 | @defun selected-window-group | ||
| 146 | @vindex selected-window-group-function | ||
| 147 | When the selected window is a member of a group of windows, this | ||
| 148 | function returns a list of the windows in the group, ordered such that | ||
| 149 | the first window in the list is displaying the earliest part of the | ||
| 150 | buffer, and so on. Otherwise the function returns a list containing | ||
| 151 | just the selected window. | ||
| 152 | |||
| 153 | The selected window is considered part of a group when the buffer | ||
| 154 | local variable @code{selected-window-group-function} is set to a | ||
| 155 | function. In this case, @code{selected-window-group} calls it with no | ||
| 156 | arguments and returns its result (which should be the list of windows | ||
| 157 | in the group). | ||
| 158 | @end defun | ||
| 159 | |||
| 136 | @node Windows and Frames | 160 | @node Windows and Frames |
| 137 | @section Windows and Frames | 161 | @section Windows and Frames |
| 138 | 162 | ||
| @@ -521,9 +545,9 @@ its pixel height is the pixel height of the screen areas spanned by its | |||
| 521 | children. | 545 | children. |
| 522 | @end defun | 546 | @end defun |
| 523 | 547 | ||
| 524 | @cindex window pixel height | 548 | @cindex window pixel width |
| 525 | @cindex pixel height of a window | 549 | @cindex pixel width of a window |
| 526 | @cindex total pixel height of a window | 550 | @cindex total pixel width of a window |
| 527 | 551 | ||
| 528 | @defun window-pixel-width &optional Lisp_Object &optional window | 552 | @defun window-pixel-width &optional Lisp_Object &optional window |
| 529 | This function returns the width of window @var{window} in pixels. | 553 | This function returns the width of window @var{window} in pixels. |
| @@ -558,7 +582,6 @@ that of the root window on that frame. If @var{window} is omitted or | |||
| 558 | 582 | ||
| 559 | @cindex window body height | 583 | @cindex window body height |
| 560 | @cindex body height of a window | 584 | @cindex body height of a window |
| 561 | @cindex window body width | ||
| 562 | The @dfn{body height} of a window is the height of its text area, which | 585 | The @dfn{body height} of a window is the height of its text area, which |
| 563 | does not include a mode or header line, a horizontal scroll bar, or a | 586 | does not include a mode or header line, a horizontal scroll bar, or a |
| 564 | bottom divider. | 587 | bottom divider. |
| @@ -578,9 +601,8 @@ counted. It also means that the height of a window's body can never | |||
| 578 | exceed its total height as returned by @code{window-total-height}. | 601 | exceed its total height as returned by @code{window-total-height}. |
| 579 | @end defun | 602 | @end defun |
| 580 | 603 | ||
| 604 | @cindex window body width | ||
| 581 | @cindex body width of a window | 605 | @cindex body width of a window |
| 582 | @cindex body size of a window | ||
| 583 | @cindex window body size | ||
| 584 | The @dfn{body width} of a window is the width of its text area, which | 606 | The @dfn{body width} of a window is the width of its text area, which |
| 585 | does not include the scroll bar, fringes, margins or a right divider. | 607 | does not include the scroll bar, fringes, margins or a right divider. |
| 586 | 608 | ||
| @@ -599,6 +621,8 @@ counted. It also means that the width of a window's body can never | |||
| 599 | exceed its total width as returned by @code{window-total-width}. | 621 | exceed its total width as returned by @code{window-total-width}. |
| 600 | @end defun | 622 | @end defun |
| 601 | 623 | ||
| 624 | @cindex window body size | ||
| 625 | @cindex body size of a window | ||
| 602 | @defun window-body-size &optional window horizontal pixelwise | 626 | @defun window-body-size &optional window horizontal pixelwise |
| 603 | This function returns the body height or body width of @var{window}. If | 627 | This function returns the body height or body width of @var{window}. If |
| 604 | @var{horizontal} is omitted or @code{nil}, it is equivalent to calling | 628 | @var{horizontal} is omitted or @code{nil}, it is equivalent to calling |
| @@ -607,7 +631,7 @@ to calling @code{window-body-width}. In either case, the optional | |||
| 607 | argument @var{pixelwise} is passed to the function called. | 631 | argument @var{pixelwise} is passed to the function called. |
| 608 | @end defun | 632 | @end defun |
| 609 | 633 | ||
| 610 | For compatibility with previous versions of Emacs, | 634 | For compatibility with previous versions of Emacs, |
| 611 | @code{window-height} is an alias for @code{window-total-height}, and | 635 | @code{window-height} is an alias for @code{window-total-height}, and |
| 612 | @code{window-width} is an alias for @code{window-body-width}. These | 636 | @code{window-width} is an alias for @code{window-body-width}. These |
| 613 | aliases are considered obsolete and will be removed in the future. | 637 | aliases are considered obsolete and will be removed in the future. |
| @@ -635,6 +659,22 @@ Functions for retrieving the height and/or width of window dividers | |||
| 635 | (@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are | 659 | (@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are |
| 636 | described in the corresponding sections. | 660 | described in the corresponding sections. |
| 637 | 661 | ||
| 662 | If your Lisp program needs to make layout decisions, you will find the | ||
| 663 | following function useful: | ||
| 664 | |||
| 665 | @defun window-max-chars-per-line &optional window face | ||
| 666 | This function returns the number of characters displayed in the | ||
| 667 | specified @var{face} in the specified @var{window} (which must be a | ||
| 668 | live window). If @var{face} was remapped (@pxref{Face Remapping}), | ||
| 669 | the information is returned for the remapped face. If omitted or | ||
| 670 | @code{nil}, @var{face} defaults to the default face, and @var{window} | ||
| 671 | defaults to the selected window. Unlike @code{window-body-width}, | ||
| 672 | this function accounts for the actual size of the @var{face}'s font, | ||
| 673 | instead of working in units of frame's canonical character width. It | ||
| 674 | also accounts for space used by the continuation glyph, if | ||
| 675 | @var{window} lacks one or both of its fringes. | ||
| 676 | @end defun | ||
| 677 | |||
| 638 | @cindex fixed-size window | 678 | @cindex fixed-size window |
| 639 | @vindex window-min-height | 679 | @vindex window-min-height |
| 640 | @vindex window-min-width | 680 | @vindex window-min-width |
| @@ -643,7 +683,7 @@ or split them (@pxref{Splitting Windows}), obey the variables | |||
| 643 | @code{window-min-height} and @code{window-min-width}, which specify the | 683 | @code{window-min-height} and @code{window-min-width}, which specify the |
| 644 | smallest allowable window height and width. They also obey the variable | 684 | smallest allowable window height and width. They also obey the variable |
| 645 | @code{window-size-fixed}, with which a window can be @dfn{fixed} in | 685 | @code{window-size-fixed}, with which a window can be @dfn{fixed} in |
| 646 | size: | 686 | size (@pxref{Preserving Window Sizes}). |
| 647 | 687 | ||
| 648 | @defopt window-min-height | 688 | @defopt window-min-height |
| 649 | This option specifies the minimum total height, in lines, of any window. | 689 | This option specifies the minimum total height, in lines, of any window. |
| @@ -3082,6 +3122,17 @@ window-start position; if you move point, do not expect the window-start | |||
| 3082 | position to change in response until after the next redisplay. | 3122 | position to change in response until after the next redisplay. |
| 3083 | @end defun | 3123 | @end defun |
| 3084 | 3124 | ||
| 3125 | @defun window-group-start &optional window | ||
| 3126 | @vindex window-group-start-function | ||
| 3127 | This function is like @code{window-start}, except that when | ||
| 3128 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3129 | @code{window-group-start} returns the start position of the entire | ||
| 3130 | group. This condition holds when the buffer local variable | ||
| 3131 | @code{window-group-start-function} is set to a function. In this | ||
| 3132 | case, @code{window-group-start} calls the function with the single | ||
| 3133 | argument @var{window}, then returns its result. | ||
| 3134 | @end defun | ||
| 3135 | |||
| 3085 | @cindex window end position | 3136 | @cindex window end position |
| 3086 | @defun window-end &optional window update | 3137 | @defun window-end &optional window update |
| 3087 | This function returns the position where display of its buffer ends in | 3138 | This function returns the position where display of its buffer ends in |
| @@ -3108,6 +3159,18 @@ way real redisplay would do. It does not alter the | |||
| 3108 | text will end if scrolling is not required. | 3159 | text will end if scrolling is not required. |
| 3109 | @end defun | 3160 | @end defun |
| 3110 | 3161 | ||
| 3162 | @vindex window-group-end-function | ||
| 3163 | @defun window-group-end window update | ||
| 3164 | This function is like @code{window-end}, except that when @var{window} | ||
| 3165 | is a part of a group of windows (@pxref{Window Group}), | ||
| 3166 | @code{window-group-end} returns the end position of the entire group. | ||
| 3167 | This condition holds when the buffer local variable | ||
| 3168 | @code{window-group-end-function} is set to a function. In this case, | ||
| 3169 | @code{window-group-end} calls the function with the two arguments | ||
| 3170 | @var{window} and @var{update}, then returns its result. The argument | ||
| 3171 | @var{update} has the same meaning as in @code{window-end}. | ||
| 3172 | @end defun | ||
| 3173 | |||
| 3111 | @defun set-window-start window position &optional noforce | 3174 | @defun set-window-start window position &optional noforce |
| 3112 | This function sets the display-start position of @var{window} to | 3175 | This function sets the display-start position of @var{window} to |
| 3113 | @var{position} in @var{window}'s buffer. It returns @var{position}. | 3176 | @var{position} in @var{window}'s buffer. It returns @var{position}. |
| @@ -3171,6 +3234,19 @@ off screen at the next redisplay, then redisplay computes a new window-start | |||
| 3171 | position that works well with point, and thus @var{position} is not used. | 3234 | position that works well with point, and thus @var{position} is not used. |
| 3172 | @end defun | 3235 | @end defun |
| 3173 | 3236 | ||
| 3237 | @vindex set-window-group-start-function | ||
| 3238 | @defun set-window-group-start window position &optional noforce | ||
| 3239 | This function is like @code{set-window-start}, except that when | ||
| 3240 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3241 | @code{set-window-group-start} sets the start position of the entire | ||
| 3242 | group. This condition holds when the buffer local variable | ||
| 3243 | @code{set-window-group-start-function} is set to a function. In this | ||
| 3244 | case, @code{set-window-group-start} calls the function with the three | ||
| 3245 | arguments @var{window}, @var{position}, and @var{noforce}, then | ||
| 3246 | returns its result. The arguments @var{position} and @var{noforce} in | ||
| 3247 | this function have the same meaning as in @code{set-window-start}. | ||
| 3248 | @end defun | ||
| 3249 | |||
| 3174 | @defun pos-visible-in-window-p &optional position window partially | 3250 | @defun pos-visible-in-window-p &optional position window partially |
| 3175 | This function returns non-@code{nil} if @var{position} is within the | 3251 | This function returns non-@code{nil} if @var{position} is within the |
| 3176 | range of text currently visible on the screen in @var{window}. It | 3252 | range of text currently visible on the screen in @var{window}. It |
| @@ -3212,6 +3288,21 @@ Here is an example: | |||
| 3212 | @end example | 3288 | @end example |
| 3213 | @end defun | 3289 | @end defun |
| 3214 | 3290 | ||
| 3291 | @vindex pos-visible-in-window-group-p-function | ||
| 3292 | @defun pos-visible-in-window-group-p &optional position window partially | ||
| 3293 | This function is like @code{pos-visible-in-window-p}, except that when | ||
| 3294 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3295 | @code{pos-visible-in-window-group-p} tests the visibility of @var{pos} | ||
| 3296 | in the entire group, not just in the single @var{window}. This | ||
| 3297 | condition holds when the buffer local variable | ||
| 3298 | @code{pos-visible-in-window-group-p-function} is set to a function. | ||
| 3299 | In this case @code{pos-visible-in-window-group-p} calls the function | ||
| 3300 | with the three arguments @var{position}, @var{window}, and | ||
| 3301 | @var{partially}, then returns its result. The arguments | ||
| 3302 | @var{position} and @var{partially} have the same meaning as in | ||
| 3303 | @code{pos-visible-in-window-p}. | ||
| 3304 | @end defun | ||
| 3305 | |||
| 3215 | @defun window-line-height &optional line window | 3306 | @defun window-line-height &optional line window |
| 3216 | This function returns the height of text line @var{line} in | 3307 | This function returns the height of text line @var{line} in |
| 3217 | @var{window}. If @var{line} is one of @code{header-line} or | 3308 | @var{window}. If @var{line} is one of @code{header-line} or |
| @@ -3455,6 +3546,19 @@ the top of the window. The command @code{recenter-top-bottom} offers | |||
| 3455 | a more convenient way to achieve this. | 3546 | a more convenient way to achieve this. |
| 3456 | @end deffn | 3547 | @end deffn |
| 3457 | 3548 | ||
| 3549 | @vindex recenter-window-group-function | ||
| 3550 | @defun recenter-window-group &optional count | ||
| 3551 | This function is like @code{recenter}, except that when the selected | ||
| 3552 | window is part of a group of windows (@pxref{Window Group}), | ||
| 3553 | @code{recenter-window-group} scrolls the entire group. This condition | ||
| 3554 | holds when the buffer local variable | ||
| 3555 | @code{recenter-window-group-function} is set to a function. In this | ||
| 3556 | case, @code{recenter-window-group} calls the function with the | ||
| 3557 | argument @var{count}, then returns its result. The argument | ||
| 3558 | @var{count} has the same meaning as in @code{recenter}, but with | ||
| 3559 | respect to the entire window group. | ||
| 3560 | @end defun | ||
| 3561 | |||
| 3458 | @defopt recenter-redisplay | 3562 | @defopt recenter-redisplay |
| 3459 | If this variable is non-@code{nil}, calling @code{recenter} with a | 3563 | If this variable is non-@code{nil}, calling @code{recenter} with a |
| 3460 | @code{nil} argument redraws the frame. The default value is | 3564 | @code{nil} argument redraws the frame. The default value is |
| @@ -4264,10 +4368,10 @@ work. | |||
| 4264 | @end defvar | 4368 | @end defvar |
| 4265 | 4369 | ||
| 4266 | @defvar window-size-change-functions | 4370 | @defvar window-size-change-functions |
| 4267 | This variable holds a list of functions to be called if the size of any | 4371 | This variable holds a list of functions to be called if the size of |
| 4268 | window changes for any reason. The functions are called just once per | 4372 | any window changes for any reason. The functions are called at the |
| 4269 | redisplay, and just once for each frame on which size changes have | 4373 | beginning of a redisplay cycle, and just once for each frame on which |
| 4270 | occurred. | 4374 | size changes have occurred. |
| 4271 | 4375 | ||
| 4272 | Each function receives the frame as its sole argument. There is no | 4376 | Each function receives the frame as its sole argument. There is no |
| 4273 | direct way to find out which windows on that frame have changed size, or | 4377 | direct way to find out which windows on that frame have changed size, or |