diff options
| author | Eli Zaretskii | 2024-11-30 06:44:06 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2024-11-30 06:44:06 -0500 |
| commit | 88f6b045f482d5d842eaed1d7e949e488e8cedd1 (patch) | |
| tree | b816c883b0ed01d9f1e6828c869a85c0b27013d6 /doc | |
| parent | 82bdb3bfd035577a43afdf1eafd18ee1a60a987c (diff) | |
| parent | afb34a3b2393decb50e250ed8caa559b64020379 (diff) | |
| download | emacs-88f6b045f482d5d842eaed1d7e949e488e8cedd1.tar.gz emacs-88f6b045f482d5d842eaed1d7e949e488e8cedd1.zip | |
Merge from origin/emacs-30
afb34a3b239 ; Improve documentation of ':box' face attribute
b38eb6da1d1 Fix docstring of c-ts-mode-indent-style
9fdb764898d Support PHP 8.4 and more reliable indentation (bug#74525)
bda0bce9e43 Don't inadvertently reset frame scroll bar sizes (Bug#74435)
3f99cdaf26d Mention special variables in lexical binding documentation
0ef0f18f163 Allow to go back to using 'ruby-mode' after loading 'ruby...
fc17e8727d4 Delete obsolete section in admin/notes/repo
3e396b2c5bb Improve documentation for 'while-let'
50b91ed458d Remove mention of treesit-defun-prefer-top-level (bug#74474)
03ae07291e8 Fix NS non-native fullscreen on initial frame load (bug#5...
8261d7224d3 Fix user options for listing and marking diary files
# Conflicts:
# lisp/progmodes/c-ts-mode.el
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/control.texi | 64 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 8 |
3 files changed, 65 insertions, 13 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 80ed2ce899b..27ce932433d 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -322,25 +322,46 @@ There's a number of variations on this theme, and they're briefly | |||
| 322 | described below. | 322 | described below. |
| 323 | 323 | ||
| 324 | @defmac if-let* varlist then-form else-forms... | 324 | @defmac if-let* varlist then-form else-forms... |
| 325 | Evaluate each binding in @var{varlist} in turn, like in @code{let*} | 325 | Evaluate each binding in @var{varlist}, stopping if a binding value is |
| 326 | (@pxref{Local Variables}), stopping if a binding value is @code{nil}. | 326 | @code{nil}. If all are non-@code{nil}, return the value of |
| 327 | If all are non-@code{nil}, return the value of @var{then-form}, | 327 | @var{then-form}, otherwise the last form in @var{else-forms}. |
| 328 | otherwise the last form in @var{else-forms}. | 328 | |
| 329 | Each element of @code{varlist} has the form @w{@code{(@var{symbol} | ||
| 330 | @var{value-form})}}: @var{value-form} is evaluated and @var{symbol} is | ||
| 331 | locally bound to the result. Bindings are sequential, as in @code{let*} | ||
| 332 | (@pxref{Local Variables}). As a special case, @var{symbol} can be | ||
| 333 | omitted if only the test result of @var{value-form} is of interest: | ||
| 334 | @var{value-form} is evaluated and checked for @code{nil}, but its value | ||
| 335 | is not bound. | ||
| 329 | @end defmac | 336 | @end defmac |
| 330 | 337 | ||
| 331 | @defmac when-let* varlist then-forms... | 338 | @defmac when-let* varlist then-forms... |
| 332 | Like @code{if-let*}, but without @var{else-forms}. | 339 | Evaluate each binding in @var{varlist}, stopping if a binding value is |
| 340 | @code{nil}. If all are non-@code{nil}, return the value of the last | ||
| 341 | form in @var{then-forms}. | ||
| 342 | |||
| 343 | @var{varlist} has the same form as in @code{if-let*}: Each element of | ||
| 344 | @code{varlist} has the form @w{@code{(@var{symbol} @var{value-form})}}, | ||
| 345 | in which @var{value-form} is evaluated and @var{symbol} is locally bound | ||
| 346 | to the result. Bindings are sequential, as in @code{let*} (@pxref{Local | ||
| 347 | Variables}). As a special case, @var{symbol} can be omitted if only the | ||
| 348 | test result of @var{value-form} is of interest: @var{value-form} is | ||
| 349 | evaluated and checked for @code{nil}, but its value is not bound. | ||
| 333 | @end defmac | 350 | @end defmac |
| 334 | 351 | ||
| 335 | @defmac and-let* varlist then-forms... | 352 | @defmac and-let* varlist then-forms... |
| 336 | Like @code{when-let*}, but in addition, if there are no | 353 | Evaluate each binding in @var{varlist}, stopping if a binding value is |
| 337 | @var{then-forms} and all the bindings evaluate to non-@code{nil}, return | 354 | @code{nil}. If all are non-@code{nil}, return the value of the last |
| 355 | form in @var{then-forms}, or, if there are no @var{then-forms}, return | ||
| 338 | the value of the last binding. | 356 | the value of the last binding. |
| 339 | @end defmac | ||
| 340 | 357 | ||
| 341 | @defmac while-let spec then-forms... | 358 | @var{varlist} has the same form as in @code{if-let*}: Each element of |
| 342 | Like @code{when-let*}, but repeat until a binding in @var{spec} is | 359 | @code{varlist} has the form @w{@code{(@var{symbol} @var{value-form})}}, |
| 343 | @code{nil}. The return value is always @code{nil}. | 360 | in which @var{value-form} is evaluated and @var{symbol} is locally bound |
| 361 | to the result. Bindings are sequential, as in @code{let*} (@pxref{Local | ||
| 362 | Variables}). As a special case, @var{symbol} can be omitted if only the | ||
| 363 | test result of @var{value-form} is of interest: @var{value-form} is | ||
| 364 | evaluated and checked for @code{nil}, but its value is not bound. | ||
| 344 | @end defmac | 365 | @end defmac |
| 345 | 366 | ||
| 346 | Some Lisp programmers follow the convention that @code{and} and | 367 | Some Lisp programmers follow the convention that @code{and} and |
| @@ -348,6 +369,27 @@ Some Lisp programmers follow the convention that @code{and} and | |||
| 348 | @code{when} and @code{when-let*} are for forms evaluated for side-effect | 369 | @code{when} and @code{when-let*} are for forms evaluated for side-effect |
| 349 | with returned values ignored. | 370 | with returned values ignored. |
| 350 | 371 | ||
| 372 | A similar macro exists to run a loop until one binding evaluates to | ||
| 373 | @code{nil}: | ||
| 374 | |||
| 375 | @defmac while-let spec then-forms... | ||
| 376 | Evaluate each binding in @var{spec} in turn, stopping if a binding value | ||
| 377 | is @code{nil}. If all are non-@code{nil}, execute @var{then-forms}, | ||
| 378 | then repeat the loop. Note that when the loop is repeated, the | ||
| 379 | @var{value-forms} in @var{spec} are re-evaluated and the bindings are | ||
| 380 | established anew. | ||
| 381 | |||
| 382 | @var{varlist} has the same form as in @code{if-let*}: Each element of | ||
| 383 | @code{varlist} has the form @w{@code{(@var{symbol} @var{value-form})}}, | ||
| 384 | in which @var{value-form} is evaluated and @var{symbol} is locally bound | ||
| 385 | to the result. Bindings are sequential, as in @code{let*} (@pxref{Local | ||
| 386 | Variables}). As a special case, @var{symbol} can be omitted if only the | ||
| 387 | test result of @var{value-form} is of interest: @var{value-form} is | ||
| 388 | evaluated and checked for @code{nil}, but its value is not bound. | ||
| 389 | |||
| 390 | The return value of @code{while-let} is always @code{nil}. | ||
| 391 | @end defmac | ||
| 392 | |||
| 351 | @node Combining Conditions | 393 | @node Combining Conditions |
| 352 | @section Constructs for Combining Conditions | 394 | @section Constructs for Combining Conditions |
| 353 | @cindex combining conditions | 395 | @cindex combining conditions |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 7ada57d3d9c..a7c5ae561be 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -2805,7 +2805,11 @@ being pressed. If it is @code{pressed-button}, the box looks like a | |||
| 2805 | If you use the @code{:box} face attribute on strings displayed instead | 2805 | If you use the @code{:box} face attribute on strings displayed instead |
| 2806 | of buffer text via the @code{display} text property, special | 2806 | of buffer text via the @code{display} text property, special |
| 2807 | considerations might apply if the surrounding buffer text also has the | 2807 | considerations might apply if the surrounding buffer text also has the |
| 2808 | @code{:box} face attribute. @xref{Replacing Specs}. | 2808 | @code{:box} face attribute. @xref{Replacing Specs}. Also note that the |
| 2809 | vertical lines of the box are only drawn when @code{:box} attribute | ||
| 2810 | changes from @code{nil} to non-@code{nil} or vice versa; two consecutive | ||
| 2811 | face properties with a non-@code{nil} @code{:box} attribute will be | ||
| 2812 | displayed without the vertical line between them. | ||
| 2809 | 2813 | ||
| 2810 | @item :inverse-video | 2814 | @item :inverse-video |
| 2811 | Whether or not characters should be displayed in inverse video. The | 2815 | Whether or not characters should be displayed in inverse video. The |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index af11e498d86..0e9124920d1 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1096,7 +1096,7 @@ x ; @r{Note that @code{x} has no global value.} | |||
| 1096 | @end example | 1096 | @end example |
| 1097 | 1097 | ||
| 1098 | @noindent | 1098 | @noindent |
| 1099 | The @code{let} binding defines a lexical environment in which the | 1099 | Here, the @code{let} binding defines a lexical environment in which the |
| 1100 | variable @code{x} is locally bound to 0. Within this binding | 1100 | variable @code{x} is locally bound to 0. Within this binding |
| 1101 | construct, we define a lambda expression which increments @code{x} by | 1101 | construct, we define a lambda expression which increments @code{x} by |
| 1102 | one and returns the incremented value. This lambda expression is | 1102 | one and returns the incremented value. This lambda expression is |
| @@ -1113,6 +1113,12 @@ functions which take a symbol argument (like @code{symbol-value}, | |||
| 1113 | variable's dynamic binding (i.e., the contents of its symbol's value | 1113 | variable's dynamic binding (i.e., the contents of its symbol's value |
| 1114 | cell). | 1114 | cell). |
| 1115 | 1115 | ||
| 1116 | Note also that variables may be declared special, in which case they | ||
| 1117 | will use dynamic binding, even for new bindings such as a @code{let} | ||
| 1118 | binding. Depending on how the variable is declared, it can be | ||
| 1119 | special globally, for a single file, or for a portion of a file. | ||
| 1120 | @xref{Dynamic Binding} for details. | ||
| 1121 | |||
| 1116 | @node Dynamic Binding | 1122 | @node Dynamic Binding |
| 1117 | @subsection Dynamic Binding | 1123 | @subsection Dynamic Binding |
| 1118 | 1124 | ||