diff options
| author | Mattias EngdegÄrd | 2024-06-30 17:06:30 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2024-06-30 17:27:08 +0200 |
| commit | dfbdd38f701cbf70769b024ee3fc59f677b328da (patch) | |
| tree | 5ce69d8695ac82b54e50778abc22046a0c815d44 | |
| parent | 64851d101a854e00c68f3e9259d70777e7b26cb2 (diff) | |
| download | emacs-dfbdd38f701cbf70769b024ee3fc59f677b328da.tar.gz emacs-dfbdd38f701cbf70769b024ee3fc59f677b328da.zip | |
Revert "; * etc/NEWS: Move items to "Incompatible Lisp Changes"."
This reverts commit 000ef8876ae9e2098cf98e1b1c468c09be3acd43.
Most of the moved items weren't actually incompatible changes.
| -rw-r--r-- | etc/NEWS | 438 |
1 files changed, 219 insertions, 219 deletions
| @@ -2135,13 +2135,6 @@ preventing the installation of Compat if unnecessary. | |||
| 2135 | 2135 | ||
| 2136 | * Incompatible Lisp Changes in Emacs 30.1 | 2136 | * Incompatible Lisp Changes in Emacs 30.1 |
| 2137 | 2137 | ||
| 2138 | ** Bytecode is now always loaded eagerly. | ||
| 2139 | Bytecode compiled with older Emacs versions for lazy loading using | ||
| 2140 | 'byte-compile-dynamic' is now loaded all at once. | ||
| 2141 | As a consequence, 'fetch-bytecode' has no use, does nothing, and is | ||
| 2142 | now obsolete. The variable 'byte-compile-dynamic' has no effect any | ||
| 2143 | more; compilation will always yield bytecode for eager loading. | ||
| 2144 | |||
| 2145 | +++ | 2138 | +++ |
| 2146 | ** Evaluating a 'lambda' returns an object of type 'interpreted-function'. | 2139 | ** Evaluating a 'lambda' returns an object of type 'interpreted-function'. |
| 2147 | Instead of representing interpreted functions as lists that start with | 2140 | Instead of representing interpreted functions as lists that start with |
| @@ -2159,209 +2152,6 @@ no longer work and will need to use 'aref' instead to extract its | |||
| 2159 | various subparts (when 'interactive-form', 'documentation', and | 2152 | various subparts (when 'interactive-form', 'documentation', and |
| 2160 | 'help-function-arglist' aren't adequate). | 2153 | 'help-function-arglist' aren't adequate). |
| 2161 | 2154 | ||
| 2162 | +++ | ||
| 2163 | ** Returned strings from functions and macros are never docstrings. | ||
| 2164 | Functions and macros whose bodies consist of a single string literal now | ||
| 2165 | only return that string; it is not used as a docstring. Example: | ||
| 2166 | |||
| 2167 | (defun sing-a-song () | ||
| 2168 | "Sing a song.") | ||
| 2169 | |||
| 2170 | The above function returns the string '"Sing a song."' but has no | ||
| 2171 | docstring. Previously, that string was used as both a docstring and | ||
| 2172 | return value, which was never what the programmer wanted. If you want | ||
| 2173 | the string to be a docstring, add an explicit return value. | ||
| 2174 | |||
| 2175 | This change applies to 'defun', 'defsubst', 'defmacro' and 'lambda' | ||
| 2176 | forms; other defining forms such as 'cl-defun' already worked this way. | ||
| 2177 | |||
| 2178 | ** New or changed byte-compilation warnings | ||
| 2179 | |||
| 2180 | --- | ||
| 2181 | *** Warn about missing 'lexical-binding' directive. | ||
| 2182 | The compiler now warns if an Elisp file lacks the standard | ||
| 2183 | '-*- lexical-binding: ... -*-' cookie on the first line. | ||
| 2184 | This line typically looks something like | ||
| 2185 | |||
| 2186 | ;;; My little pony mode -*- lexical-binding: t -*- | ||
| 2187 | |||
| 2188 | It is needed to inform the compiler about which dialect of ELisp | ||
| 2189 | your code is using: the modern dialect with lexical binding or | ||
| 2190 | the old dialect with only dynamic binding. | ||
| 2191 | |||
| 2192 | Lexical binding avoids some name conflicts and allows the compiler to | ||
| 2193 | detect more mistakes and generate more efficient code, so it is | ||
| 2194 | recommended. For how to adapt your code to lexical binding, see the | ||
| 2195 | manual section "(elisp) Converting to Lexical Binding". | ||
| 2196 | |||
| 2197 | If your code cannot be converted to lexical binding, you can insert | ||
| 2198 | the line | ||
| 2199 | |||
| 2200 | ;;; -*- lexical-binding: nil -*- | ||
| 2201 | |||
| 2202 | first in the file to declare that it uses the old dialect. | ||
| 2203 | |||
| 2204 | --- | ||
| 2205 | *** Warn about empty bodies for more special forms and macros. | ||
| 2206 | The compiler now warns about an empty body argument to 'when', | ||
| 2207 | 'unless', 'ignore-error' and 'with-suppressed-warnings' in addition to | ||
| 2208 | the existing warnings for 'let' and 'let*'. Example: | ||
| 2209 | |||
| 2210 | (when (> x 2)) | ||
| 2211 | |||
| 2212 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2213 | the warning name 'empty-body'. | ||
| 2214 | |||
| 2215 | --- | ||
| 2216 | *** Warn about quoted error names in 'condition-case' and 'ignore-error'. | ||
| 2217 | The compiler now warns about quoted condition (error) names | ||
| 2218 | in 'condition-case' and 'ignore-error'. Example: | ||
| 2219 | |||
| 2220 | (condition-case nil | ||
| 2221 | (/ x y) | ||
| 2222 | ('arith-error "division by zero")) | ||
| 2223 | |||
| 2224 | Quoting them adds the error name 'quote' to those handled or ignored | ||
| 2225 | respectively, which was probably not intended. | ||
| 2226 | |||
| 2227 | --- | ||
| 2228 | *** Warn about comparison with literal constants without defined identity. | ||
| 2229 | The compiler now warns about comparisons by identity with a literal | ||
| 2230 | string, cons, vector, record, function, large integer or float as this | ||
| 2231 | may not match any value at all. Example: | ||
| 2232 | |||
| 2233 | (eq x "hello") | ||
| 2234 | |||
| 2235 | Only literals for symbols and small integers (fixnums), including | ||
| 2236 | characters, are guaranteed to have a consistent (unique) identity. | ||
| 2237 | This warning applies to 'eq', 'eql', 'memq', 'memql', 'assq', 'rassq', | ||
| 2238 | 'remq' and 'delq'. | ||
| 2239 | |||
| 2240 | To compare by (structural) value, use 'equal', 'member', 'assoc', | ||
| 2241 | 'rassoc', 'remove' or 'delete' instead. Floats and bignums can also | ||
| 2242 | be compared using 'eql', '=' and 'memql'. Function literals cannot be | ||
| 2243 | compared reliably at all. | ||
| 2244 | |||
| 2245 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2246 | the warning name 'suspicious'. | ||
| 2247 | |||
| 2248 | --- | ||
| 2249 | *** Warn about 'condition-case' without handlers. | ||
| 2250 | The compiler now warns when the 'condition-case' form is used without | ||
| 2251 | any actual handlers, as in | ||
| 2252 | |||
| 2253 | (condition-case nil (read buffer)) | ||
| 2254 | |||
| 2255 | because it has no effect other than the execution of the body form. | ||
| 2256 | In particular, no errors are caught or suppressed. If the intention | ||
| 2257 | was to catch all errors, add an explicit handler for 'error', or use | ||
| 2258 | 'ignore-error' or 'ignore-errors'. | ||
| 2259 | |||
| 2260 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2261 | the warning name 'suspicious'. | ||
| 2262 | |||
| 2263 | --- | ||
| 2264 | *** Warn about 'unwind-protect' without unwind forms. | ||
| 2265 | The compiler now warns when the 'unwind-protect' form is used without | ||
| 2266 | any unwind forms, as in | ||
| 2267 | |||
| 2268 | (unwind-protect (read buffer)) | ||
| 2269 | |||
| 2270 | because the behavior is identical to that of the argument; there is | ||
| 2271 | no protection of any kind. Perhaps the intended unwind forms have | ||
| 2272 | been misplaced or forgotten, or the use of 'unwind-protect' could be | ||
| 2273 | simplified away. | ||
| 2274 | |||
| 2275 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2276 | the warning name 'suspicious'. | ||
| 2277 | |||
| 2278 | --- | ||
| 2279 | *** Warn about useless trailing 'cond' clauses. | ||
| 2280 | The compiler now warns when a 'cond' form contains clauses following a | ||
| 2281 | default (unconditional) clause. Example: | ||
| 2282 | |||
| 2283 | (cond ((= x 0) (say "none")) | ||
| 2284 | (t (say "some")) | ||
| 2285 | (say "goodbye")) | ||
| 2286 | |||
| 2287 | Such a clause will never be executed but is likely to be a mistake, | ||
| 2288 | perhaps due to misplaced brackets. | ||
| 2289 | |||
| 2290 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2291 | the warning name 'suspicious'. | ||
| 2292 | |||
| 2293 | --- | ||
| 2294 | *** Warn about mutation of constant values. | ||
| 2295 | The compiler now warns about code that modifies program constants in | ||
| 2296 | some obvious cases. Examples: | ||
| 2297 | |||
| 2298 | (setcar '(1 2) 7) | ||
| 2299 | (aset [3 4] 0 8) | ||
| 2300 | (aset "abc" 1 ?d) | ||
| 2301 | |||
| 2302 | Such code may have unpredictable behavior because the constants are | ||
| 2303 | part of the program, not data structures generated afresh during | ||
| 2304 | execution, and the compiler does not expect them to change. | ||
| 2305 | |||
| 2306 | To avoid the warning, operate on an object created by the program | ||
| 2307 | (maybe a copy of the constant), or use a non-destructive operation | ||
| 2308 | instead. | ||
| 2309 | |||
| 2310 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2311 | the warning name 'mutate-constant'. | ||
| 2312 | |||
| 2313 | --- | ||
| 2314 | *** Warn about more ignored function return values. | ||
| 2315 | The compiler now warns when the return value from certain functions is | ||
| 2316 | implicitly ignored. Example: | ||
| 2317 | |||
| 2318 | (progn (nreverse my-list) my-list) | ||
| 2319 | |||
| 2320 | will elicit a warning because it is usually pointless to call | ||
| 2321 | 'nreverse' on a list without using the returned value. | ||
| 2322 | |||
| 2323 | To silence the warning, make use of the value in some way, such as | ||
| 2324 | assigning it to a variable. You can also wrap the function call in | ||
| 2325 | '(ignore ...)', or use 'with-suppressed-warnings' with the warning | ||
| 2326 | name 'ignored-return-value'. | ||
| 2327 | |||
| 2328 | The warning will only be issued for calls to functions declared | ||
| 2329 | 'important-return-value' or 'side-effect-free' (but not 'error-free'). | ||
| 2330 | |||
| 2331 | --- | ||
| 2332 | *** Warn about docstrings that contain control characters. | ||
| 2333 | The compiler now warns about docstrings with control characters other | ||
| 2334 | than newline and tab. This is often a result of improper escaping. | ||
| 2335 | Example: | ||
| 2336 | |||
| 2337 | (defun my-fun () | ||
| 2338 | "Uses c:\remote\dir\files and the key \C-x." | ||
| 2339 | ...) | ||
| 2340 | |||
| 2341 | where the docstring contains the four control characters 'CR', 'DEL', | ||
| 2342 | 'FF' and 'C-x'. | ||
| 2343 | |||
| 2344 | The warning name is 'docstrings-control-chars'. | ||
| 2345 | |||
| 2346 | --- | ||
| 2347 | *** The warning about wide docstrings can now be disabled separately. | ||
| 2348 | Its warning name is 'docstrings-wide'. | ||
| 2349 | |||
| 2350 | +++ | ||
| 2351 | ** 'fset', 'defalias' and 'defvaralias' now signal an error for cyclic aliases. | ||
| 2352 | Previously, 'fset', 'defalias' and 'defvaralias' could be made to | ||
| 2353 | build circular function and variable indirection chains as in | ||
| 2354 | |||
| 2355 | (defalias 'able 'baker) | ||
| 2356 | (defalias 'baker 'able) | ||
| 2357 | |||
| 2358 | but trying to use them would sometimes make Emacs hang. Now, an attempt | ||
| 2359 | to create such a loop results in an error. | ||
| 2360 | |||
| 2361 | Since circular alias chains now cannot occur, 'function-alias-p', | ||
| 2362 | 'indirect-function' and 'indirect-variable' will never signal an error. | ||
| 2363 | Their 'noerror' arguments have no effect and are therefore obsolete. | ||
| 2364 | |||
| 2365 | --- | 2155 | --- |
| 2366 | ** The escape sequence '\x' not followed by hex digits is now an error. | 2156 | ** The escape sequence '\x' not followed by hex digits is now an error. |
| 2367 | Previously, '\x' without at least one hex digit denoted character code | 2157 | Previously, '\x' without at least one hex digit denoted character code |
| @@ -2447,13 +2237,6 @@ When it has a non-nil value, then completion functions like | |||
| 2447 | 'completing-read' don't discard text properties from the returned | 2237 | 'completing-read' don't discard text properties from the returned |
| 2448 | completion candidate. | 2238 | completion candidate. |
| 2449 | 2239 | ||
| 2450 | ** 'defadvice' is marked as obsolete. | ||
| 2451 | See the "(elisp) Porting Old Advice" Info node for help converting | ||
| 2452 | them to use 'advice-add' or 'define-advice' instead. | ||
| 2453 | |||
| 2454 | ** 'cl-old-struct-compat-mode' is marked as obsolete. | ||
| 2455 | You may need to recompile our code if it was compiled with Emacs < 24.3. | ||
| 2456 | |||
| 2457 | +++ | 2240 | +++ |
| 2458 | ** X color support compatibility aliases are now obsolete. | 2241 | ** X color support compatibility aliases are now obsolete. |
| 2459 | The compatibility aliases 'x-defined-colors', 'x-color-defined-p', | 2242 | The compatibility aliases 'x-defined-colors', 'x-color-defined-p', |
| @@ -2560,7 +2343,7 @@ t only if the argument is a function rather than a special-form, | |||
| 2560 | and 'cl-functionp' is like 'functionp' except it returns nil | 2343 | and 'cl-functionp' is like 'functionp' except it returns nil |
| 2561 | for lists and symbols. | 2344 | for lists and symbols. |
| 2562 | 2345 | ||
| 2563 | ** Built-in types now have corresponding classes. | 2346 | ** Built-in types have now corresponding classes. |
| 2564 | At the Lisp level, this means that things like '(cl-find-class 'integer)' | 2347 | At the Lisp level, this means that things like '(cl-find-class 'integer)' |
| 2565 | will now return a class object, and at the UI level it means that | 2348 | will now return a class object, and at the UI level it means that |
| 2566 | things like 'C-h o integer RET' will show some information about that type. | 2349 | things like 'C-h o integer RET' will show some information about that type. |
| @@ -2697,6 +2480,13 @@ characters in length, provided that the LONG_XLFDs argument is true. | |||
| 2697 | Other features in Emacs which employ XLFDs have been modified to | 2480 | Other features in Emacs which employ XLFDs have been modified to |
| 2698 | produce and understand XLFDs larger than 255 characters. | 2481 | produce and understand XLFDs larger than 255 characters. |
| 2699 | 2482 | ||
| 2483 | ** 'defadvice' is marked as obsolete. | ||
| 2484 | See the "(elisp) Porting Old Advice" Info node for help converting | ||
| 2485 | them to use 'advice-add' or 'define-advice' instead. | ||
| 2486 | |||
| 2487 | ** 'cl-old-struct-compat-mode' is marked as obsolete. | ||
| 2488 | You may need to recompile our code if it was compiled with Emacs < 24.3. | ||
| 2489 | |||
| 2700 | +++ | 2490 | +++ |
| 2701 | ** New macro 'static-if' for conditional evaluation of code. | 2491 | ** New macro 'static-if' for conditional evaluation of code. |
| 2702 | This macro hides a form from the evaluator or byte-compiler based on a | 2492 | This macro hides a form from the evaluator or byte-compiler based on a |
| @@ -2828,6 +2618,194 @@ Tree-sitter conditionally sets 'forward-sexp-function' for major modes | |||
| 2828 | that have defined 'sexp' in 'treesit-thing-settings' to enable | 2618 | that have defined 'sexp' in 'treesit-thing-settings' to enable |
| 2829 | sexp-related motion commands. | 2619 | sexp-related motion commands. |
| 2830 | 2620 | ||
| 2621 | +++ | ||
| 2622 | ** Returned strings are never docstrings. | ||
| 2623 | Functions and macros whose bodies consist of a single string literal now | ||
| 2624 | only return that string; it is not used as a docstring. Example: | ||
| 2625 | |||
| 2626 | (defun sing-a-song () | ||
| 2627 | "Sing a song.") | ||
| 2628 | |||
| 2629 | The above function returns the string '"Sing a song."' but has no | ||
| 2630 | docstring. Previously, that string was used as both a docstring and | ||
| 2631 | return value, which was never what the programmer wanted. If you want | ||
| 2632 | the string to be a docstring, add an explicit return value. | ||
| 2633 | |||
| 2634 | This change applies to 'defun', 'defsubst', 'defmacro' and 'lambda' | ||
| 2635 | forms; other defining forms such as 'cl-defun' already worked this way. | ||
| 2636 | |||
| 2637 | ** New or changed byte-compilation warnings | ||
| 2638 | |||
| 2639 | --- | ||
| 2640 | *** Warn about missing 'lexical-binding' directive. | ||
| 2641 | The compiler now warns if an Elisp file lacks the standard | ||
| 2642 | '-*- lexical-binding: ... -*-' cookie on the first line. | ||
| 2643 | This line typically looks something like | ||
| 2644 | |||
| 2645 | ;;; My little pony mode -*- lexical-binding: t -*- | ||
| 2646 | |||
| 2647 | It is needed to inform the compiler about which dialect of ELisp | ||
| 2648 | your code is using: the modern dialect with lexical binding or | ||
| 2649 | the old dialect with only dynamic binding. | ||
| 2650 | |||
| 2651 | Lexical binding avoids some name conflicts and allows the compiler to | ||
| 2652 | detect more mistakes and generate more efficient code, so it is | ||
| 2653 | recommended. For how to adapt your code to lexical binding, see the | ||
| 2654 | manual section "(elisp) Converting to Lexical Binding". | ||
| 2655 | |||
| 2656 | If your code cannot be converted to lexical binding, you can insert | ||
| 2657 | the line | ||
| 2658 | |||
| 2659 | ;;; -*- lexical-binding: nil -*- | ||
| 2660 | |||
| 2661 | first in the file to declare that it uses the old dialect. | ||
| 2662 | |||
| 2663 | --- | ||
| 2664 | *** Warn about empty bodies for more special forms and macros. | ||
| 2665 | The compiler now warns about an empty body argument to 'when', | ||
| 2666 | 'unless', 'ignore-error' and 'with-suppressed-warnings' in addition to | ||
| 2667 | the existing warnings for 'let' and 'let*'. Example: | ||
| 2668 | |||
| 2669 | (when (> x 2)) | ||
| 2670 | |||
| 2671 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2672 | the warning name 'empty-body'. | ||
| 2673 | |||
| 2674 | --- | ||
| 2675 | *** Warn about quoted error names in 'condition-case' and 'ignore-error'. | ||
| 2676 | The compiler now warns about quoted condition (error) names | ||
| 2677 | in 'condition-case' and 'ignore-error'. Example: | ||
| 2678 | |||
| 2679 | (condition-case nil | ||
| 2680 | (/ x y) | ||
| 2681 | ('arith-error "division by zero")) | ||
| 2682 | |||
| 2683 | Quoting them adds the error name 'quote' to those handled or ignored | ||
| 2684 | respectively, which was probably not intended. | ||
| 2685 | |||
| 2686 | --- | ||
| 2687 | *** Warn about comparison with literal constants without defined identity. | ||
| 2688 | The compiler now warns about comparisons by identity with a literal | ||
| 2689 | string, cons, vector, record, function, large integer or float as this | ||
| 2690 | may not match any value at all. Example: | ||
| 2691 | |||
| 2692 | (eq x "hello") | ||
| 2693 | |||
| 2694 | Only literals for symbols and small integers (fixnums), including | ||
| 2695 | characters, are guaranteed to have a consistent (unique) identity. | ||
| 2696 | This warning applies to 'eq', 'eql', 'memq', 'memql', 'assq', 'rassq', | ||
| 2697 | 'remq' and 'delq'. | ||
| 2698 | |||
| 2699 | To compare by (structural) value, use 'equal', 'member', 'assoc', | ||
| 2700 | 'rassoc', 'remove' or 'delete' instead. Floats and bignums can also | ||
| 2701 | be compared using 'eql', '=' and 'memql'. Function literals cannot be | ||
| 2702 | compared reliably at all. | ||
| 2703 | |||
| 2704 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2705 | the warning name 'suspicious'. | ||
| 2706 | |||
| 2707 | --- | ||
| 2708 | *** Warn about 'condition-case' without handlers. | ||
| 2709 | The compiler now warns when the 'condition-case' form is used without | ||
| 2710 | any actual handlers, as in | ||
| 2711 | |||
| 2712 | (condition-case nil (read buffer)) | ||
| 2713 | |||
| 2714 | because it has no effect other than the execution of the body form. | ||
| 2715 | In particular, no errors are caught or suppressed. If the intention | ||
| 2716 | was to catch all errors, add an explicit handler for 'error', or use | ||
| 2717 | 'ignore-error' or 'ignore-errors'. | ||
| 2718 | |||
| 2719 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2720 | the warning name 'suspicious'. | ||
| 2721 | |||
| 2722 | --- | ||
| 2723 | *** Warn about 'unwind-protect' without unwind forms. | ||
| 2724 | The compiler now warns when the 'unwind-protect' form is used without | ||
| 2725 | any unwind forms, as in | ||
| 2726 | |||
| 2727 | (unwind-protect (read buffer)) | ||
| 2728 | |||
| 2729 | because the behavior is identical to that of the argument; there is | ||
| 2730 | no protection of any kind. Perhaps the intended unwind forms have | ||
| 2731 | been misplaced or forgotten, or the use of 'unwind-protect' could be | ||
| 2732 | simplified away. | ||
| 2733 | |||
| 2734 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2735 | the warning name 'suspicious'. | ||
| 2736 | |||
| 2737 | --- | ||
| 2738 | *** Warn about useless trailing 'cond' clauses. | ||
| 2739 | The compiler now warns when a 'cond' form contains clauses following a | ||
| 2740 | default (unconditional) clause. Example: | ||
| 2741 | |||
| 2742 | (cond ((= x 0) (say "none")) | ||
| 2743 | (t (say "some")) | ||
| 2744 | (say "goodbye")) | ||
| 2745 | |||
| 2746 | Such a clause will never be executed but is likely to be a mistake, | ||
| 2747 | perhaps due to misplaced brackets. | ||
| 2748 | |||
| 2749 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2750 | the warning name 'suspicious'. | ||
| 2751 | |||
| 2752 | --- | ||
| 2753 | *** Warn about mutation of constant values. | ||
| 2754 | The compiler now warns about code that modifies program constants in | ||
| 2755 | some obvious cases. Examples: | ||
| 2756 | |||
| 2757 | (setcar '(1 2) 7) | ||
| 2758 | (aset [3 4] 0 8) | ||
| 2759 | (aset "abc" 1 ?d) | ||
| 2760 | |||
| 2761 | Such code may have unpredictable behavior because the constants are | ||
| 2762 | part of the program, not data structures generated afresh during | ||
| 2763 | execution, and the compiler does not expect them to change. | ||
| 2764 | |||
| 2765 | To avoid the warning, operate on an object created by the program | ||
| 2766 | (maybe a copy of the constant), or use a non-destructive operation | ||
| 2767 | instead. | ||
| 2768 | |||
| 2769 | This warning can be suppressed using 'with-suppressed-warnings' with | ||
| 2770 | the warning name 'mutate-constant'. | ||
| 2771 | |||
| 2772 | --- | ||
| 2773 | *** Warn about more ignored function return values. | ||
| 2774 | The compiler now warns when the return value from certain functions is | ||
| 2775 | implicitly ignored. Example: | ||
| 2776 | |||
| 2777 | (progn (nreverse my-list) my-list) | ||
| 2778 | |||
| 2779 | will elicit a warning because it is usually pointless to call | ||
| 2780 | 'nreverse' on a list without using the returned value. | ||
| 2781 | |||
| 2782 | To silence the warning, make use of the value in some way, such as | ||
| 2783 | assigning it to a variable. You can also wrap the function call in | ||
| 2784 | '(ignore ...)', or use 'with-suppressed-warnings' with the warning | ||
| 2785 | name 'ignored-return-value'. | ||
| 2786 | |||
| 2787 | The warning will only be issued for calls to functions declared | ||
| 2788 | 'important-return-value' or 'side-effect-free' (but not 'error-free'). | ||
| 2789 | |||
| 2790 | --- | ||
| 2791 | *** Warn about docstrings that contain control characters. | ||
| 2792 | The compiler now warns about docstrings with control characters other | ||
| 2793 | than newline and tab. This is often a result of improper escaping. | ||
| 2794 | Example: | ||
| 2795 | |||
| 2796 | (defun my-fun () | ||
| 2797 | "Uses c:\remote\dir\files and the key \C-x." | ||
| 2798 | ...) | ||
| 2799 | |||
| 2800 | where the docstring contains the four control characters 'CR', 'DEL', | ||
| 2801 | 'FF' and 'C-x'. | ||
| 2802 | |||
| 2803 | The warning name is 'docstrings-control-chars'. | ||
| 2804 | |||
| 2805 | --- | ||
| 2806 | *** The warning about wide docstrings can now be disabled separately. | ||
| 2807 | Its warning name is 'docstrings-wide'. | ||
| 2808 | |||
| 2831 | --- | 2809 | --- |
| 2832 | ** New user option 'native-comp-async-warnings-errors-kind'. | 2810 | ** New user option 'native-comp-async-warnings-errors-kind'. |
| 2833 | It allows control of what kinds of warnings and errors from asynchronous | 2811 | It allows control of what kinds of warnings and errors from asynchronous |
| @@ -2861,6 +2839,13 @@ The declaration '(important-return-value t)' sets the | |||
| 2861 | 'important-return-value' property which indicates that the function | 2839 | 'important-return-value' property which indicates that the function |
| 2862 | return value should probably not be thrown away implicitly. | 2840 | return value should probably not be thrown away implicitly. |
| 2863 | 2841 | ||
| 2842 | ** Bytecode is now always loaded eagerly. | ||
| 2843 | Bytecode compiled with older Emacs versions for lazy loading using | ||
| 2844 | 'byte-compile-dynamic' is now loaded all at once. | ||
| 2845 | As a consequence, 'fetch-bytecode' has no use, does nothing, and is | ||
| 2846 | now obsolete. The variable 'byte-compile-dynamic' has no effect any | ||
| 2847 | more; compilation will always yield bytecode for eager loading. | ||
| 2848 | |||
| 2864 | +++ | 2849 | +++ |
| 2865 | ** New functions 'file-user-uid' and 'file-group-gid'. | 2850 | ** New functions 'file-user-uid' and 'file-group-gid'. |
| 2866 | These functions are like 'user-uid' and 'group-gid', respectively, but | 2851 | These functions are like 'user-uid' and 'group-gid', respectively, but |
| @@ -2868,6 +2853,21 @@ are aware of file name handlers, so they will return the remote UID or | |||
| 2868 | GID for remote files (or -1 if the connection has no associated user). | 2853 | GID for remote files (or -1 if the connection has no associated user). |
| 2869 | 2854 | ||
| 2870 | +++ | 2855 | +++ |
| 2856 | ** 'fset', 'defalias' and 'defvaralias' now signal an error for cyclic aliases. | ||
| 2857 | Previously, 'fset', 'defalias' and 'defvaralias' could be made to | ||
| 2858 | build circular function and variable indirection chains as in | ||
| 2859 | |||
| 2860 | (defalias 'able 'baker) | ||
| 2861 | (defalias 'baker 'able) | ||
| 2862 | |||
| 2863 | but trying to use them would sometimes make Emacs hang. Now, an attempt | ||
| 2864 | to create such a loop results in an error. | ||
| 2865 | |||
| 2866 | Since circular alias chains now cannot occur, 'function-alias-p', | ||
| 2867 | 'indirect-function' and 'indirect-variable' will never signal an error. | ||
| 2868 | Their 'noerror' arguments have no effect and are therefore obsolete. | ||
| 2869 | |||
| 2870 | +++ | ||
| 2871 | ** 'treesit-font-lock-rules' now accepts additional global keywords. | 2871 | ** 'treesit-font-lock-rules' now accepts additional global keywords. |
| 2872 | When supplied with ':default-language LANGUAGE', rules after it will | 2872 | When supplied with ':default-language LANGUAGE', rules after it will |
| 2873 | default to use 'LANGUAGE'. | 2873 | default to use 'LANGUAGE'. |
| @@ -2982,7 +2982,7 @@ this was not possible.) In addition, LOCATION can be an integer, a | |||
| 2982 | (BEFORE is ignored in this case). | 2982 | (BEFORE is ignored in this case). |
| 2983 | 2983 | ||
| 2984 | +++ | 2984 | +++ |
| 2985 | ** New function 'sqlite-execute-batch'. | 2985 | **** New function 'sqlite-execute-batch'. |
| 2986 | This function lets the user execute multiple SQL statements in one go. | 2986 | This function lets the user execute multiple SQL statements in one go. |
| 2987 | It is useful, for example, when a Lisp program needs to evaluate an | 2987 | It is useful, for example, when a Lisp program needs to evaluate an |
| 2988 | entire SQL file. | 2988 | entire SQL file. |