aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2024-11-30 06:44:06 -0500
committerEli Zaretskii2024-11-30 06:44:06 -0500
commit88f6b045f482d5d842eaed1d7e949e488e8cedd1 (patch)
treeb816c883b0ed01d9f1e6828c869a85c0b27013d6 /doc
parent82bdb3bfd035577a43afdf1eafd18ee1a60a987c (diff)
parentafb34a3b2393decb50e250ed8caa559b64020379 (diff)
downloademacs-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.texi64
-rw-r--r--doc/lispref/display.texi6
-rw-r--r--doc/lispref/variables.texi8
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
322described below. 322described below.
323 323
324@defmac if-let* varlist then-form else-forms... 324@defmac if-let* varlist then-form else-forms...
325Evaluate each binding in @var{varlist} in turn, like in @code{let*} 325Evaluate 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
327If all are non-@code{nil}, return the value of @var{then-form}, 327@var{then-form}, otherwise the last form in @var{else-forms}.
328otherwise the last form in @var{else-forms}. 328
329Each element of @code{varlist} has the form @w{@code{(@var{symbol}
330@var{value-form})}}: @var{value-form} is evaluated and @var{symbol} is
331locally bound to the result. Bindings are sequential, as in @code{let*}
332(@pxref{Local Variables}). As a special case, @var{symbol} can be
333omitted 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
335is not bound.
329@end defmac 336@end defmac
330 337
331@defmac when-let* varlist then-forms... 338@defmac when-let* varlist then-forms...
332Like @code{if-let*}, but without @var{else-forms}. 339Evaluate 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
341form 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})}},
345in which @var{value-form} is evaluated and @var{symbol} is locally bound
346to the result. Bindings are sequential, as in @code{let*} (@pxref{Local
347Variables}). As a special case, @var{symbol} can be omitted if only the
348test result of @var{value-form} is of interest: @var{value-form} is
349evaluated 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...
336Like @code{when-let*}, but in addition, if there are no 353Evaluate 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
355form in @var{then-forms}, or, if there are no @var{then-forms}, return
338the value of the last binding. 356the 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
342Like @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}. 360in which @var{value-form} is evaluated and @var{symbol} is locally bound
361to the result. Bindings are sequential, as in @code{let*} (@pxref{Local
362Variables}). As a special case, @var{symbol} can be omitted if only the
363test result of @var{value-form} is of interest: @var{value-form} is
364evaluated and checked for @code{nil}, but its value is not bound.
344@end defmac 365@end defmac
345 366
346Some Lisp programmers follow the convention that @code{and} and 367Some 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
349with returned values ignored. 370with returned values ignored.
350 371
372A similar macro exists to run a loop until one binding evaluates to
373@code{nil}:
374
375@defmac while-let spec then-forms...
376Evaluate each binding in @var{spec} in turn, stopping if a binding value
377is @code{nil}. If all are non-@code{nil}, execute @var{then-forms},
378then 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
380established 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})}},
384in which @var{value-form} is evaluated and @var{symbol} is locally bound
385to the result. Bindings are sequential, as in @code{let*} (@pxref{Local
386Variables}). As a special case, @var{symbol} can be omitted if only the
387test result of @var{value-form} is of interest: @var{value-form} is
388evaluated and checked for @code{nil}, but its value is not bound.
389
390The 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
2805If you use the @code{:box} face attribute on strings displayed instead 2805If you use the @code{:box} face attribute on strings displayed instead
2806of buffer text via the @code{display} text property, special 2806of buffer text via the @code{display} text property, special
2807considerations might apply if the surrounding buffer text also has the 2807considerations 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
2809vertical lines of the box are only drawn when @code{:box} attribute
2810changes from @code{nil} to non-@code{nil} or vice versa; two consecutive
2811face properties with a non-@code{nil} @code{:box} attribute will be
2812displayed without the vertical line between them.
2809 2813
2810@item :inverse-video 2814@item :inverse-video
2811Whether or not characters should be displayed in inverse video. The 2815Whether 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
1099The @code{let} binding defines a lexical environment in which the 1099Here, the @code{let} binding defines a lexical environment in which the
1100variable @code{x} is locally bound to 0. Within this binding 1100variable @code{x} is locally bound to 0. Within this binding
1101construct, we define a lambda expression which increments @code{x} by 1101construct, we define a lambda expression which increments @code{x} by
1102one and returns the incremented value. This lambda expression is 1102one and returns the incremented value. This lambda expression is
@@ -1113,6 +1113,12 @@ functions which take a symbol argument (like @code{symbol-value},
1113variable's dynamic binding (i.e., the contents of its symbol's value 1113variable's dynamic binding (i.e., the contents of its symbol's value
1114cell). 1114cell).
1115 1115
1116 Note also that variables may be declared special, in which case they
1117will use dynamic binding, even for new bindings such as a @code{let}
1118binding. Depending on how the variable is declared, it can be
1119special 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