summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Rename a recently-added variable (bug#56197)Eli Zaretskii2025-02-011-1/+1
| | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraphs-as-doc-string): Renamed from 'lisp-fill-paragraph-as-displayed' and default value reversed. (lisp-fill-paragraph): Adjust to the change. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fill-paragraph-as-displayed): Likewise.
* Port dest-mountpoint test to suspicious bwrapPaul Eggert2025-01-311-0/+6
| | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--dest-mountpoint): Skip test if bwrap prohibits even ‘true’, which it does on my Ubuntu 24.10 platform.
* lisp: Introduce a `lisp-fill-paragraph-as-displayed' variable.Maxim Cournoyer2025-01-251-0/+47
| | | | | | | | | | | | | | | | | | | | Starting with Emacs 28, filling strings now happens in a narrowed scope, and looses the leading indentation and can cause the string to extend past the fill-column value. Introduce `lisp-fill-paragraph-as-displayed' as a new variable allowing opting out of this new behavior in specific scenarios (such as when using the Scheme major mode, say). * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph-as-displayed): New variable. (lisp-fill-paragraph): Honor it, by avoiding the logic narrow to strings before applying fill-paragraph. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fill-paragraph-respects-fill-column): Test it. (lisp-fill-paragraph-docstring-boundaries): New test, as a safeguard to avoid regressions. Fixes: bug#56197
* ; Fix last change by using 'cl-oddp' and 'cl-evenp' (bug#75633).Eli Zaretskii2025-01-182-76/+76
|
* New unit-tests for cl-lib (bug#75633).Ahmed Khanzada2025-01-183-1/+996
|
* (cl-block, cl-return-from): Fix bug#75498Stefan Monnier2025-01-161-0/+9
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-block, cl-return-from): Change encoding so it obeys variable coping (i.e. lexical scoping when `lexical-binding` is non-nil). (cl--block-wrapper, cl--block-throw): Adjust accordingly. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--test-cl-block-lexbind-bug-75498): New test.
* Update copyright year to 2025Paul Eggert2025-01-0176-76/+76
| | | | Run "TZ=UTC0 admin/update-copyright".
* (cl-flet, cl-labels): Fix bug#74870Stefan Monnier2024-12-211-0/+10
| | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Wrap function bodies in `cl-block`. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--test-flet-block): New test.
* (cl-labels): Add support for (FUNC EXP) bindings (bug#59786)Stefan Monnier2024-11-121-2/+12
| | | | | | | | | | | | Allow `cl-labels` to use the same (FUNC EXP) bindings as were already added to `cl-flet` in Emacs-25. The Info doc (mistakenly) already documented this new feature. * lisp/emacs-lisp/cl-macs.el (cl--self-tco-on-form): New function. (cl-labels): Use it to add support for (FUNC EXP) bindings. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test for tail-recursive (FUNC EXP) bindings.
* cond*: Add support for Pcase patternsStefan Monnier2024-10-251-0/+53
| | | | | | | | * lisp/emacs-lisp/cond-star.el (cond*): Adjust docstring. (match*): Prefer `_VAR` syntax. (cond*-convert-condition): Add support for `pcase*`. * doc/lispref/control.texi (cond* Macro): Document `pcase*`. * test/lisp/emacs-lisp/cond-star-tests.el: New file.
* ; Fix thinko in my last changeStefan Kangas2024-10-021-0/+3
| | | | | | * lisp/emacs-lisp/bytecomp.el (bytecomp--custom-declare): Fix thinko. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defcustom-local): Update test.
* Warn about bad defcustom :local keyword at compile timeStefan Kangas2024-10-021-0/+8
| | | | | | | * lisp/emacs-lisp/bytecomp.el (bytecomp--custom-declare): Warn about invalid values for the defcustom :local keyword. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defcustom-local): New test.
* ; Reword :reverse-video warningMattias Engdegård2024-09-291-1/+1
| | | | | | * lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-face-spec): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec): Clarify. (See bug#73552.)
* Warn about :reverse-video in deffaceMattias Engdegård2024-09-291-0/+4
| | | | | | | | | | | This attribute keyword has been non-working in defface for 14 years, thus warning about it is both safe and decent. * lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-face-spec): Warn and suggest :inverse-video to be used instead. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec): Add a test case. * etc/NEWS: Notify the user.
* Warn about bad face specs in `defface` at compile timeMattias Engdegård2024-09-271-0/+26
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--custom-declare-face): Byte-compile `defface` forms, or the byte-compile handler won't be called. (bytecomp--check-cus-face-spec): New. (bytecomp--custom-declare): Call it. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-defface-spec): New tests.
* (pcase-tests-quote-optimization): Fix warningStefan Monnier2024-09-261-1/+1
| | | | | * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization): Fix confusing code.
* Merge from origin/emacs-30Eli Zaretskii2024-09-071-0/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b420e149b1e Fix a typo in ediff-init.el e1304e9b1bb Fix 'chart-space-usage' on MS-Windows 04c44405bf6 Fix alignment and documentation of vtable.el 4d6fadb8d21 ; * lisp/which-key.el: Fix ':package-version' (bug#73072). 54071b9cef2 ; Improve doc strings of 'tab-bar-mode' and 'tab-line-mode' 87a8b12a0c4 Fix test failure in erc-networks-tests dad0935cfcb ; * doc/emacs/building.texi (Lisp Libraries): Update (bug... e4dc6711b02 Fix :hook in 'use-package' c1cd036d27a ; * doc/lispref/modes.texi (Mode Line Data): Fox wording. ae2463796f2 ; Caveats about using :eval in 'mode-line-format' 4047072c7d8 Update FSF's address 24f12bdd77e Support the new option in ruby-ts-mode too 6c15b7710d4 Add new option ruby-bracketed-args-indent 7799ef43354 Fix Rmail base64 and qp decoding of MIME payloads 0def396fa8f Update to Org 9.7.11 8c044bd9726 ; Fix recent changes in documentation e0d8879bcd5 * test/lisp/emacs-lisp/tabulated-list-tests.el: Add missi... 4ff4b78f922 ; Small doc fixes da980ad838e ; Reword some "allows Xing" 2ca7d5649c6 ; More accurate text about how `equal` compares various o... # Conflicts: # etc/NEWS
| * * test/lisp/emacs-lisp/tabulated-list-tests.el: Add missing test.Juri Linkov2024-09-011-0/+27
| | | | | | | | (tabulated-list-groups-with-path): Add test for tabulated-list-groups.
* | Merge from origin/emacs-30Eli Zaretskii2024-08-251-0/+54
|\| | | | | | | | | | | | | | | | | | | | | | | 9b299dd79c1 Revert a recent change that caused redisplay slowdown 4eaab54896f ; * doc/lispref/display.texi (Low-Level Font): Fix wordin... 0a500193087 Indent ERT failure explanations rigidly 713069dd7a8 [Eglot] Stricter "expand common" behavior 096730510cd eglot-tests.el: New tests for existing completion behavior 969498c25d0 Remove dangerous HTML edit from admin.el # Conflicts: # etc/EGLOT-NEWS
| * Indent ERT failure explanations rigidlyF. Jason Park2024-08-251-0/+54
| | | | | | | | | | | | | | | | | | | | | | This also affects the listing of `should' forms produced by hitting the L key on a test button in an ERT buffer. * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Indent the pretty-printed result to match the caller's current column as a reference indentation. * test/lisp/emacs-lisp/ert-tests.el (ert--pp-with-indentation-and-newline): New test. (Bug#72561)
* | Merge from origin/emacs-30Eli Zaretskii2024-07-271-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 88e1ec22f27 Update to Org 9.7.9 1ae2f004473 Fix edge-case with 'which-key-dont-use-unicode' setter 68a5f1f7d18 NS: prevent makeKeyWindow warnings (bug#69525) 59a895ec499 ; * .gitignore: Add lisp/eshell/esh-groups.el. 5c08cd4e7c3 ; * doc/emacs/cmdargs.texi (Initial Options): Fix last ch... 309d0a71864 Add PROBLEMS entry for bug#72303 87389f9ff90 ; Improve documentation of 'line-prefix' and 'wrap-prefix'. 268a2d10fc9 Improve documentation of '--init-directory' command-line ... c27055a938a ; cperl-mode.el: Fix fontification of flip-flop (Bug#72296) fcd4e4c895d ; * admin/MAINTAINERS: Add myself for maintaining some ar... fdc133e97f6 Fix bug in server.el introduced by 0d7d835902df af527051cd3 ; * admin/MAINTAINERS: Remove Nicolas Petton. 7170282a59a lisp/minibuffer.el (completion--sifn-requote): Fix bug#72176 68906f184cb * admin/notes/spelling: Update note. 9eea6be5abf Don't produce invalid XML with multi-line commenting style b97786d9f6e ; * etc/NEWS: Entry for 'gnus-summary-limit-to-age' (bug#... a7996615663 Standardize possessive apostrophe usage in manuals, docs,... 67faaead754 Don't refer to obsolete finder group "wp" # Conflicts: # etc/NEWS
| * Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas2024-07-251-1/+1
| | | | | | | | | | See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
* | Add new function `lm-package-needs-footer-line`Stefan Kangas2024-07-061-0/+13
|/ | | | | | | | | | | | * lisp/emacs-lisp/lisp-mnt.el (lm-package-needs-footer-line): Factor out new function... * lisp/emacs-lisp/package.el (package-buffer-info): ...from here. * lisp/emacs-lisp/lisp-mnt.el (lm-verify): Use above new function. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm-tests--lm-package-needs-footer-line/empty-dependencies) (lm-tests--lm-package-needs-footer-line/old-version) (lm-tests--lm-package-needs-footer-line/new-version): New tests.
* (pcase--app-subst-match): Try and fix performance regression (bug#71398)Stefan Monnier2024-06-081-1/+8
| | | | | | | * lisp/emacs-lisp/pcase.el (pcase--app-subst-match): Optimize matches against (quote VAL). * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization): Add new test case.
* pcase.el (\`): Try and handle large patterns betterStefan Monnier2024-06-031-1/+11
| | | | | | | | | | | | | | | | | | | | | Large backquote patterns tend to lead to very large and deeply nested expansions, but they also tend to contain a lot of "constant" subpatterns that can be compiled to quote patterns. This patch does just that. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01140.html * lisp/emacs-lisp/pcase.el (pcase--split-pred): Improve the handling of pred-vs-quote so it also works with quoted objects like cons cells, vectors, and strings. Simplify the `pcase--mutually-exclusive-p` branch accordingly. (pcase--expand-\`): New function, extracted from the \` pcase macro. Make it recurse internally, and optimize backquote patterns to `quote` patterns where possible. (\`): Use it. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-vectors): Add tests that were broken by a more naïve version of the optimization. (pcase-tests-quote-optimization): New test.
* Merge from origin/emacs-29Eli Zaretskii2024-06-011-1/+1
|\ | | | | | | | | bf50aa38f9d Improve documentation of case-conversion commands 225b426f256 ; Fix typos
| * ; Fix typosStefan Kangas2024-05-271-1/+1
| |
* | Make 'vtable-insert-object' more versatileJoost Kremers2024-05-181-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/vtable.el (vtable-insert-object): Rename argument AFTER-OBJECT to LOCATION; allow use of index to refer to the insertion position; add argument BEFORE. (Bug#70664). * etc/NEWS: * doc/misc/vtable.texi (Interface Functions): Document the change. * test/lisp/emacs-lisp/vtable-tests.el (test-vtable-insert-object): New test.
* | Support Python 3 in 'package-test-update-archives-async'kobarity2024-05-112-18/+15
| | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/package-resources/package-test-server.py: Support Python 3. * test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async): Search for an executable named "python", "python3", or "python2". (Bug#70722) Co-authored-by: Lin Sun <sunlin7@hotmail.com>
* | oclosure-tests.el: Adjust to new `interpreted-function` typeStefan Monnier2024-04-291-2/+2
| | | | | | | | | | | | * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-gen): Adjust to new `interpreted-function` type. (oclosure-test): Tweak accordingly.
* | Declare the variable `rx-constituents` obsolete.Mattias Engdegård2024-04-291-12/+13
| | | | | | | | | | | | | | | | | | It has been effectively obsolete since Emacs 27, when the modern extension mechanism was introduced. * lisp/emacs-lisp/rx.el (rx-constituents): Make obsolete. * test/lisp/emacs-lisp/rx-tests.el (rx-constituents): Suppress warning. * etc/NEWS: Announce.
* | Use a dedicated type to represent interpreted-function valuesStefan Monnier2024-04-281-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change `function` so that when evaluating #'(lambda ...) we return an object of type `interpreted-function` rather than a list starting with one of `lambda` or `closure`. The new type reuses the existing PVEC_CLOSURE (nee PVEC_COMPILED) tag and tries to align the corresponding elements: - the arglist, the docstring, and the interactive-form go in the same slots as for byte-code functions. - the body of the function goes in the slot used for the bytecode string. - the lexical context goes in the slot used for the constants of bytecoded functions. The first point above means that `help-function-arglist`, `documentation`, and `interactive-form`s don't need to distinguish interpreted and bytecode functions any more. Main benefits of the change: - We can now reliably distinguish a list from a function value. - `cl-defmethod` can dispatch on `interactive-function` and `closure`. Dispatch on `function` also works now for interpreted functions but still won't work for functions represented as lists or as symbols, of course. - Function values are now self-evaluating. That was alrready the case when byte-compiled, but not when interpreted since (eval '(closure ...)) signals a void-function error. That also avoids false-positive warnings about "don't quote your lambdas" when doing things like `(mapcar ',func ...)`. * src/eval.c (Fmake_interpreted_closure): New function. (Ffunction): Use it and change calling convention of `Vinternal_make_interpreted_closure_function`. (FUNCTIONP, Fcommandp, eval_sub, funcall_general, funcall_lambda) (Ffunc_arity, lambda_arity): Simplify. (funcall_lambda): Adjust to new representation. (syms_of_eval): `defsubr` the new function. Remove definition of `Qclosure`. * lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure): Change calling convention and use `make-interpreted-closure`. * src/data.c (Fcl_type_of): Distinguish `byte-code-function`s from `interpreted-function`s. (Fclosurep, finterpreted_function_p): New functions. (Fbyte_code_function_p): Don't be confused by `interpreted-function`s. (Finteractive_form, Fcommand_modes): Simplify. (syms_of_data): Define new type symbols and `defsubr` the two new functions. * lisp/emacs-lisp/cl-print.el (cl-print-object) <interpreted-function>: New method. * lisp/emacs-lisp/oclosure.el (oclosure): Refine the parent to be `closure`. (oclosure--fix-type, oclosure-type): Simplify. (oclosure--copy, oclosure--get, oclosure--set): Adjust to new representation. * src/callint.c (Fcall_interactively): Adjust to new representation. * src/lread.c (bytecode_from_rev_list): * lisp/simple.el (function-documentation): * lisp/help.el (help-function-arglist): Remove the old `closure` case and adjust the byte-code case so it handles `interpreted-function`s. * lisp/emacs-lisp/cl-preloaded.el (closure): New type. (byte-code-function): Add it as a parent. (interpreted-function): Adjust parent (the type itself was already added earlier by accident). * lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Adjust to new representation. (byte-compile): Use `interpreted-function-p`. * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): Adjust to new representation. (side-effect-free-fns): Add `interpreted-function-p` and `closurep`. * src/profiler.c (trace_hash, ffunction_equal): Simplify. * lisp/profiler.el (profiler-function-equal): Simplify. * lisp/emacs-lisp/nadvice.el (advice--interactive-form-1): Use `interpreted-function-p`; adjust to new representation; and take advantage of the fact that function values are now self-evaluating. * lisp/emacs-lisp/lisp-mode.el (closure): Remove `lisp-indent-function` property. * lisp/emacs-lisp/disass.el (disassemble-internal): Adjust to new representation. * lisp/emacs-lisp/edebug.el (edebug--strip-instrumentation): Use `interpreted-function-p`. * lisp/emacs-lisp/comp-common.el (comp-known-type-specifiers): Add `closurep` and `interpreted-function-p`. * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Adjust to more precise type info in `describe-function`. * test/lisp/erc/resources/erc-d/erc-d-tests.el (erc-d--render-entries): Use `interpreted-function-p`. * test/lisp/emacs-lisp/macroexp-resources/vk.el (vk-f4, vk-f5): Don't hardcode function values. * doc/lispref/functions.texi (Anonymous Functions): Don't suggest that function values are lists. Reword "self-quoting" to reflect the fact that #' doesn't return the exact same object. Update examples with the new shape of the return value. * doc/lispref/variables.texi (Lexical Binding): * doc/lispref/lists.texi (Rearrangement): * doc/lispref/control.texi (Handling Errors): Update examples to reflect new representation of function values.
* | Better format string compilation warningMattias Engdegård2024-04-221-1/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-format-warn): Speed up by eliminating the temporary buffer. Detect invalid format sequences. Use plurals properly. * test/lisp/emacs-lisp/bytecomp-tests.el: Update test.
* | lisp/emacs-lisp/track-changes.el: New file (bug#70077)Stefan Monnier2024-04-131-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new package provides an API that is easier to use right than our `*-change-functions` hooks. The patch includes changes to `diff-mode.el` and `eglot.el` to make use of this new package. * lisp/emacs-lisp/track-changes.el: New file. * test/lisp/emacs-lisp/track-changes-tests.el: New file. * doc/lispref/text.texi (Tracking changes): New subsection. * lisp/progmodes/eglot.el: Require `track-changes`. (eglot--virtual-pos-to-lsp-position): New function. (eglot--track-changes): New var. (eglot--managed-mode): Use `track-changes-register` i.s.o `after/before-change-functions` when available. (eglot--track-changes-signal): New function, partly extracted from `eglot--after-change`. (eglot--after-change): Use it. (eglot--track-changes-fetch): New function. (eglot--signal-textDocument/didChange): Use it. * lisp/vc/diff-mode.el: Require `track-changes`. Also require `easy-mmode` before the `eval-when-compile`s. (diff-unhandled-changes): Delete variable. (diff-after-change-function): Delete function. (diff--track-changes-function): Rename from `diff-post-command-hook` and adjust to new calling convention. (diff--track-changes): New variable. (diff--track-changes-signal): New function. (diff-mode, diff-minor-mode): Use it with `track-changes-register`.
* | Make lexical-binding cookie warning test more robustMattias Engdegård2024-04-031-6/+8
| | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--lexical-binding-cookie): Run with lexical-binding both on and off.
* | Fix symbol list matching regexps.Vladimir Kazanov2024-04-011-2/+45
| | | | | | | | | | | | | | | | | | Fix symbol list matching regexp performance Allow empty face lists, improve the face list matching regexp (see discussion in Bug#69714) based on relint's comments, add tests: * test/lisp/emacs-lisp/ert-font-lock-tests.el: Add tests. * lisp/emacs-lisp/ert-font-lock.el: Fix regexps.
* | Merge from origin/emacs-29Eli Zaretskii2024-03-301-1/+0
|\| | | | | | | | | | | | | | | | | | | | | 7a5d7be52c5 org--confirm-resource-safe: Fix prompt when prompting in ... 2bc865ace05 org-file-contents: Consider all remote files unsafe 6f9ea396f49 org-latex-preview: Add protection when `untrusted-content... 937b9042ad7 * lisp/gnus/mm-view.el (mm-display-inline-fontify): Mark ... ccc188fcf98 * lisp/files.el (untrusted-content): New variable. befa9fcaae2 org-macro--set-templates: Prevent code evaluation 3221d8d4611 * admin/authors.el (authors-aliases): Add ignored authors. 8d8253f8991 * etc/NEWS: Update for Emacs 29.3
* | pp.el: Try and fix bug#70039Stefan Monnier2024-03-281-0/+19
| | | | | | | | | | * lisp/emacs-lisp/pp.el (pp-fill): Avoid splitting `#N#` or `#[`. * test/lisp/emacs-lisp/pp-tests.el (pp-tests--sanity): New test.
* | Improve ert-font-lock assertion parser (Bug#69714)Vladimir Kazanov2024-03-282-25/+130
| | | | | | | | | | | | | | | | | | | | | | | | Fail on files with no assertions, parser now accepts multiple carets per line and face lists: * lisp/emacs-lisp/ert-font-lock.el: Assertion parser fix. * test/lisp/emacs-lisp/ert-font-lock-resources/no-asserts.js: * test/lisp/emacs-lisp/ert-font-lock-tests.el (test-parse-comments--no-assertion-error) (test-syntax-highlight-inline--caret-negated-wrong-face) (test-macro-test--file-no-asserts): New test cases. * doc/misc/ert.texi (Syntax Highlighting Tests): More syntax examples.
* | (pcase-mutually-exclusive): Use auto-generated tableStefan Monnier2024-03-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | The `pcase-mutually-exclusive-predicates` table was not very efficient since it grew like O(N²) with the number of predicates. Replace it with an O(N) table that's auto-generated from the `built-in-class` objects. * lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates): Delete variable. (pcase--subtype-bitsets): New function and constant. (pcase--mutually-exclusive-p): Use them. * lisp/emacs-lisp/cl-preloaded.el (built-in-class): Don't inline.
* | (pp-fill): Cut before parens and dotsStefan Monnier2024-03-221-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `pp-fill` code sometimes end up generating things like: (foo . bar) instead of (foo . bar) so make sure we cut before rather than after the dot (and open parens while we're at it). * lisp/emacs-lisp/pp.el (pp-fill): Cut before parens and dots. * test/lisp/emacs-lisp/pp-tests.el (pp-tests--dimensions): New function. (pp-tests--cut-before): New test.
* | * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-93): Add test.Andrea Corallo2024-03-191-3/+2
| |
* | EIEIO: Fix regession (bug#69631)Stefan Monnier2024-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Not sure why earlier tests did not catch it, but there are more places where we bump into problems because `eieio--class-precedence-list` now returns also non-EIEIO classes. * lisp/obsolete/eieio-compat.el (eieio--generic-static-object-generalizer): * lisp/emacs-lisp/eieio-core.el (eieio--generic-generalizer) (eieio--generic-subclass-specializers): Handle non-EIEIO parents. * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el (eieio-test-method-order-list-7): Adjust test.
* | Single string literal in body is return value only, not doc stringMattias Engdegård2024-03-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A function or macro body consisting of a single string literal now only uses it as a return value. Previously, it had the dual uses as return value and doc string, which was never what the programmer wanted and had some inconvenient consequences (bug#69387). This change applies to `lambda`, `defun`, `defsubst` and `defmacro` forms; most other defining forms already worked in the sensible way. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Don't use a lone string literal as doc string. * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el (foo): Update docstring warning test. * doc/lispref/functions.texi (Function Documentation): Update. * etc/NEWS: Announce.
* | Revert "Update some native comp tests"Stefan Monnier2024-03-041-1/+1
| | | | | | | | | | | | | | This reverts commit 4a0d430bdc3650ca3dfd8bdd14781764fbcbdc7e. AFAICT that commit was made to accomodate regressions introduced in the new `cl-preloaded.el` code and these have been fixed.
* | Repair miscompilation of single-arg `apply` (bug#69533)Mattias Engdegård2024-03-041-0/+3
| | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-apply): Don't optimise single-argument `apply`; it's a legacy construct. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* | * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-62): Revert change.Andrea Corallo2024-03-031-2/+2
| |
* | Merge branch 'feature/type-hierarchy' into 'master'Andrea Corallo2024-03-011-2/+2
|\ \
| * \ Merge remote-tracking branch 'origin/master' into 'feature/type-hierarchy'Andrea Corallo2024-02-286-27/+60
| |\ \
| * | | Update some native comp testsAndrea Corallo2024-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/comp-tests.el (comp-tests-ret-type-spec-13) (comp-tests-ret-type-spec-35): Update. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-test-62) (comp-cstr-test-75): Likewise.