]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change
authorEli Zaretskii <eliz@gnu.org>
Thu, 2 May 2024 16:30:40 +0000 (19:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:35:00 +0000 (18:35 +0200)
* etc/NEWS: Fix wording of a recently-added item.

* doc/lispref/functions.texi (Declare Form): Fix markup.

(cherry picked from commit 12e3ffcc97af739f0134959ce4a5ff2f23ffa971)

doc/lispref/functions.texi
etc/NEWS

index d88f5d05339a1f026a82f186b05825c7e18315d0..a77bf6e233d1535a9d839589d6c6f223eb9892bc 100644 (file)
@@ -2725,22 +2725,22 @@ Here's an example of using @code{type} inside @code{declare} to declare
 a function @code{positive-p} that takes an argument of type @var{number}
 and return a @var{boolean}:
 
-@group
 @lisp
+@group
 (defun positive-p (x)
   (declare (type (function (number) boolean)))
   (when (> x 0)
     t))
-@end lisp
 @end group
+@end lisp
 
 Similarly this declares a function @code{cons-or-number} that: expects a
 first argument being a @var{cons} or a @var{number}, a second optional
 argument of type @var{string} and return one of the symbols
 @code{is-cons} or @code{is-number}:
 
-@group
 @lisp
+@group
 (defun cons-or-number (x &optional err-msg)
   (declare (type (function ((or cons number) &optional string)
                           (member is-cons is-number))))
@@ -2749,11 +2749,10 @@ argument of type @var{string} and return one of the symbols
     (if (numberp x)
        'is-number
       (error (or err-msg "Unexpected input")))))
-@end lisp
 @end group
+@end lisp
 
-More types are described in the Lisp Data Types chapter (@ref{Lisp Data
-Types}).
+For description of additional types, see @ref{Lisp Data Types}).
 
 Declaring a function with an incorrect type produces undefined behavior
 and could lead to unexpected results or might even crash Emacs when code
index 86018801c81b0b02b402aaca03e2d1181868ce2e..73e88f33b7a9c80fb099bd904531743875f30c33 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2078,9 +2078,9 @@ preferable to use the existing 'undo-inhibit-region' symbol property
 instead of this variable.
 
 +++
-** Function type declaration
-It is now possible, using the 'declare' macro, to declare expected types
-of function arguments and return type.
+** Function type declaration.
+It is now possible to declare the expected type of a function's
+arguments and its return type using the 'declare' macro.
 
 ** New types 'closure' and 'interpreted-function'.
 'interpreted-function' is the new type used for interpreted functions,