diff options
| author | Glenn Morris | 2018-03-22 07:50:37 -0700 |
|---|---|---|
| committer | Glenn Morris | 2018-03-22 07:50:37 -0700 |
| commit | 0afb436eeb9b87dbd13b012e3b13d51fc6745f0d (patch) | |
| tree | 683cf853c6bc6065a5f5a3d9ae81feda1882da95 /doc/lispref | |
| parent | 081c39beb0340f5d6084dc90796ba726a52c928e (diff) | |
| parent | 8ac621bb5594786c66cc724864e6037c8c650774 (diff) | |
| download | emacs-0afb436eeb9b87dbd13b012e3b13d51fc6745f0d.tar.gz emacs-0afb436eeb9b87dbd13b012e3b13d51fc6745f0d.zip | |
Merge from origin/emacs-26
8ac621b (origin/emacs-26) Document DEFUN attributes
16d0cc7 * etc/NEWS: Add an entry for auth-source-pass.
cc1702f Fix the MSDOS build
daa9e85 Improve warning and error messages
7612dd1 Adjust eieio persistence tests for expected failure
f0cf4dc Let eieio-persistent-read read what object-write has written
40ad1ff Handle possible classtype values in eieio-persistent-read
4ec935d Add new tests for eieio persistence
47917d8 * lisp/gnus/gnus-cloud.el (gnus-cloud-synced-files): Fix doc ...
e32f352 * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix t...
5268f30 * doc/lispref/windows.texi (Selecting Windows): Fix a typo.
143b485 * doc/lispref/internals.texi (Writing Emacs Primitives): Fix ...
4ab4551 Firm up documentation of generalized variables
a5bf099 Improve documentation of Auto-Revert mode
ed05eaa Improvements in dired.texi
Conflicts:
etc/NEWS
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/internals.texi | 41 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 34 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 2 |
3 files changed, 58 insertions, 19 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 76be7bf0ac6..7ae5b5c693d 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -735,7 +735,7 @@ Lisp form. For example: | |||
| 735 | 735 | ||
| 736 | @example | 736 | @example |
| 737 | @group | 737 | @group |
| 738 | DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, | 738 | DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, 0 |
| 739 | "(list (read-char-by-name \"Insert character: \")\ | 739 | "(list (read-char-by-name \"Insert character: \")\ |
| 740 | (prefix-numeric-value current-prefix-arg)\ | 740 | (prefix-numeric-value current-prefix-arg)\ |
| 741 | t))", | 741 | t))", |
| @@ -768,6 +768,43 @@ the actual documentation. The others have placeholders beginning with | |||
| 768 | All the usual rules for documentation strings in Lisp code | 768 | All the usual rules for documentation strings in Lisp code |
| 769 | (@pxref{Documentation Tips}) apply to C code documentation strings | 769 | (@pxref{Documentation Tips}) apply to C code documentation strings |
| 770 | too. | 770 | too. |
| 771 | |||
| 772 | The documentation string can be followed by a list of C function | ||
| 773 | attributes for the C function that implements the primitive, like | ||
| 774 | this: | ||
| 775 | |||
| 776 | @example | ||
| 777 | @group | ||
| 778 | DEFUN ("bar", Fbar, Sbar, 0, UNEVALLED, 0 | ||
| 779 | doc: /* @dots{} /* | ||
| 780 | attributes: @var{attr1} @var{attr2} @dots{}) | ||
| 781 | @end group | ||
| 782 | @end example | ||
| 783 | |||
| 784 | @noindent | ||
| 785 | You can specify more than a single attribute, one after the other. | ||
| 786 | Currently, only the following attributes are recognized: | ||
| 787 | |||
| 788 | @table @code | ||
| 789 | @item noreturn | ||
| 790 | Declares the C function as one that never returns. This corresponds | ||
| 791 | to the C11 keyword @code{_Noreturn} and to @w{@code{__attribute__ | ||
| 792 | ((__noreturn__))}} attribute of GCC (@pxref{Function Attributes,,, | ||
| 793 | gcc, Using the GNU Compiler Collection}). | ||
| 794 | |||
| 795 | @item const | ||
| 796 | Declares that the function does not examine any values except its | ||
| 797 | arguments, and has no effects except the return value. This | ||
| 798 | corresponds to @w{@code{__attribute__ ((__const__))}} attribute of | ||
| 799 | GCC. | ||
| 800 | |||
| 801 | @item noinline | ||
| 802 | This corresponds to @w{@code{__attribute__ ((__noinline__))}} | ||
| 803 | attribute of GCC, which prevents the function from being considered | ||
| 804 | for inlining. This might be needed, e.g., to countermand effects of | ||
| 805 | link-time optimizations on stack-based variables. | ||
| 806 | @end table | ||
| 807 | |||
| 771 | @end table | 808 | @end table |
| 772 | 809 | ||
| 773 | After the call to the @code{DEFUN} macro, you must write the | 810 | After the call to the @code{DEFUN} macro, you must write the |
| @@ -850,7 +887,7 @@ defined with @code{DEFVAR_BOOL} are automatically added to the list | |||
| 850 | @code{byte-boolean-vars} used by the byte compiler. | 887 | @code{byte-boolean-vars} used by the byte compiler. |
| 851 | 888 | ||
| 852 | @cindex defining customization variables in C | 889 | @cindex defining customization variables in C |
| 853 | If you want to make a Lisp variables that is defined in C behave | 890 | If you want to make a Lisp variable that is defined in C behave |
| 854 | like one declared with @code{defcustom}, add an appropriate entry to | 891 | like one declared with @code{defcustom}, add an appropriate entry to |
| 855 | @file{cus-start.el}. | 892 | @file{cus-start.el}. |
| 856 | 893 | ||
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index aecee6f3056..b80bc88a585 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -2317,11 +2317,12 @@ Attempting to assign them any other value will result in an error: | |||
| 2317 | 2317 | ||
| 2318 | @cindex generalized variable | 2318 | @cindex generalized variable |
| 2319 | @cindex place form | 2319 | @cindex place form |
| 2320 | A @dfn{generalized variable} or @dfn{place form} is one of the many places | 2320 | A @dfn{generalized variable} or @dfn{place form} is one of the many |
| 2321 | in Lisp memory where values can be stored. The simplest place form is | 2321 | places in Lisp memory where values can be stored using the @code{setf} |
| 2322 | a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of lists, elements | 2322 | macro (@pxref{Setting Generalized Variables}). The simplest place |
| 2323 | of arrays, properties of symbols, and many other locations are also | 2323 | form is a regular Lisp variable. But the @sc{car}s and @sc{cdr}s of |
| 2324 | places where Lisp values are stored. | 2324 | lists, elements of arrays, properties of symbols, and many other |
| 2325 | locations are also places where Lisp values get stored. | ||
| 2325 | 2326 | ||
| 2326 | Generalized variables are analogous to lvalues in the C | 2327 | Generalized variables are analogous to lvalues in the C |
| 2327 | language, where @samp{x = a[i]} gets an element from an array | 2328 | language, where @samp{x = a[i]} gets an element from an array |
| @@ -2342,8 +2343,8 @@ variables. The @code{setf} form is like @code{setq}, except that it | |||
| 2342 | accepts arbitrary place forms on the left side rather than just | 2343 | accepts arbitrary place forms on the left side rather than just |
| 2343 | symbols. For example, @code{(setf (car a) b)} sets the car of | 2344 | symbols. For example, @code{(setf (car a) b)} sets the car of |
| 2344 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, | 2345 | @code{a} to @code{b}, doing the same operation as @code{(setcar a b)}, |
| 2345 | but without having to remember two separate functions for setting and | 2346 | but without you having to use two separate functions for setting and |
| 2346 | accessing every type of place. | 2347 | accessing this type of place. |
| 2347 | 2348 | ||
| 2348 | @defmac setf [place form]@dots{} | 2349 | @defmac setf [place form]@dots{} |
| 2349 | This macro evaluates @var{form} and stores it in @var{place}, which | 2350 | This macro evaluates @var{form} and stores it in @var{place}, which |
| @@ -2353,18 +2354,19 @@ just as with @code{setq}. @code{setf} returns the value of the last | |||
| 2353 | @var{form}. | 2354 | @var{form}. |
| 2354 | @end defmac | 2355 | @end defmac |
| 2355 | 2356 | ||
| 2356 | The following Lisp forms will work as generalized variables, and | 2357 | The following Lisp forms are the forms in Emacs that will work as |
| 2357 | so may appear in the @var{place} argument of @code{setf}: | 2358 | generalized variables, and so may appear in the @var{place} argument |
| 2359 | of @code{setf}: | ||
| 2358 | 2360 | ||
| 2359 | @itemize | 2361 | @itemize |
| 2360 | @item | 2362 | @item |
| 2361 | A symbol naming a variable. In other words, @code{(setf x y)} is | 2363 | A symbol. In other words, @code{(setf x y)} is exactly equivalent to |
| 2362 | exactly equivalent to @code{(setq x y)}, and @code{setq} itself is | 2364 | @code{(setq x y)}, and @code{setq} itself is strictly speaking |
| 2363 | strictly speaking redundant given that @code{setf} exists. Many | 2365 | redundant given that @code{setf} exists. Most programmers will |
| 2364 | programmers continue to prefer @code{setq} for setting simple | 2366 | continue to prefer @code{setq} for setting simple variables, though, |
| 2365 | variables, though, purely for stylistic or historical reasons. | 2367 | for stylistic and historical reasons. The macro @code{(setf x y)} |
| 2366 | The macro @code{(setf x y)} actually expands to @code{(setq x y)}, | 2368 | actually expands to @code{(setq x y)}, so there is no performance |
| 2367 | so there is no performance penalty for using it in compiled code. | 2369 | penalty for using it in compiled code. |
| 2368 | 2370 | ||
| 2369 | @item | 2371 | @item |
| 2370 | A call to any of the following standard Lisp functions: | 2372 | A call to any of the following standard Lisp functions: |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 75651b99fde..8d8877bdfda 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -1772,7 +1772,7 @@ raise the frame or make sure input focus is directed to that frame. | |||
| 1772 | @end defun | 1772 | @end defun |
| 1773 | 1773 | ||
| 1774 | @cindex select window hook | 1774 | @cindex select window hook |
| 1775 | @cindex running a hook when a windows gets selected | 1775 | @cindex running a hook when a window gets selected |
| 1776 | For historical reasons, Emacs does not run a separate hook whenever a | 1776 | For historical reasons, Emacs does not run a separate hook whenever a |
| 1777 | window gets selected. Applications and internal routines often | 1777 | window gets selected. Applications and internal routines often |
| 1778 | temporarily select a window to perform a few actions on it. They do | 1778 | temporarily select a window to perform a few actions on it. They do |