summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Merge from origin/emacs-29Stefan Kangas2022-12-251-0/+39
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c36fe3df17b Fix c-ts-mode imenu defun name (bug#60296) a24e350170e Fix treesit--children-covering-range-recurse (bug#60301) fbb4eb919b4 Support treesit-defun-name in tree-sitter major modes 6253184afc2 ; * lisp/treesit.el (treesit-defun-at-point): Guard again... f8e219ebfaa Add treesit-defun-name and friends 35c2ca2ca64 Make treesit-node-at/on guess language at point 7f7def2ae62 ; Add treesit-no-parser error b6a2e1ddf66 * nt/INSTALL.W64: update instructions for setting up W64 ... 265b91d891a Revert "; Bump minimum supported Windows version for MinG... 75155e45860 ; Bump minimum supported Windows version for MinGW64 to W... 677f6c79eb9 ; Update minimum requirements of MinGW-w64 7723af5e4aa ; * lisp/progmodes/c-ts-mode.el: quote literal string in ... 38866510c7c ; * src/xdisp.c (redisplay_internal): Reinstate the FRAME... a825aa0b135 Fix definition of CNS 11643-15 charset a42b20dd95e ; * lisp/progmodes/c-ts-mode.el: Add outline section head... e4e36345399 Improve c-ts-mode block comment indent (bug#60270) e30621caa2c ; Add treesit_recursion_limit 6a43af58802 Fix block comment indent and filling for c-ts-mode (bug#5... e492c21e810 Fix treesit_cursor_helper (bug#60267) 4437dbedf7b Fix restart-emacs alarms (Bug#60220) 121a9ff9f6f Fix alternate stack test in configure 84888080eea Add more functions to "string" shortdoc c90f97d4e5d Make the Contour terminal an alias of xterm-256color c3fac9465fa ; Fix punctuation in last change. 756bb422a49 Correct wrong info in (info)Go to node a8c3424d28b Fix typo in TUTORIAL.fr (bug#60261) 24cd2f0daf1 Add some diff-fixup-modifs tests d32091199ae Fix quoted argument in emacsclient-mail.desktop Exec key 286c48137f6 ert-x: Move window selection logic to its own macro 823c49cea85 ; ert-x: Simplify `ert-with-test-buffer-selected' 38c6abe4d0b ; ert-x: Add test for buffer read-only state 0e39ad6fa56 Fix crash after X error
| * ert-x: Move window selection logic to its own macroRichard Hansen2022-12-241-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-buffer-selected): New macro to temporarily display a buffer in a selected window and evaluate a body. (ert-with-test-buffer-selected): Use the new macro. * test/lisp/whitespace-tests.el (ert-test-with-buffer-selected/current) (ert-test-with-buffer-selected/selected) (ert-test-with-buffer-selected/nil-buffer) (ert-test-with-buffer-selected/modification-hooks) (ert-test-with-buffer-selected/read-only) (ert-test-with-buffer-selected/return-value): Add tests. (Bug#60189)
| * ; ert-x: Add test for buffer read-only stateRichard Hansen2022-12-241-0/+5
| | | | | | | | | | | | | | | | This test should have been included with commit 29b7d740006fe2190a729bd1c30ccab9356cee36. * test/lisp/emacs-lisp/ert-x-tests.el (ert-test-with-test-buffer-selected/read-only): New test. (Bug#60189)
* | Fix condition-case empty success handler misinterpretationMattias Engdegård2022-12-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | (condition-case X E (:success)) should return nil; the compiler behaves correctly in this case. * src/eval.c (internal_lisp_condition_case): Evaluate an empty :success handler as nil instead of pretending it isn't there. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* | Fix condition-case body for-effect miscompilationMattias Engdegård2022-12-241-0/+48
| | | | | | | | | | | | | | | | | | | | | | (condition-case x A (:success B)) should not compile A for-effect even if the entire form is in for-effect context. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't optimise the condition-case body form for effect (potentially discarding its value) if there is a success handler and a variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* | Use equal and member instead of eq and memqMattias Engdegård2022-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/complete.el (semantic-displayer-show-request): * lisp/descr-text.el (describe-char-categories): * lisp/mh-e/mh-identity.el (mh-select-identity): * lisp/transient.el (transient--delay-post-command) (transient--post-command): * lisp/vc/vc-git.el (vc-git-create-tag): * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-nth-value-test-multiple-values): * lisp/emulation/viper-cmd.el (viper-preserve-cursor-color): Use `equal` instead of `eq` and `member` instead of `memq` where the comparison is with literals without guaranteed identity. In some cases this change corrects evident bugs, in others it is mostly cosmetic.
* | Merge from origin/emacs-29Stefan Kangas2022-12-191-1/+1
|\| | | | | | | | | | | de2239a584a Revert "alist-get testfn argument evaluation correction" 856d889f3a8 Revert "Elide broken but unnecessary `if` optimisations" 8e42e20ed7f Revert "Use equal and member instead of eq and memq"
| * Revert "Use equal and member instead of eq and memq"Eli Zaretskii2022-12-161-1/+1
| | | | | | | | | | | | | | This reverts commit f4b430140f0866f98bbf18b7094348dc64032813. Please don't install anything on the release branch that is not strictly necessary fro Emacs 29.
| * Use equal and member instead of eq and memqMattias Engdegård2022-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/complete.el (semantic-displayer-show-request): * lisp/descr-text.el (describe-char-categories): * lisp/mh-e/mh-identity.el (mh-select-identity): * lisp/transient.el (transient--delay-post-command) (transient--post-command): * lisp/vc/vc-git.el (vc-git-create-tag): * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-nth-value-test-multiple-values): * lisp/emulation/viper-cmd.el (viper-preserve-cursor-color): Use `equal` instead of `eq` and `member` instead of `memq` where the comparison is with literals without guaranteed identity. In some cases this change corrects evident bugs, in others it is mostly cosmetic.
* | Suppress memql warning in testMattias Engdegård2022-12-181-1/+2
| | | | | | | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-adjoin-test): Suppress warning about `memql` argument inside expansion of `cl-adjoin`.
* | Warn about lambda expressions in comparisonsMattias Engdegård2022-12-181-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lambda expressions are not comparable; warn about calls such as (eq x (lambda ...)) etc. * lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg): Rename to... (bytecomp--dodgy-eq-arg-p): ...this. Use pcase. Add lambda checks. (bytecomp--value-type-description, bytecomp--arg-type-description) (bytecomp--check-eq-args, bytecomp--check-memq-args): Add function checks. Update calls. Make compiler-macro arguments optional to avoid crashes in malformed code. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test): Simplify argument. Run each compilation with a fresh (empty) warning cache. Add ert-info for easier debugging. (bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq): Add lambda tests.
* | Use equal and member instead of eq and memqMattias Engdegård2022-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/complete.el (semantic-displayer-show-request): * lisp/descr-text.el (describe-char-categories): * lisp/mh-e/mh-identity.el (mh-select-identity): * lisp/transient.el (transient--delay-post-command) (transient--post-command): * lisp/vc/vc-git.el (vc-git-create-tag): * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-nth-value-test-multiple-values): * lisp/emulation/viper-cmd.el (viper-preserve-cursor-color): Use `equal` instead of `eq` and `member` instead of `memq` where the comparison is with literals without guaranteed identity. In some cases this change corrects evident bugs, in others it is mostly cosmetic.
* | Merge from origin/emacs-29Stefan Kangas2022-12-163-9/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 033071692c7 ; Fix typos f4a513344d9 Add lambda_expression-rule to java-ts-mode (bug#60091) 546aed35434 eglot: Add support for new language server csharp-ls cb761eb7ac4 Use the new tree-sitter commands 037407ad95a Add "function" feature to python-ts-mode (bug#59977) fee2efe1b03 Add go-ts-mode and go-mod-ts-mode (Bug#60025) e8f7ab67ad1 Add basic support for hideshow in python-ts-mode (bug#60044) cac070b23e4 Add "this" keyword to java-ts-mode (bug#60086) c8d75046a2f When completing relative project file names, use relative... 3b618d0e3ed Avoid segfaults due to invalid selected-window's buffer # Conflicts: # lisp/progmodes/sh-script.el
| * ; Fix typosStefan Kangas2022-12-163-9/+9
| |
* | Warn about unmatchable constant args to `eq`, `memq` etcMattias Engdegård2022-12-141-3/+51
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Add a byte-compiler warning about attempts to compare literal values with undefined identity relation to other values. For example: (eq x 2.0) (memq x '("a" (b) [c])) Such incomparable values include all literal conses, strings, vectors, records and (except for eql and memql) floats and bignums. The warning currently applies to eq, eql, memq, memql, assq, rassq, remq and delq. * lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg) (bytecomp--value-type-description, bytecomp--arg-type-description) (bytecomp--warn-dodgy-eq-arg, bytecomp--check-eq-args) (bytecomp--check-memq-args): New. (eq, eql, memq, memql, assq, rassq, remq, delq): Set compiler-macro property. * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Amend doc string. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test): Fix text-quoting-style and expand re-warning so that it doesn't need to be a literal. (bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq): New tests.
* Fix pcase rx patterns using rx-let bindings (bug#59814)Mattias Engdegård2022-12-111-0/+6
| | | | | | | | Reported by Daniel Pittman. * lisp/emacs-lisp/rx.el (rx): Move binding of rx--local-definitions... (rx--to-expr): ...here. * test/lisp/emacs-lisp/rx-tests.el (rx-let-pcase): New test.
* ; Normalize GPLv3 license statements in new filesStefan Kangas2022-12-091-7/+5
|
* Fix 'add-display-text-property' when OBJECT is non-nilEli Zaretskii2022-12-061-1/+10
| | | | | | | | * lisp/emacs-lisp/subr-x.el (add-display-text-property): Fix the case where OBJECT is not nil. (Bug#59857) * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-add-display-text-property): Add test for this case.
* Fix and expand tests broken by commit 2772ebe366 of 2022-11-28Juanma Barranquero2022-12-031-24/+31
| | | | | | | | | | * test/lisp/emacs-lisp/comp-tests.el (with-test-native-compile-prune-cache) (test-native-compile-prune-cache) (test-native-compile-prune-cache/delete-only-eln) (test-native-compile-prune-cache/dont-delete-in-parent-of-cache): Check that the last directory in `native-comp-eln-load-path' is not affected by `native-compile-prune-cache'.
* ; Fix typos (don't abbreviate "with" or "without")Stefan Kangas2022-12-011-1/+1
|
* ; Fix typos (prefer US spelling)Stefan Kangas2022-11-181-1/+1
|
* Add missing elpa-package.eld to package test resourcesPhilip Kaludercic2022-11-176-0/+13
|
* Fix &key parameters called without arguments (bug#58714)Gerd Möllmann2022-11-111-0/+6
| | | | | | * lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Check for missing argument. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): New test.
* cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695Stefan Monnier2022-10-281-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | The new code to make interpreted closures safe-for-space introduced a regression in `cconv-tests-interactive-closure-bug51695`, only seen when using TEST_LOAD_EL. A few other issues were found and fixed along the way. * lisp/emacs-lisp/cconv.el (cconv-fv): Change calling convention and focus on finding the free variables. (cconv-make-interpreted-closure): New function. * lisp/loadup.el: Use `compiled-function-p` rather than `byte-code-function-p` so we also use safe-for-space interpreted closures when we build with native compilation. (internal-make-interpreted-closure-function): Use `cconv-make-interpreted-closure`. * src/eval.c (syms_of_eval): Rename `internal-filter-closure-env-function` to `internal-make-interpreted-closure-function`. (Ffunction): Let that new var build the actual closure. * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests-interactive-closure-bug51695): Test specifically the interpreted case.
* Fix failing test for package HierarchyWamm K. D2022-10-281-1/+1
| | | | | | | This fixes a typo in one of the tests of Hierarchy which was causing the test to fail. * test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-delayed-add-trees): Fix typo.
* Allow Hierarchy to delay computation of childrenWamm K. D2022-10-271-0/+143
| | | | | | | | | | | | | | | | This adds an option to allow callers to specify that computing the children of the hierarchy should be delayed to when the user calls for them, by utilizing the tree-widget :expander property. * lisp/emacs-lisp/hierarchy.el (hierarchy-add-tree) (hierarchy-add-trees): Add parameter 'delay-children-p'. * lisp/emacs-lisp/hierarchy.el (hierarchy--create-delayed-tree-widget): Add function. * lisp/emacs-lisp/hierarchy.el (hierarchy-convert-to-tree-widget): Utilize ':expander' if delaying children. (Bug#55900) * test/lisp/emacs-lisp/hierarchy-tests.el: Add tests for delayed-children functionality.
* Audit some plist uses with new predicate argumentBasil L. Contovounesios2022-10-223-58/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Improve description of default predicate. * lisp/emacs-lisp/cl-extra.el (cl-getf, cl--set-getf): Assume plist-member always returns a cons. * lisp/emacs-lisp/gv.el (plist-get): Support new optional predicate argument (bug#47425#91). * lisp/emacs-lisp/map.el: Bump minor version. (map--dispatch): Remove now that bug#58563 is fixed. Break two remaining uses out into corresponding cl-defmethods. (map--plist-p): Add docstring. (map--plist-has-predicate, map--plist-member-1, map--plist-member) (map--plist-put-1, map--plist-put): New definitions for supporting predicate argument backward compatibly. (map-elt): Fix generalized variable getter under a predicate (bug#58531). Use predicate when given a plist. (map-put): Avoid gratuitous warnings when called without the hidden predicate argument. Improve obsoletion message. (map-put!): Use predicate when given a plist. (map-contains-key): Ditto. Declare forgotten advertised-calling-convention (bug#58531#19). (map--put): Group definition in file together with that of map-put!. * lisp/files-x.el (connection-local-normalize-criteria): Simplify using mapcan + plist-get. * lisp/net/eudc.el (eudc--plist-member): New convenience function. (eudc-plist-member, eudc-plist-get, eudc-lax-plist-get): Use it instead of open-coding plist-member. * src/fns.c (Fplist_get, plist_get, Fplist_put, plist_put): Pass the plist element as the first argument to the predicate, for consistency with assoc + alist-get. (Fplist_member, plist_member): Move from widget to plist section. Open-code the EQ case in plist_member, and call it from Fplist_member in that case, rather than the other way around. * test/lisp/apropos-tests.el (apropos-tests-format-plist): Avoid polluting obarray. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): Extend test with generalized variables, degenerate plists, and improper lists. * test/lisp/emacs-lisp/gv-tests.el: Byte-compile file; in the meantime bug#24402 seems to have been fixed or worked around. (gv-setter-edebug): Inhibit printing messages. (gv-plist-get): Avoid modifying constant literals. Also test with a predicate argument. * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Simplify docstring. (test-map-elt-testfn): Rename... (test-map-elt-testfn-alist): ...to this. Also test with a predicate argument. (test-map-elt-testfn-plist, test-map-elt-gv, test-map-elt-signature) (test-map-put!-plist, test-map-put!-signature) (test-map-contains-key-signature, test-map-plist-member) (test-map-plist-put): New tests. (test-map-contains-key-testfn): Also test with a predicate argument. (test-map-setf-alist-overwrite-key, test-map-setf-plist-insert-key) (test-map-setf-plist-overwrite-key): Avoid modifying constant literals. (test-hash-table-setf-insert-key) (test-hash-table-setf-overwrite-key): Fix indentation. (test-setf-map-with-function): Make test more precise. * test/lisp/net/eudc-tests.el: New file. * test/lisp/subr-tests.el (test-plistp): Extend test with circular list. * test/src/fns-tests.el (test-cycle-equal, test-cycle-nconc): Move from plist section to circular list section. (plist-put/odd-number-of-elements): Avoid modifying constant literals. (plist-member/improper-list): Simplify. (test-plist): Move to plist section. Also test with a predicate argument.
* Bindat (src, strz): Operate on vectors tooNacho Barrientos2022-10-211-1/+18
| | | | | | | | | | Copyright-paperwork-exempt: yes * lisp/emacs-lisp/bindat.el (bindat--unpack-str, bindat--unpack-strz): Fix the non-string case. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--strz-array-unpack) (bindat-test--str-simple-array-unpack,bindat-test--str-combined-array-unpack): New tests.
* Silence recent comp-tests.el lexvar warningsBasil L. Contovounesios2022-10-171-19/+23
| | | | | | | | | | * test/lisp/emacs-lisp/comp-tests.el: Mark used native-compile variables as special to pacify unknown lexvar warnings in the default build. (with-test-native-compile-prune-cache): Instrument macro arguments for debugging and indent conventionally. Reindent all callers. (test-native-compile-prune-cache/dont-delete-in-parent-of-cache): Simplify file name expansion.
* Don't prune *.eln files in parent of eln-load-pathStefan Kangas2022-10-171-0/+11
| | | | | | | | * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't prune *.eln files in parent directory of `native-comp-eln-load-path'. * test/lisp/emacs-lisp/comp-tests.el (test-native-compile-prune-cache/dont-delete-in-parent-of-cache): New test.
* Add tests for native-compile-prune-cacheStefan Kangas2022-10-171-0/+62
| | | | * test/lisp/comp-tests.el: New file.
* cl-generic: Fix `advertised-calling-convention` declarationsStefan Monnier2022-10-161-0/+22
| | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Preserve the `advertised-calling-convention`, if any (bug#58563). * lisp/subr.el (declare): Warn when we hit this. * lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun. * lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string): * lisp/help-fns.el (help-fns--signature): * lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun. (cl-generic-tests--advertised-calling-convention-bug58563): New test.
* package.el: Understand a few more variations in tarball formatsStefan Monnier2022-10-083-2/+22
| | | | | | | | | | * lisp/emacs-lisp/package.el (package-untar-buffer): Fix thinko. (package-tar-file-info): Handle the case where the first file is in a subdirectory. * test/lisp/emacs-lisp/package-tests.el (package-test-bug58367): New test. * test/lisp/emacs-lisp/package-resources/ustar-withsub-0.1.tar: * test/lisp/emacs-lisp/package-resources/v7-withsub-0.1.tar: New files.
* Replace aging OpenPGP artifacts in the package-resources tests.Justus Winter2022-10-065-31/+28
| | | | | | | | | | | This replaces the old OpenPGPv4 key that is used in the test suite with a more modern OpenPGPv4 key. The key is the Alice key from https://datatracker.ietf.org/doc/draft-bre-openpgp-samples/. All cryptographic artifacts in the test suite are updated accordingly. Having old cryptographic artifacts in the test suite presents a problem once the old algorithms are rejected by contemporary implementations.
* Add 'seq-keep'Lars Ingebrigtsen2022-10-041-0/+6
| | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
* cconv.el: Fix interactive closure bug#51695Stefan Monnier2022-09-231-0/+10
| | | | | | | | | | | | | | | | | | | | Make cconv.el detect when a closure's interactive form needs to capture variables from the context and tweak the code accordingly if so. * lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var. (cconv-convert): Handle the case where the interactive form captures vars from the surrounding context. Remove left over handling of `declare` which was already removed from the cconv-analyze` phase. (cconv-analyze-form): Adjust analysis of interactive forms accordingly. * lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and function. * lisp/simple.el (function-documentation, oclosure-interactive-form): Add methods for it. * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests-interactive-closure-bug51695): New test.
* Don't rewrite `set` to `setq` of lexical variablesMattias Engdegård2022-09-222-6/+12
| | | | | | | | | | | | | | | Only perform the rewrite (set 'VAR X) -> (setq VAR X) for dynamic variables, as `set` isn't supposed to affect lexical vars (and never does so when interpreted). * lisp/emacs-lisp/byte-opt.el (byte-optimize-set): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New. (bytecomp-tests--test-cases): Add test cases. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el: Remove obsolete test.
* Improve check for misleading 'cl-case' cases (Bug#57915).Philipp Stephani2022-09-191-0/+11
| | | | | | * lisp/emacs-lisp/cl-macs.el (cl-case): Check that the case is of the form (quote FOO), not just (quote). * test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-no-warning): New unit test.
* Accept more wide function signatures in docstringsStefan Kangas2022-09-162-0/+8
| | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-ignore-function-signature.el"): New test. * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Make regexp more allowing to silence warning. * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el: New file.
* Fix recently-added cl-macs testsLars Ingebrigtsen2022-09-141-32/+34
| | | | | * test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-error) (cl-case-warning): Fix warning matches.
* Have 'cl-case' warn about suspicious casesPhilipp Stephani2022-09-131-0/+32
| | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-case): Warn if the user passes a nil key list (which would never match). Warn about quoted symbols that should probably be unquoted. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-warning): New unit test (bug#51368).
* Signal an error if a fallback cl-case is misplacedPhilipp Stephani2022-09-131-0/+11
| | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-case): Warn if the user passes a nil key list (which would never match). Warn about quoted symbols that should probably be unquoted. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-warning): New unit test (bug#51368).
* ert-x: New `ert-with-test-buffer-selected' convenience macroRichard Hansen2022-09-111-0/+15
| | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): New convenience macro that extends `ert-with-test-buffer' by displaying the test buffer in a temporary selected window. This makes it easier to simulate user input in the body via `execute-kbd-macro'. * test/lisp/emacs-lisp/ert-x-tests.el (ert-test-test-buffer-selected/*): Add tests.
* Fix "warn-lambda-malformed-interactive-spec.el" even moreLars Ingebrigtsen2022-09-091-1/+1
| | | | | * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-lambda-malformed-interactive-spec.el"): Adjust test further.
* Don't bind `s' in the normal backtrace mapLars Ingebrigtsen2022-09-091-1/+2
| | | | | | | | | * lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Don't bind the "s" command, because it's meaningless outside modes that have set the backtrace-goto-source-functions variable (and only edebug does that) (bug#57674). * lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Use it. (edebug-backtrace-mode-map, edebug-backtrace-mode): New mode.
* Update a bytecomp testLars Ingebrigtsen2022-09-091-1/+1
| | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-lambda-malformed-interactive-spec.el"): Update test to code change.
* test: Remove redundant "" arg to `mapconcat`Stefan Monnier2022-09-081-1/+1
| | | | | | | | | | | | | | | | | | | * test/src/process-tests.el (process-test-stderr-filter): * test/src/print-tests.el (print-tests-continuous-numbering): * test/src/fns-tests.el (fns-tests-mapconcat): * test/src/data-tests.el (test-bool-vector-to-hex-string): * test/src/casefiddle-tests.el (casefiddle-tests-char-properties) (casefiddle-tests-case-table, casefiddle-tests-casing-character): * test/lisp/tabify-tests.el (tabify-tests--test-changes): * test/lisp/subr-tests.el (subr-tests-bug22027): * test/lisp/sort-tests.el (sort-tests-random-word): * test/lisp/net/hmac-md5-tests.el (hmac-md5-test-encode-string): * test/lisp/md4-tests.el (md4-tests-digest->hex): * test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-map): * test/lisp/dired-tests.el (dired-test-directory-files): * test/lisp/char-fold-tests.el (char-fold--random-word): * test/lisp/ansi-color-tests.el (ansi-color-incomplete-sequences-test): Remove redundant "" arg to `mapconcat`.
* cl-symbol-macrolet: Fix recent regressionStefan Monnier2022-09-062-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent fix for bug#57397 introduced a regression, breaking the `cl-lib-symbol-macrolet-hide` test. It turned out that the origin of the problem was that `gv.el` uses `macroexpand-1` which does not (can't) use `macroexpand` but `cl-symbol-macrolet` failed to advise `macroexpand-1` the way it advised `macroexpand`. To fix this, we change `cl-symbol-macrolet` so it advises both, and we do that with a new `macroexpand` advice which delegates the bulk of the work to `macroexpand-1`. Along the way, I bumped into another bug in the interaction between `cl-letf` and `cl-symbol-macrolet`, which I tried to fix in `cl-letf`. I hear the war on `cl-symbol-macrolet` was a failure. Maybe ... just say no? * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand-1): New function, extracted from `cl--sm-macroexpand`. (cl--sm-macroexpand): Rewrite completely. (cl-symbol-macrolet): Advise both `macroexpand` and `macroexpand-1`. (cl--letf): Don't use the "simple variable" code for symbol macros. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide): Revert last change because the test was right. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add a test case.
* Disable failing cl-lib-symbol-macrolet-hide test for nowLars Ingebrigtsen2022-09-061-0/+3
| | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide): Disable until code is fixed.
* Add new function `seq-positions'Damien Cassou2022-09-041-0/+7
| | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-positions): New function. * lisp/emacs-lisp/shortdoc.el (sequence): Mention it. * test/lisp/emacs-lisp/seq-tests.el (test-seq-positions): Test it (bug#57548).