summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Silence byte-compiler in generator-tests.elStefan Kangas2021-12-051-3/+3
| | | | | * test/lisp/emacs-lisp/generator-tests.el (cps-let*-shadow-empty) (cps-let-shadow-empty, cps-let*-parallel): Silence byte-compiler.
* Silence warnings about testing obsolete functions and macrosStefan Kangas2021-12-054-289/+357
| | | | | | | | * test/lisp/emacs-lisp/cl-generic-tests.el: * test/lisp/emacs-lisp/edebug-tests.el: * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el: * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: Silence byte-compiler warnings about testing obsolete functions and macros.
* Remove hack from seq-tests.el for broken `with-suppressed-warnings'Lars Ingebrigtsen2021-12-051-14/+10
| | | | | | * test/lisp/emacs-lisp/seq-tests.el: `with-suppressed-warnings' now works better in erf-deftests, so remove hack that works around it (bug#36568).
* eieio-core.el: Allow assignment to cl-structs through `slot-value`Stefan Monnier2021-12-041-2/+5
| | | | | | | | | | | | * lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value): Obey the `:read-only` property of the slot. (eieio-oset): Allow use on cl-structs as well. (eieio-read-only): New error. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test--struct): Make the last field read-only. (eieio-test-defstruct-slot-value): Test that cl-struct slots can be assigned via `slot-value`.
* Silence byte-compiler in some testsStefan Kangas2021-12-048-44/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/dired-tests.el: * test/lisp/emacs-lisp/cl-macs-tests.el: * test/lisp/emacs-lisp/derived-tests.el: * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el: * test/lisp/emacs-lisp/generator-tests.el: * test/lisp/emacs-lisp/lisp-tests.el: * test/lisp/emacs-lisp/seq-tests.el (test-seq-let) (test-seq-setq): * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-if-let*-false) (subr-x-test-if-let*-and-laziness-is-preserved) (subr-x-test-when-let*-false) (subr-x-test-when-let*-and-laziness-is-preserved): * test/lisp/emacs-lisp/timer-tests.el (timer-tests-debug-timer-check): * test/lisp/format-spec-tests.el (format-spec-do-flags-truncate) (format-spec-do-flags-pad): * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27762): * test/lisp/obsolete/cl-tests.el (labels-function-quoting): * test/lisp/progmodes/elisp-mode-tests.el: * test/lisp/replace-tests.el (replace-regexp-bug45973): * test/lisp/ses-tests.el: * test/lisp/subr-tests.el: * test/lisp/tar-mode-tests.el (tar-mode-test-tar-grind-file-mode): * test/src/data-tests.el (data-tests--set-default-per-buffer): * test/src/search-tests.el (test-replace-match-modification-hooks): Silence byte-compiler.
* Add `cl-constantly' functionLars Ingebrigtsen2021-12-021-0/+5
| | | | | * lisp/emacs-lisp/cl-lib.el (cl-constantly): Add Common Lisp function missing (bug#21584).
* Fix closure-conversion of shadowed captured lambda-lifted varsMattias Engdegård2021-12-012-0/+195
| | | | | | | | | | | | | | | Lambda-lifted variables (ones passed explicitly to lambda-lifted functions) that are also captured in an outer closure and shadowed were renamed incorrectly (bug#51982). Reported by Paul Pogonyshev. * lisp/emacs-lisp/cconv.el (cconv--lifted-arg): New. (cconv-convert): Provide correct definiens for the closed-over variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests--intern-all) (cconv-closure-convert-remap-var): Add tests.
* Add new function 'add-display-text-property'Lars Ingebrigtsen2021-11-241-0/+18
| | | | | * doc/lispref/display.texi (Display Property): Document it. * lisp/emacs-lisp/subr-x.el (add-display-text-property): New function.
* Avoid false positives about wide docstrings for key sequencesStefan Kangas2021-11-222-0/+21
| | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Ignore literal key sequence substitutions. * test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-substitutions.el: New file. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-ignore-substitutions.el"): New test.
* Make 'eval' use lexical scoping in most testsStefan Kangas2021-11-205-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/electric-tests.el (electric-pair-define-test-form) (define-electric-pair-test): * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--uncompiled-functions): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-list-to-sexp): * test/lisp/emacs-lisp/lisp-tests.el (elisp-tests-with-temp-buffer, core-elisp-tests-3-backquote): * test/lisp/emacs-lisp/testcover-resources/testcases.el (testcover-testcase-nth-case): * test/lisp/ffap-tests.el (ffap-ido-mode): * test/lisp/files-tests.el (file-test--do-local-variables-test): * test/lisp/net/tramp-tests.el (tramp--test-utf8): * test/lisp/progmodes/elisp-mode-tests.el (find-defs-defgeneric-eval, find-defs-defun-eval) (find-defs-defvar-eval, find-defs-face-eval) (find-defs-feature-eval): Give 'eval' non-nil LEXICAL argument. * test/lisp/subr-tests.el (subr-tests--dolist--wrong-number-of-args): * test/src/eval-tests.el (eval-tests--if-dot-string) (eval-tests--mutating-cond) (eval-tests-19790-backquote-comma-dot-substitution): Test 'eval' using LEXICAL as both nil and non-nil. (eval-tests--let-with-circular-defs): Give explicit nil to 'eval'.
* String backslash correctionsMattias Engdegård2021-11-181-1/+1
| | | | | | * lisp/net/shr.el (shr-tag-video): Remove ineffective backslash. * test/lisp/emacs-lisp/package-tests.el (package-test-macro-compilation-gz): Make dot literal as intended.
* Eliminate ERT test name clashes (bug#51941)Mattias Engdegård2021-11-183-9/+2
| | | | | | | | | | | | | | | | | | | * test/lisp/electric-tests.el (js-mode-braces-with-layout-and-indent): * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-fifth): * test/lisp/thingatpt-tests.el (test-symbol-thing-2): Remove duplicated tests. * test/lisp/emacs-lisp/generator-tests.el (cps-loop): * test/lisp/emacs-lisp/ring-tests.el (ring-tests-insert): * test/lisp/help-tests.el (help-tests-substitute-command-keys/no-change): * test/lisp/net/netrc-tests.el (test-netrc-credentials): * test/lisp/progmodes/elisp-mode-tests.el (elisp-completes-functions-after-let-bindings): * test/lisp/thingatpt-tests.el (test-symbol-thing-3): * test/src/buffer-tests.el (deftest-overlayp-1, buffer-tests--*): * test/src/buffer-tests.el (test-buffer-swap-text-1): * test/src/data-tests.el (binding-test-set-constant-nil) (data-tests-logcount): Rename clashing tests.
* Make results details in ert-run-tests-batch configurableMichael Herstine2021-11-162-30/+96
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-batch-print-length) (ert-batch-print-level,.ert-batch-backtrace-line-length) (ert-batch-test, ert-run-tests-interactively): Added the three variables, bound them to these settings when formatting batch test results including backtraces. Removed the optional parameters output-buffer & message-fn from ert-run-tests-interactively. * test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-interactively, ert-test-run-tests-batch): use cl-letf to capture output, new tests resp. * test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2): Changed to use cl-letf to capture output instead of using message-fn. * lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil) (backtrace--print-func-and-args): Fixed a bug when setting backtrace-line-length to nil by adding a new function to check for that case & having backtrace--print-func-and-args use it. * doc/misc/ert.texi: document the new variables & their usage (bug#51037).
* Fix package-tests failure on native-compLars Ingebrigtsen2021-11-101-2/+2
| | | | | * test/lisp/emacs-lisp/package-tests.el (package-test-macro-compilation-gz): Fix test failure on native-comp.
* Delete temp directory after bytecomp testLars Ingebrigtsen2021-11-091-29/+37
| | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--not-writable-directory): Allow deletion of directory (bug#51690). * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--dest-mountpoint): Ditto.
* Prefer ert-with-temp-(directory|file) in most remaining testsStefan Kangas2021-11-082-94/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/auth-source-tests.el (auth-source-test-searches): * test/lisp/autorevert-tests.el (auto-revert-test00-auto-revert-mode) (auto-revert-test01-auto-revert-several-files) (auto-revert-test02-auto-revert-deleted-file) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired) (auto-revert-test05-global-notify) (auto-revert-test06-write-file) (auto-revert-test07-auto-revert-several-buffers): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-cycle): * test/lisp/custom-tests.el (custom-theme--load-path): * test/lisp/dired-aux-tests.el (dired-test-bug27496) (with-dired-bug28834-test): * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load) (bytecomp-tests--dest-mountpoint) (bytecomp-tests--target-file-no-directory): * test/lisp/emacs-lisp/gv-tests.el (gv-tests--in-temp-dir): * test/lisp/eshell/eshell-tests.el (with-temp-eshell) (eshell-test-command-result): * test/lisp/info-xref-tests.el (info-xref-test-makeinfo): * test/lisp/vc/vc-tests.el (vc-test--create-repo) (vc-test--register, vc-test--state, vc-test--working-revision) (vc-test--checkout-model, vc-test--rename-file) (vc-test--version-diff): * test/src/buffer-tests.el (test-kill-buffer-auto-save-delete): * test/src/comp-tests.el (comp-tests-bootstrap): * test/src/process-tests.el (process-test-quoted-batfile): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly.
* Ensure return value of ert-with-temp-directoryStefan Kangas2021-11-071-1/+2
| | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Ensure return value when :directory is t is the directory name. * test/lisp/emacs-lisp/ert-x-tests.el (ert-x-tests-with-temp-directory): Extend test for the above.
* Prefer ert-with-temp-(directory|file)Stefan Kangas2021-11-075-199/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/abbrev-tests.el (read-write-abbrev-file-test) (read-write-abbrev-file-test-with-props) (abbrev-edit-save-to-file-test): * test/lisp/auth-source-tests.el (auth-source-test-netrc-create-secret) (auth-source-delete): * test/lisp/autoinsert-tests.el (autoinsert-tests-auto-insert-file): * test/lisp/bookmark-tests.el (with-bookmark-test-save-load): * test/lisp/buff-menu-tests.el (buff-menu-24962): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-export): * test/lisp/calendar/todo-mode-tests.el (with-todo-test): * test/lisp/dired-tests.el (dired-test-bug27243-01, dired-test-bug27243-02) (dired-test-bug27243-03, dired-test-bug27631) (dired-test-bug27968, dired-test-with-temp-dirs): * test/lisp/dired-x-tests.el (dired-test-bug25942): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-scan) (check-declare-tests-verify-mismatch): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env): * test/lisp/emacs-lisp/package-tests.el (with-package-test) (package-test-signed): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-markup-region) (testcover-tests-run-test-case): * test/lisp/emulation/viper-tests.el (viper-test-undo-kmacro): * test/lisp/epg-tests.el (with-epg-tests): * test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history): * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631): * test/lisp/ffap-tests.el (ffap-tests-25243): * test/lisp/files-tests.el (files-tests-bug-18141) (files-tests-read-file-in-~, files-tests-make-directory) (files-tests-copy-directory, files-tests-executable-find) (files-tests-dont-rewrite-precious-files) (files-tests--save-some-buffers): * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27631): * test/lisp/mail/uudecode-tests.el (uudecode-tests-decode-region-internal) (uudecode-tests-decode-region-external): * test/lisp/net/browse-url-tests.el (browse-url-tests-delete-temp-file): * test/lisp/progmodes/elisp-mode-tests.el (xref--case-insensitive): * test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list): * test/lisp/progmodes/flymake-tests.el (ruby-backend): * test/lisp/progmodes/python-tests.el (python-tests-with-temp-file): * test/lisp/progmodes/sql-tests.el (with-sql-test-connect-harness): * test/lisp/saveplace-tests.el (saveplace-test-save-place-to-alist/file) (saveplace-test-forget-unreadable-files) (saveplace-test-place-alist-to-file): * test/lisp/so-long-tests/spelling-tests.el: * test/lisp/textmodes/reftex-tests.el (reftex-locate-bibliography-files) (reftex-parse-from-file-test): * test/lisp/thumbs-tests.el (thumbs-tests-thumbsdir/create-if-missing): * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726) (vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads): * test/lisp/vc/diff-mode-tests.el (diff-mode-test-ignore-trailing-dashes): * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-bug32173-02, wdired-test-symlink-name) (wdired-test-unfinished-edit-01, wdired-test-bug34915) (wdired-test-bug39280): * test/src/buffer-tests.el (test-kill-buffer-auto-save-default): * test/src/filelock-tests.el (filelock-tests--fixture): * test/src/inotify-tests.el (inotify-file-watch-simple): * test/src/undo-tests.el (undo-test-file-modified): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly. In some cases, this is just cleanup, but in several cases this fixes bugs where an error would have lead to us not cleaning up.
* Add generated suffix to test temp file namesStefan Kangas2021-11-071-0/+9
| | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Add temp file name suffix based on file name of caller. Reflow docstring. (ert--with-temp-file-generate-suffix): New defun. * test/lisp/emacs-lisp/ert-x-tests.el (ert-x-tests--with-temp-file-generate-suffix): New test.
* Fix byte compilation of package built-insdickmao2021-11-075-1/+110
| | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--activate-autoloads-and-load-path): (package--load-files-for-activation): Remove. (package--library-stem): New function, because file-name-sans-extension is insufficient. (package--reload-previously-loaded): New function. (package-activate-1): Reload directly. (package--files-load-history): (package--list-of-conflicts): (package--list-loaded-files): Remove (package-unpack): Adjust call. * test/lisp/emacs-lisp/package-tests.el (macro-builtin-func): Test. (macro-builtin-10-and-90): Test. (package-test-macro-compilation): Test. (package-test-macro-compilation-gz): Test (bug#49708).
* New convenience macros ert-with-temp-(file|directory)Stefan Kangas2021-11-061-0/+46
| | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-temp-file) (ert-with-temp-directory): New macros. * test/lisp/emacs-lisp/ert-x-tests.el (ert-x-tests-with-temp-directory) ert-x-tests-with-temp-directory/text-signals-error (ert-x-tests-with-temp-file) (ert-x-tests-with-temp-file/handle-error) (ert-x-tests-with-temp-file/prefix-and-suffix-kwarg) (ert-x-tests-with-temp-file/text-kwarg) (ert-x-tests-with-temp-file/unknown-kwargs-signals-error): New tests.
* Allow 'pp' to limit the line widthsLars Ingebrigtsen2021-11-051-0/+8
| | | | | | | | * lisp/emacs-lisp/pp.el (pp-max-width, pp-use-max-width): New user options (bug#11934). (pp-to-string): Use it. (pp--insert-lisp): Tweak whether to use standard-output or not. (pp--max-width): New function.
* Tweak multi-line expressions in pp--format-functionLars Ingebrigtsen2021-11-041-1/+12
| | | | | * lisp/emacs-lisp/pp.el (pp--format-function): Fix up multi-line expressions.
* Indent lambdas/closures betterLars Ingebrigtsen2021-11-041-0/+8
| | | | | * lisp/emacs-lisp/pp.el (pp--format-function): Indent lambdas and closures better.
* Add new basic Emacs Lisp code formatting functionLars Ingebrigtsen2021-11-042-0/+101
| | | | | | | | * lisp/emacs-lisp/pp.el (pp-emacs-lisp-code): New interface function. (pp): Mention it. (pp--insert-lisp, pp--format-vector, pp--format-list) (pp--format-function, pp--format-definition, pp--insert-binding) (pp--insert, pp--indent-buffer): New helper functions.
* Optimise (cond) => nil at source levelMattias Engdegård2021-11-021-0/+3
| | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-cond): Optimise clause-free `cond`, which can arise from earlier transformations. This enables further optimisations. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* eieio-core.el: Make slot-value work on defstructsStefan Monnier2021-10-311-0/+12
| | | | | | | | | | | | | | | | | | | | Adjust the values in EIEIO's index-tables so they are compatible with those of defstructs. * lisp/emacs-lisp/eieio-core.el (eieio--slot-name-index): Don't add the `eieio--object-num-slots` offset. (eieio-defclass-internal): Add the `eieio--object-num-slots` offset here instead. (eieio-oref): Allow its use on `cl-structure-object`. * lisp/emacs-lisp/eieio.el (eieio-pcase-slot-index-from-index-table): Don't need to add the `eieio--object-num-slots` offset. * doc/misc/eieio.texi (Accessing Slots, Accessing Slots): Mention the use on structs. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-defstruct-slot-value): New test.
* Remove workaround for fixed Bug#6581 from ertStefan Kangas2021-10-312-29/+34
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-equal-including-properties): Make into obsolete function alias for 'equal-including-properties'. * test/src/editfns-tests.el (format-properties): * test/lisp/emacs-lisp/ert-x-tests.el (ert-propertized-string) (ert-test-run-tests-interactively-2): Don't use above obsolete name. (ert--explain-equal-including-properties-rec): New function. (ert--explain-equal-including-properties): Use as an explainer for 'equal-including-properties' now that Bug#6581 is fixed. * test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-equal-string-properties): Expand test. (ert-test-equal-including-properties): Merge test into above expanded test.
* Fix bug with string values in equal-including-propertiesStefan Kangas2021-10-311-14/+0
| | | | | | | | | | | | | | | | | | * src/intervals.c (intervals_equal_1): Factor out from intervals_equal. Optionally use Fequal for comparison of string values in property lists. (intervals_equal): Update for the above. (compare_string_intervals): Use the above optional Fequal comparison to fix a bug where 'equal-including-properties' compared strings with eq, instead of equal. (Bug#6581) * test/src/fns-tests.el (fns-tests-equal-including-properties) (fns-tests-equal-including-properties/string-prop-vals): New tests. * test/lisp/emacs-lisp/ert-tests.el (ert-test-equal-including-properties): Remove parts testing 'equal-including-properties'. * lisp/emacs-lisp/ert.el (ert-equal-including-properties): Add FIXME that this should be removed.
* Merge from origin/emacs-28Glenn Morris2021-10-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b0d64be0bc (origin/emacs-28) Improve some NEWS entries 7fde84e881 Improve documentation of syntax-ppss-context slightly 5ecbed01b2 ; * test/lisp/mh-e/mh-utils-tests.el: Update macro declara... 168665da59 Move some xwidget entries efde024361 time-stamp-tests: improvements to test macros 06c944cff1 Fix rfc6068-parse-mailto-url autoload 9b6b5e37ef Regexp-quote github domains in bug-reference 1f6cdeb12c Ensure valid end/beginning lines in message-mark-inserted-... 9b46150ab0 * etc/NEWS: Improve 'repeat-mode' entry. 9c37b812da ; * lisp/repeat.el (repeat-mode): Fix docstring typo. caf87d80fa * lisp/repeat.el (repeat-keep-prefix): Expand description. 24083c8d13 * lisp/net/eww.el (eww-retrieve-command): Add :tag. cf7d8fb1d7 Add description of cards to etc/refcards/README d2849cc645 Fix 'calculate-lisp-indent' when "[" starts containing sex... 2a0a368ddc Fix typo in doc/emacs/anti.texi 9529e1d2fb Update doc of Edebug specification for macros 5bc522b4f4 ; * lisp/simple.el (kill-region): A better fix for bug#51320. ee6bdd6eef Fix non-interactive behavior of 'kill-region' 2b7655ca0e ; More accurate doc string for 'tab-bar-format' 2841e26744 * test/lisp/dabbrev-tests.el: Use 'kbd' for readable keys. 1cdb4d2077 * lisp/menu-bar.el (menu-bar-keymap): Add optional arg KEY... # Conflicts: # etc/NEWS # lisp/progmodes/bug-reference.el
| * * test/lisp/dabbrev-tests.el: Use 'kbd' for readable keys.Juri Linkov2021-10-211-1/+1
| | | | | | | | | | | | | | (dabbrev-expand-test, dabbrev-completion-test) (dabbrev-completion-test-with-argument): Use 'kbd' to format keys for 'execute-kbd-macro'. (dabbrev-expand-test): Fix docstring.
* | Improve TCO test coverageMattias Engdegård2021-10-191-2/+11
| | | | | | | | | | * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Exercise `cond` in tail position in two different ways.
* | Add new command 'ensure-empty-lines'.Lars Ingebrigtsen2021-10-041-0/+38
|/ | | | | | * doc/lispref/text.texi (Commands for Insertion): Document it. * lisp/emacs-lisp/subr-x.el (ensure-empty-lines): New command.
* ; * test/lisp/emacs-lisp/bytecomp-tests.el: remove ineffective \Mattias Engdegård2021-09-301-1/+1
|
* checkdoc: Allow Lisp symbols to start a messageStefan Kangas2021-09-281-0/+37
| | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Allow Lisp symbols to start a message. (checkdoc--error-bad-format-p): New helper function. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-test-error-format-is-good) (checkdoc-test-error-format-is-bad): New helper functions. (checkdoc-tests-error-message-bad-format-p) (checkdoc-tests-error-message-bad-format-p/defined-symbols) (checkdoc-tests-error-message-bad-format-p/not-capitalized): New tests.
* Get a `package-test-signed` to work againdickmao2021-09-274-49/+28
| | | | | | | | The test signing key succumbed to either expiration or bitrot. I hope I didn't just publish my secret key to the world. * test/lisp/emacs-lisp/package-resources/key.pub: Refresh. * test/lisp/emacs-lisp/package-resources/key.sec: Refresh.
* Move test-cl-flet-indentation to the right fileLars Ingebrigtsen2021-09-271-11/+0
|
* Move two incorrectly named test filesStefan Kangas2021-09-261-3/+2
| | | | | | | * test/lisp/emacs-lisp/tabulated-list-test.el: Move from here... * test/lisp/emacs-lisp/tabulated-list-tests.el: ...to here. * test/lisp/url/url-handlers-test.el: Move from here... * test/lisp/url/url-handlers-tests.el: ...to here.
* ; Minor stylistic checkdoc fixes in test/**/*.elStefan Kangas2021-09-2626-55/+71
|
* Rename "Homepage" field to "Website" in package descriptionStefan Kangas2021-09-261-4/+4
| | | | | | | | | | | * lisp/emacs-lisp/package.el (describe-package-1): Rename "Homepage" field to "Website". * test/lisp/emacs-lisp/package-tests.el (package-test-describe-package) (package-test-describe-installed-multi-file-package) (package-test-describe-non-installed-package) (package-test-describe-non-installed-multi-file-package): Update tests.
* Add test for lm-websiteStefan Kangas2021-09-261-0/+8
| | | | | | * lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm--tests-lm-website): New test.
* Warn about overly long docstring in lambdaStefan Kangas2021-09-261-2/+1
| | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-length-warn): Warn about overly long docstring in lambda. (Bug#44858) (byte-compile--wide-docstring-p): Improve comment. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-defun.el"): Update to test for the above new warning.
* Avoid false positives in bytecomp docstring width warningStefan Kangas2021-09-261-0/+24
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Ignore more function argument lists. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests-byte-compile--wide-docstring-p): New test.
* Unbreak ert testsStefan Kangas2021-09-261-17/+18
| | | | | * test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-print) (tabulated-list-sort): Update tests for recent change.
* Fix byte-compiler crash for legal dynamic-binding codeMattias Engdegård2021-09-251-0/+8
| | | | | | | | | | This should really be taken care of by a syntax normalisation step in the frontend, but there is no such step for non-lexbind code yet. * lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Tolerate bindingsa without initialising expressions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* Constant-propagate variables bound outside loopsMattias Engdegård2021-09-251-0/+37
| | | | | | | | | | | | | | Previously, variables bound outside `while` loops were not substituted inside even in the absense of mutation. Add the necessary mutation checking inside loops to allow propagation of values and aliased variables. * lisp/emacs-lisp/byte-opt.el (byte-optimize--inhibit-outside-loop-constprop): New variable. (byte-optimize-form-code-walker): First traverse each loop without substitution to discover mutation, then without restrictions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-loop): New. (bytecomp-tests--test-cases): Add test cases.
* Use ambient lexical-binding value in ert-deftest body (bug#50738)Mattias Engdegård2021-09-251-0/+4
| | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-deftest): Evaluate the body of `ert-deftest` with the `lexical-binding` value of the source file (or more precisely the value in force when the definition is evaluated), which is what everyone expected, instead of always using dynamic binding which is what they got until now. * test/lisp/emacs-lisp/ert-tests.el (ert-test-deftest-lexical-binding-t): New test.
* Indent bodies of local function definitions properly in elisp-modeakater2021-09-251-0/+11
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for local defforms (`cl-flet' and `cl-labels'). (lisp--local-defform-body): New auxiliary function (bug#9622).
* Fix recently introduced bug in checkdocStefan Kangas2021-09-241-1/+4
| | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Fix recently introduced bug where some abbreviations weren't recognized. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-in-abbrevation-p/basic-case): Extend test.
* Avoid jumping too far in checkdoc-in-abbreviation-pStefan Kangas2021-09-231-16/+18
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use 'forward-ward' instead of 'forward-sexp' to avoid jumping too far in some situations. (Bug#50731) * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--abbrev-test): New helper function. (checkdoc-tests-in-abbrevation-p/basic-case): Rename from 'checkdoc-tests-in-abbrevation-p'. (checkdoc-tests-in-abbrevation-p/with-parens) (checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new helper function. (checkdoc-tests-in-abbrevation-p/single-char) (checkdoc-tests-in-abbrevation-p/with-em-dash) (checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.