summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Don't distort character ranges in rx translationMattias Engdegård2023-07-171-1/+11
| | | | | | | | | | | | | | | | | The Emacs regexp engine interprets character ranges from ASCII to raw bytes, such as [a-\xfe], as not including non-ASCII Unicode at all; ranges from non-ACII Unicode to raw bytes, such as [ü-\x91], are ignored entirely. To make rx produce a translation that works as intended, split ranges that that go from ordinary characters to raw bytes. Such ranges may appear from set manipulation and regexp optimisation. * lisp/emacs-lisp/rx.el (rx--generate-alt): Split intervals that straddle the char-raw boundary when rendering a string regexp from an interval set. * test/lisp/emacs-lisp/rx-tests.el (rx-char-any-raw-byte): Add test cases.
* Provide backtrace for byte-ops car, cdr, setcar, setcdr, nth and eltMattias Engdegård2023-07-141-0/+58
| | | | | | | | | | | | | | Include calls to these primitives from byte-compiled code in backtraces. For nth and elt, not all errors are covered. (Bug#64613) * src/bytecode.c (exec_byte_code): Add error backtrace records for car, cdr, setcar, setcdr, nth and elt. * src/data.c (syms_of_data): Add missing defsyms for car, setcar, setcdr, nth and elt. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--error-frame, bytecomp-tests--byte-op-error-cases) (bytecomp--byte-op-error-backtrace): New test.
* cl-print: Put buttons on ellipsesStefan Monnier2023-07-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in *Backtrace* we have a nice behavior for cl-printed objects where they're truncated by default to a manageable size but we can click on the "..." to expand them when needed. The patch below moves that functionality to `cl-print.el` such that it can be enjoyed "everywhere" (bug#64536). It also has the benefit of simplifying the code since `backtrace.el` had to look for ellipses in order to add buttons to them, whereas now we can put the ellipses right when we write them. * lisp/emacs-lisp/cl-print.el (cl-print-object-contents): Improve docstring. (cl-print-expand-ellipsis-function): New var. (cl-print--default-expand-ellipsis): New function. (cl-print-expand-ellipsis): New command. (cl-print-insert-ellipsis): Allow nil instead of 0 to mean "this elides the whole object". (cl-print-ellipsis): Move button type from `backtrace.el`. (cl-print-propertize-ellipsis): Put a button. (cl-print--expand-ellipsis): Rename from `cl-print-expand-ellipsis`. (cl-print-to-string-with-limit): Allow new value t for `limit`. * lisp/emacs-lisp/backtrace.el (backtrace--font-lock-keywords): Simplify. (backtrace--match-ellipsis-in-string): Delete function. (backtrace--change-button-skip): Adjust to new button type name. (backtrace--expand-ellipsis): New function, extracted from `backtrace-expand-ellipsis`. (backtrace-expand-ellipsis): Delete function. (backtrace-ellipsis): Move button type to `cl-print.el`. (backtrace--print-to-string): Don't look for cl-print ellipses any more. (backtrace-mode): Use `backtrace--expand-ellipsis`. * lisp/ielm.el (ielm--expand-ellipsis): New function. (inferior-emacs-lisp-mode): Use it to fill the data when expanded. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-check-ellipsis-expansion) (cl-print-tests-check-ellipsis-expansion-rx): Adjust to new internal function name.
* cl-macs-tests.el (cl-&key-arguments): Fix regressionStefan Monnier2023-06-271-2/+4
| | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-form): Turn "cannot use lexical var" errors into warnings. Make the obey `with-suppressed-warnings`. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): Suppress warnings.
* cl-defsubst: Use static scoping for argsStefan Monnier2023-06-231-1/+11
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--slet): New function, partly extracted from `cl--slet*`. (cl--slet*): Use it. (cl--defsubst-expand): Use it to fix bug#47552. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-defstruct-dynbound-label): New test.
* cl-defun/cl-struct: Use static scoping for function argsStefan Monnier2023-06-231-1/+9
| | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--slet*): New function. (cl--transform-lambda): Use it to fix bug#47552. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): Add test.
* Don't compile (+ X 0) as (* X 1)Mattias Engdegård2023-06-211-0/+4
| | | | | | | | | | Previously (+ X 0) was reduced to (+ X) which became (* X 1) in codegen, but this is wrong for X = -0.0 and also slightly slower. * lisp/emacs-lisp/byte-opt.el (byte-optimize-plus): Don't reduce an addition to (+ X) by eliminating zeros; retain one 0 argument. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* Prefix syntax for ,@ in elisp-mode (bug#44418)Mattias Engdegård2023-06-211-0/+1
| | | | | | | | * lisp/progmodes/elisp-mode.el (elisp-mode-syntax-propertize): Use prefix syntax for ,@ to avoid the @ becoming part of a symbol that follows. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env): Propertise inserted Lisp code to keep the test working.
* pp-fill: Fix tests breakageStefan Monnier2023-06-172-3/+7
| | | | | | | | | | | | | * lisp/emacs-lisp/pp.el (pp-to-string, pp-buffer, pp): Preserve old behavior of (almost always) returning a trailing newline. * test/lisp/emacs-lisp/pp-tests.el (pp-print-quote): Adjust tests, now that `pp-to-string` always returns a trailing newline, rather than only most of the time. * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--single-and-multi-line): Make the test less sensitive to the choice of what is "pretty".
* Merge from origin/emacs-29Eli Zaretskii2023-06-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0d8b69e0ad3 Don't ding when completion succeeded f11e2d36999 ; * admin/git-bisect-start: Update failing commits 9855a3ea744 ; * src/xdisp.c (redisplay_tool_bar): Fix a typo in a com... f4ee696b887 Improve documentation of color-related functions 90eadc3e234 Revert "* package.el (package--get-activatable-pkg): Pref... 65f355ea0a3 ; Update my mail address a3a69ec2342 Fix connection-local user options handling (bug#63300) 240803cc3e1 Document 'startup-redirect-eln-cache' 026afb22984 ; * etc/PROBLEMS: Entry about crashes due to anti-virus (... bcc222251e1 Fix `emacs-lisp-native-compile-and-load' for C-h f (bug#5... 07c8211ca30 Add 'infer' as a keyword to typescript-ts-mode (bug#63880) dd2d8ff2f5c ; * etc/NEWS: Mention the issue with PGTK on WSL (bug#633... fa8135f8916 Revert changes to the order in which package descs are lo... 27fcfa2c0a7 ; * etc/NEWS: Improve instructions for grammar libraries. 2a84ab905c8 Handle point in last file-name component in minibuffer co... 05f25238b7b Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 4bc043ff45d Avoid asking redundant question in emacsbug.el 2eadf328d05 * test/infra/Dockerfile.emba (emacs-base): Don't install ... 583ba1db7ee typescript-ts-mode: Add a rule for function_signature # Conflicts: # etc/NEWS # lisp/minibuffer.el
| * ; Update my mail addressAndrea Corallo2023-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el: Update author mail. * lisp/emacs-lisp/comp.el: Likewise. * src/comp.c: Likewise. * test/lisp/emacs-lisp/comp-cstr-tests.el: Likewise. * test/src/comp-resources/comp-test-funcs-dyn.el: Likewise. * test/src/comp-resources/comp-test-funcs.el: Likewise. * test/src/comp-resources/comp-test-pure.el: Likewise. * test/src/comp-tests.el: Likewise.
* | Clean up defcustom type quote checkMattias Engdegård2023-05-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--suspicious-defcustom-choice): Rename to... (byte-compile--defcustom-type-quoted): ...this and rewrite to make more sense. All callers updated. (byte-compile-nogroup-warn): Better warning message. * test/lisp/emacs-lisp/bytecomp-tests.el (test-bytecomp-defgroup-choice): This never failed because it wasn't actually a test. Turn it into... (bytecomp-test-defcustom-type-quoted): ...this, which is.
* | package-tests.el: Add test for last changeStefan Monnier2023-05-261-3/+8
| | | | | | | | | | * test/lisp/emacs-lisp/package-tests.el (package-test-desc-from-buffer): Make sure the absence of the terminating comment does not matter.
* | ; eieio-test-persist.el: namespace hygieneMattias Engdegård2023-05-251-3/+3
| | | | | | | | | | * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (hash-equal): Rename to `eieio-test--hash-equal`.
* | Don't mutate constants in testsMattias Engdegård2023-05-134-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-ellipsis-circular): * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (eieio-test-persist-interior-lists): * test/lisp/textmodes/reftex-tests.el (reftex-all-used-citation-keys): * test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing): * test/src/fns-tests.el (test-vector-delete): Mutate created objects, not constants. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-add-display-text-property): Mutate a created string, and compare using `equal-including-properties` without which the test was rather meaningless. * test/lisp/net/tramp-archive-tests.el (tramp-archive-test16-directory-files): Don't mutate.
* | Use `mutate-constant` as warning identifierMattias Engdegård2023-05-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): * lisp/emacs-lisp/bytecomp.el (byte-compile-warnings) (byte-compile-form): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Use the new warning name `mutate-constant` instead of using the somewhat overloaded `suspicious`.
* | Byte-compiler warning about mutation of constant valuesMattias Engdegård2023-05-131-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we can easily detect mutation of constants (quoted lists, strings and vectors), warn. For example, (setcdr '(1 . 2) 3) (nreverse [1 2 3]) (put-text-property 0 3 'face 'highlight "moo") Such code can result in surprising behaviour and problems that are difficult to debug. * lisp/emacs-lisp/bytecomp.el (byte-compile-form, mutating-fns): Add the warning and a list of functions to warn about. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test cases.
* | Make old-struct test more robustMattias Engdegård2023-05-051-2/+2
| | | | | | | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (old-struct): Use the `vector` constructor instead of vector literals to avoid failing because of `type-of` constant-folding.
* | Don't rewrite (nconc X nil) -> X for any X (bug#63103)Mattias Engdegård2023-04-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the last cdr of a non-terminal argument to `nconc` is overwritten no matter its value: (nconc (cons 1 2) nil) => (1) a terminating nil arg cannot just be eliminated unconditionally. * lisp/emacs-lisp/byte-opt.el (byte-optimize-nconc): Only eliminate a terminal nil arg to `nconc` if preceded by a nonempty proper list. Right now we only bother to prove this for `(list ...)`, so that (nconc (list 1 2 3) nil) -> (list 1 2 3) * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* | Pacify byte-compiler warnings in nadvice-testsBasil L. Contovounesios2023-04-091-7/+9
| | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/nadvice-tests.el (advice-test-called-interactively-p) (advice-test-called-interactively-p-around) (advice-test-called-interactively-p-filter-args) (advice-test-call-interactively): Heed advertised-calling-convention of called-interactively-p to pacify byte-compiler warnings.
* | Consolidate existing warnings about unused return valuesMattias Engdegård2023-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the warning about unused return values from calls to side-effect-free functions from the source-level optimiser to the code generator, where it can be unified with the special-purpose warning about unused values from `mapcar`. This change also cures spurious duplicate warnings about the same code, makes the warnings amenable to suppression through `with-suppressed-warnings`, and now warns about some unused values that weren't caught before. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Move warning away from here. * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): * lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Doc string updates. (byte-compile-form): Put the new warnings here. (byte-compile-normal-call): Move mapcar warning away from here. * lisp/emacs-lisp/bytecomp.el (byte-compile-ignore): Compile args to `ignore` for value to avoid unused-value warnings, and then discard the generated values immediately thereafter. Mostly this does not affect the generated code but in rare cases it might result in slightly worse code. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Adapt test.
* | Remove useless unwind-protect forms, or make them useful as intendedMattias Engdegård2023-04-071-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/imenu.el (imenu--generic-function): * lisp/mail/yenc.el (yenc-decode-region): * lisp/textmodes/table.el (table-recognize-region): * test/lisp/dired-tests.el (dired-test-directory-files): * test/lisp/hl-line-tests.el (hl-line-tests-sticky): Fix unwind-protect bracketing mistakes that caused the unwind code to be misplaced. * lisp/strokes.el (strokes-read-stroke): Fix a bracketing mistake that misplaced the unwind code, and another one that misplaced the else-clause of an `if` form. * test/lisp/gnus/mml-sec-tests.el (mml-secure-test-fixture): Fix a bracketing mistake that misplaced the unwind code, and remove superfluous condition-case. * lisp/mwheel.el (mouse-wheel-global-text-scale): * lisp/speedbar.el (speedbar-stealthy-updates) (speedbar-fetch-dynamic-etags): * lisp/emacs-lisp/edebug.el (edebug--recursive-edit): * lisp/emacs-lisp/package.el (package--read-pkg-desc): * lisp/cedet/semantic.el (semantic-refresh-tags-safe): * lisp/emulation/viper-cmd.el (viper-escape-to-state): * lisp/emulation/viper-cmd.el (viper-file-add-suffix): * lisp/gnus/mail-source.el (mail-source-movemail): * lisp/mail/feedmail.el (feedmail-send-it-immediately) (feedmail-deduce-address-list): * lisp/mail/mailclient.el (mailclient-send-it): * lisp/mail/smtpmail.el (smtpmail-deduce-address-list): * lisp/mh-e/mh-print.el (mh-ps-print-range): * lisp/textmodes/reftex-index.el (reftex-index-this-phrase): * test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-batch): (ert-test-run-tests-batch-expensive): Remove unwind-protect forms that are apparently useless, some since a prior edit that removed their purpose, some since their first appearance. * test/lisp/subr-tests.el (subr-test--frames-2): Insert dummy unwind form in backtrace test code.
* | Warn about unwind-protect without unwind formsMattias Engdegård2023-03-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `unwind-protect` without unwind forms is not just pointless but often indicates a mistake where the intended unwind part is misplaced, as in (unwind-protect (progn PROT-FORMS UNWIND-FORMS)) ; oops or (unwind-protect PROT-FORM) UNWIND-FORMS ; also oops or entirely forgotten for that matter. Warning about this makes sense, and the warning can always be silenced by removing the `unwind-protect` altogether if it shouldn't be there in the first place. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Implement warning. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test case.
* | Merge from origin/emacs-29Stefan Monnier2023-03-271-0/+4
|\| | | | | | | | | | | | | | | | | | | 0337131bfa1 Update to Transient v0.3.7-218-g3dbb22a a8c23677d39 Update to Org 9.6.2 45b16bfb496 Skip failing tests on Cygwin with native compilation (bug... 8b4a494d8d4 Fix GNUSTEP tests on EMBA # Conflicts: # test/infra/gitlab-ci.yml
| * Skip failing tests on Cygwin with native compilation (bug#62450)Ken Brown2023-03-261-0/+4
| | | | | | | | | | | | | | | | | | * test/Makefile.in (TEST_NATIVE_COMP): New variable, used to determine whether to run tests tagged with :nativecomp. Set it to "no" on Cygwin and to $(HAVE_NATIVE_COMP) otherwise. * test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests): Skip on Cygwin with native-compilation.
* | Fix shortdoc-tests when Unicode arrows can be displayedMattias Engdegård2023-03-251-6/+24
| | | | | | | | | | | | | | | | | | | | New shortdoc functions use Unicode arrows when possible, which caused some tests to fail if run under such circumstances. * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-tests--to-ascii): New function. (shortdoc-function-examples-test) (shortdoc-help-fns-examples-function-test): Call it.
* | Repair and speed up safe-copy-tree and make it internal (bug#61962)Mattias Engdegård2023-03-121-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no particular requirement for safe-copy-tree so let's make it internal for now. The new implementation is faster and more correct. * doc/lispref/lists.texi (Building Lists): * etc/NEWS: Remove doc and announcement. * lisp/subr.el (safe-copy-tree--seen, safe-copy-tree--1) (safe-copy-tree): Remove old version. * lisp/emacs-lisp/bytecomp.el (bytecomp--copy-tree-seen) (bytecomp--copy-tree-1, bytecomp--copy-tree): Add new version. (byte-compile-initial-macro-environment): Use it. * test/lisp/subr-tests.el (subr--safe-copy-tree): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--copy-tree): Move and improve tests.
* | Fix pluralization in shortdoc-help-fns-examples-functionDaniel Martín2023-03-121-0/+15
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-help-fns-examples-function): Implement a better logic to pluralize "Example", by counting the number of arrow characters in the example string. (Bug#61877) * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-help-fns-examples-function-test): Add a test.
* | Add functions to query Emacs Lisp examples registered in shortdocDaniel Martín2023-03-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Add a new shortdoc-example text property so that ELisp examples can be searched for later. (shortdoc--insert-group-in-buffer): New function extracted from the buffer insertion code in 'shortdoc-display-group'. (shortdoc-display-group): Implement in terms of 'shortdoc--insert-group-in-buffer'. (shortdoc-function-examples): New function that returns an alist of Emacs Lisp examples from shortdoc. (shortdoc-help-fns-examples-function): New function to insert Emacs Lisp function examples in *Help* buffers, if added to 'help-fns-describe-function-functions'. * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-function-examples-test): Test it. * doc/emacs/help.texi (Name Help): Document in the user manual. * doc/lispref/help.texi (Documentation Groups): Document it. * etc/NEWS: Advertise it. (Bug#61877)
* | Don't modify interactive closures destructively (Bug#60974).Vibhav Pant2023-03-061-0/+12
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv-convert): When form is an interactive lambda form, don't destructively modify it, as it might be a constant literal. Instead, create a new list with the relevant place(s) changed. * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests-interactive-form-modify-bug60974): New test.
* | Fix `cond` miscompilation bugMattias Engdegård2023-03-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug that miscompiled (cond ... C S1...Sn) where S1...Sn are switch clauses (that can be compiled into a switch op) and C a non-switch clause, by tucking on an extra copy of C at the end. This was a serious wrong-code bug when the condition of C had side-effects; otherwise it was only a waste of time and space. * lisp/emacs-lisp/bytecomp.el (byte-compile-cond): Fix. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* | Warn about `condition-case` without handlersMattias Engdegård2023-02-271-0/+6
| | | | | | | | | | | | | | | | | | | | Omitting handlers from a `condition-case` form makes it useless since no errors are caught. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): New warning. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test case. * etc/NEWS: Announce.
* | (bytecomp-warn--ignore): New testStefan Monnier2023-02-251-2/+10
| | | | | | | | | | | | | | Add tests for the interaction of `ignore` with warnings. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn--ignore): New test. (bytecomp--with-warning-test): Really make it a function.
* | bytecomp--with-warning-test: Make it a functionStefan Monnier2023-02-251-6/+7
| | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (bytecomp--with-warning-test): Make it a function.
* | ; * test/lisp/emacs-lisp/nadvice-tests.el: suppress some warningsMattias Engdegård2023-02-211-1/+7
| |
* | Don't rely on dynamic scoping to fix bug#59213Stefan Monnier2023-02-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than look up a dynamically scoped var to decide whether to trim closures, use an ad-hoc marker on those closures which should not be trimmed. * lisp/emacs-lisp/cconv.el (cconv-dont-trim-unused-variables): Delete var. (cconv-make-interpreted-closure): Use a `:closure-dont-trim-context` markers instead. * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Use `:closure-dont-trim-context` rather than `cconv-dont-trim-unused-variables`. * lisp/emacs-lisp/testcover.el (testcover-analyze-coverage): Remove workaround for `cconv-dont-trim-unused-variables`. * test/lisp/emacs-lisp/cconv-tests.el (cconv-safe-for-space): New test.
* | Fix test errors when run with fancy charset (bug#61534)Mattias Engdegård2023-02-161-1/+3
| | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals, test-suppression): Bind `text-quoting-style` to `grave` around tests to force generation of ASCII quotes. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): Subject the reference string to the same text styling as that under scrutiny.
* | nadvice: Fix bug#61179Stefan Monnier2023-02-041-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advising interactive forms relies on the ability to distinguish interactive forms that do nothing else than return a function. So, be careful to preserve this info. Furthermore, interactive forms are expected to be evaluated in the lexical context captured by the closure to which they belong, so be careful to preserve that context when manipulating those forms. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form) <lambda>: Preserve the info that an interactive form does nothing else than return a function. * lisp/emacs-lisp/nadvice.el (advice--interactive-form-1): New function. (advice--interactive-form): Use it. (advice--make-interactive-form): Refine to also accept function values quoted with `quote`. Remove obsolete TODO. * test/lisp/emacs-lisp/nadvice-tests.el: Don't disallow byte-compilation. (advice-test-bug61179): New test. * lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): Allow the `if` arg to be a form. * lisp/simple.el (oclosure-interactive-form): Adjust accordingly.
* | ; * cl-lib-tests.el: Suppress for the right function.Mattias Engdegård2023-01-031-1/+1
| |
* | Merge from origin/emacs-29Stefan Kangas2023-01-022-2/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4520f09dd8b ; * admin/git-bisect-start: Update failing commits 2569ede9c49 Update to Org 9.6-81-g563a43 d9ed736f0a7 ruby-ts-mode: Remove some currently unused functions 45618447203 ruby-ts-mode: Highlight singleton method definitions and ... 0562006da3b Add ruby-ts-mode 84e7c2fbc85 Fix fontification of C++ reference return types (bug#60441) 1864b65af60 ; Minor fix for treesit--install-language-grammar-1 (bug#... 8994f87ad40 Adjust function-call fontification in csharp-ts-mode (bug... 411647a3f65 ; Fix NEWS. 7b0b17df67e Rewrite Antinews in ELisp manual for Emacs 29 f12f72b0e09 ; * lisp/simple.el (primitive-undo): Clarify error messag... 7fd822e7f52 Update Antinews in the user manual for Emacs 29 da77d70deeb ; * test/lisp/emacs-lisp/copyright-tests.el: Fix and futu... 2baf9e107c1 Fix shortdoc-tests failure with respect to regexp-opt-cha... 5aeb8de32ee ; Fix copyright years in 2 more files. # Conflicts: # etc/NEWS
| * ; * test/lisp/emacs-lisp/copyright-tests.el: Fix and future-safe.Mattias Engdegård2023-01-011-2/+4
| |
| * Fix shortdoc-tests failure with respect to regexp-opt-charsetMattias Engdegård2023-01-011-0/+1
| | | | | | | | | | | | * test/lisp/emacs-lisp/shortdoc-tests.el (regexp-opt): Require. `regexp-opt-charset` is not autoloaded, and whether `regexp-opt` is preloaded is configuration-dependent.
* | Merge from origin/emacs-29Eli Zaretskii2023-01-0172-72/+72
|\| | | | | | | | | | | | | | | | | | | | | cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
| * ; Add 2023 to copyright years.Eli Zaretskii2023-01-0172-72/+72
| |
* | Merge from origin/emacs-29Eli Zaretskii2023-01-011-0/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 72a81e2022 ; * lisp/treesit.el (treesit-simple-indent-presets): Fix t... ddfeee3e8a Build recipe interactively in treesit-install-language-gra... 6837469780 ; Add REVISION to treesit-language-source-alist 0dc788aa01 ; Remove GRAMMAR-DIR from treesit-language-source-alist f9aef67c36 Tweak csharp-mode font-lock-settings (bug#60376) 46362c0a3a ; * doc/lispref/tips.texi (Documentation Tips): Add indexing. 9a386b682e Revert a recent change which causes errors 9871ee8b14 ; More fixes for documentation of 'defalias' f309651b67 ; Fix handling of 'not' by 'buffer-match-p' 9292f595a7 ; Fix typos 43c7e05a2a Fix misspelled functions in shortdoc groups 01acecc79c Simplify introduction of use-package manual 2a7e072e53 ; Fix documentation of 'defalias' eee2aeca25 Fix python-shell-buffer-substring when retrieving a single... bfdad6c4e5 ; Fix recent treesit-related changes
| * Fix misspelled functions in shortdoc groupsStefan Kangas2022-12-311-0/+9
| | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (file, list): Fix misspelled function names: 'file-writable-p' and 'seq-reduce'. * test/lisp/emacs-lisp/shortdoc-tests.el (subr-x): Require. (shortdoc-all-functions-fboundp): New test.
* | ; remove incorrect quoting of condition namesMattias Engdegård2022-12-301-1/+1
| |
* | Consistent empty-body warning messages for let and let*Mattias Engdegård2022-12-291-2/+2
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Make warning messages for let and let* consistent with other empty-body warnings.
* | Add empty-body warning for when, unless etcMattias Engdegård2022-12-291-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn about code like (when SOME-CONDITION) because these may indicate bugs. Warnings currently apply to `when`, `unless`, `ignore-error`, `with-suppressed-warnings` and (as before) `let` and `let*`. * lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Update doc string. * lisp/emacs-lisp/bytecomp.el: (byte-compile-warning-types) (byte-compile-warnings): Add empty-body. (byte-compile-initial-macro-environment): Add empty-body warning for with-suppressed-warnings. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use the empty-body category for let and let*. * lisp/subr.el (when, unless, ignore-error): Add empty-body warning. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Add test cases.
* | Warn about `condition-case' with quoted condition namesMattias Engdegård2022-12-291-0/+5
| | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case): Add warning. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-warn-quoted-condition): Add test case.