diff options
| author | Eli Zaretskii | 2024-05-14 08:51:13 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-05-14 08:51:13 +0300 |
| commit | f6d060b39a02da14aa1763bb688cb2e048f0c666 (patch) | |
| tree | 141bca5435b56a367036f4745a4e983e400c704f | |
| parent | fff245c52931fc829877ae379e48b373c15a1dcb (diff) | |
| download | emacs-f6d060b39a02da14aa1763bb688cb2e048f0c666.tar.gz emacs-f6d060b39a02da14aa1763bb688cb2e048f0c666.zip | |
; Fix documentation of recently-installed changes
* lisp/emacs-lisp/bytecomp.el (compilation-safety): Doc fix.
* etc/NEWS: Fix wording of the 'compilation-safety' entry.
* doc/lispref/functions.texi (Declare Form): Fix cross-reference
and wording.
* doc/lispref/compile.texi (Native-Compilation Variables): Add the
missing @anchor. Fix wording.
| -rw-r--r-- | doc/lispref/compile.texi | 18 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 9 | ||||
| -rw-r--r-- | etc/NEWS | 8 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 11 |
4 files changed, 27 insertions, 19 deletions
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index f8f1242586e..9f93fb4a981 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi | |||
| @@ -987,21 +987,23 @@ form, @pxref{Declare Form}.) | |||
| 987 | The default value is 2. | 987 | The default value is 2. |
| 988 | @end defopt | 988 | @end defopt |
| 989 | 989 | ||
| 990 | @anchor{compilation-safety} | ||
| 990 | @defopt compilation-safety | 991 | @defopt compilation-safety |
| 991 | This variable specifies the safetyness level used for the code emitted | 992 | This variable specifies the safety level to be used for the emitted |
| 992 | native code. The value of compilation-safety should be a number between | 993 | native code. The value should be a number, either 0 or 1 with the |
| 993 | zero and one with the following meaning: | 994 | following meanings: |
| 994 | 995 | ||
| 995 | @table @asis | 996 | @table @asis |
| 996 | @item 0 | 997 | @item 0 |
| 997 | Emitted code can misbehave or crash Emacs if function declarations are | 998 | Emitted code can misbehave (up to even crashing Emacs) if a function's |
| 998 | not correct and the function is native compiled. | 999 | declaration does not describe correctly what the function does or how it |
| 1000 | is called, and the function is natively compiled. | ||
| 999 | @item 1 | 1001 | @item 1 |
| 1000 | Emitted code is generated in a safe matter even if function are | 1002 | Emitted code must be generated in a safe manner even if functions are |
| 1001 | miss-declared." | 1003 | mis-declared. |
| 1002 | @end table | 1004 | @end table |
| 1003 | 1005 | ||
| 1004 | This can be controlled at function granularity as well by using the | 1006 | This can also be controlled at a function granularity, by using the |
| 1005 | @code{safety} @code{declare} form, @pxref{Declare Form}. | 1007 | @code{safety} @code{declare} form, @pxref{Declare Form}. |
| 1006 | @end defopt | 1008 | @end defopt |
| 1007 | 1009 | ||
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 9d4ecd8da25..deca99960c7 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -2761,10 +2761,11 @@ argument of type @var{string} and return one of the symbols | |||
| 2761 | For description of additional types, see @ref{Lisp Data Types}). | 2761 | For description of additional types, see @ref{Lisp Data Types}). |
| 2762 | 2762 | ||
| 2763 | Declaring a function with an incorrect type produces undefined behavior | 2763 | Declaring a function with an incorrect type produces undefined behavior |
| 2764 | and could lead to unexpected results or might even crash Emacs when code | 2764 | and could lead to unexpected results or might even crash Emacs when |
| 2765 | is native-compiled and loaded if compiled with @ref{compilation-safety} | 2765 | natively-compiled code is loaded, if it was compiled with |
| 2766 | 0. Note also that when redefining (or advising) a type declared | 2766 | @code{compilation-safety} level of zero (@pxref{compilation-safety}). |
| 2767 | function the replacement should respect the original signature to avoid | 2767 | Note also that when redefining (or advising) a type-declared function, |
| 2768 | the replacement should respect the original signature to avoid such | ||
| 2768 | undefined behavior. | 2769 | undefined behavior. |
| 2769 | 2770 | ||
| 2770 | @item no-font-lock-keyword | 2771 | @item no-font-lock-keyword |
| @@ -1986,9 +1986,11 @@ unibyte string. | |||
| 1986 | 1986 | ||
| 1987 | * Lisp Changes in Emacs 30.1 | 1987 | * Lisp Changes in Emacs 30.1 |
| 1988 | +++ | 1988 | +++ |
| 1989 | ** New 'compilation-safety' compilation parameter. | 1989 | ** New user option 'compilation-safety' to control safety of native code. |
| 1990 | It's now possible to use the safety parameter to control how safe is | 1990 | It's now possible to control how safe is the code generated by native |
| 1991 | code generated by the native compiler. | 1991 | compilation, by customizing this user option. It is also possible to |
| 1992 | control this at function granularity by using the new 'safety' parameter | ||
| 1993 | in the function's 'declare' form. | ||
| 1992 | 1994 | ||
| 1993 | ** New types 'closure' and 'interpreted-function'. | 1995 | ** New types 'closure' and 'interpreted-function'. |
| 1994 | 'interpreted-function' is the new type used for interpreted functions, | 1996 | 'interpreted-function' is the new type used for interpreted functions, |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 3e7674eeef6..12b45f9f5b8 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -138,11 +138,14 @@ | |||
| 138 | :group 'lisp) | 138 | :group 'lisp) |
| 139 | 139 | ||
| 140 | (defcustom compilation-safety 1 | 140 | (defcustom compilation-safety 1 |
| 141 | "Safety level for compilation. | 141 | "Safety level for generated compiled code. |
| 142 | Possible values are: | 142 | Possible values are: |
| 143 | 0 emitted code can misbehave or crash Emacs if function declarations are not | 143 | 0 - emitted code can misbehave, even crash Emacs, if declarations of |
| 144 | correct. | 144 | functions do not correctly describe their actual behavior; |
| 145 | 1 emitted code is generated in a safe matter even if function are miss-declared." | 145 | 1 - emitted code is to be generated in a safe manner, even if functions |
| 146 | are mis-declared. | ||
| 147 | |||
| 148 | This currently affects only code produced by native-compilation." | ||
| 146 | :type 'integer | 149 | :type 'integer |
| 147 | :safe #'integerp | 150 | :safe #'integerp |
| 148 | :version "30.1") | 151 | :version "30.1") |