summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Fix unmounting in TrampMichael Albinus2021-10-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (FUSE setup): Add tramp-fuse-unmount-on-cleanup. * lisp/net/tramp.el (tramp-file-name-unify): New defun. (tramp-file-name-equal-p): * lisp/net/tramp-cache.el (tramp-get-connection-property) (tramp-set-connection-property, tramp-flush-connection-property) (tramp-flush-connection-properties): Use it. * lisp/net/tramp-fuse.el (tramp-fuse-get-fusermount): New defun. (tramp-fuse-mount-points): New defvar. (tramp-fuse-unmount): Use it. Delete VEC from `tramp-fuse-mount-points'. Delete mount point. (tramp-fuse-unmount-on-cleanup): New user option. (tramp-fuse-cleanup, tramp-fuse-cleanup-all): New defuns. (top): Adapt `tramp-fuse-unload-hook', `tramp-cleanup-connection-hook', `tramp-cleanup-all-connections-hook' and `kill-emacs-hook'. * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection): Add VEC to `tramp-fuse-mount-points'. * test/lisp/net/tramp-tests.el (tramp-fuse-unmount-on-cleanup): Declare. (tramp-test39-make-lock-file-name): Use it.
* Rename elisp-shorthands to read-symbol-shorthandsJoão Távora2021-10-032-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new name fits better in the family of variables that affect the Lisp reader. Suggested-by: Po Lu <luangruo@yahoo.com> * doc/lispref/symbols.texi (Shorthands): Mention read-symbol-shorthands * lisp/shorthands.el (hack-read-symbol-shorthands) (hack-read-symbol-shorthands) (shorthands-font-lock-shorthands): Use read-symbol-shorthands * lisp/progmodes/elisp-mode.el (elisp--completion-local-symbols) (elisp--completion-local-symbols) (elisp-shorthands): Use read-symbol-shorthands * src/lread.c: (syms_of_lread): Define Vread_symbol_shorthands (oblookup_considering_shorthand): Use Vread_symbol_shorthands. * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer): (elisp-shorthand-read-from-string): Use read-symbol-shorthands * test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el Use new symbol name read-symbol-shorthands.
* Font-lock shorthands in elisp-mode for quick visual recognition (bug#50959)João Távora2021-10-031-0/+8
| | | | | | | | | | | | | Only the shorthanded prefix is font-locked. This allows the remainder of the font-lock logic to subsist (e.g. for macro-defining symbols). * lisp/shorthands.el (cl-lib): Require it when compiling. (elisp-shorthand-font-lock-face): New face. (shorthands--mismatch-from-end): New helper. (shorthands-font-lock-shorthands): New helper. * test/lisp/progmodes/elisp-mode-resources/simple-shorthand-test.el: Add some dummy test code.
* Clarify the purpose of internal--format-docstring-lineStefan Kangas2021-10-031-8/+7
| | | | | | | | | * test/lisp/subr-tests.el (subr-test-internal--format-docstring-line): * lisp/subr.el (internal--format-docstring-line): Make it more clear that this function is not intended for the first line of a docstring. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add comment explaining why we use 'internal--format-docstring-line'. Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
* Migrate Xref off EIEIODmitry Gutov2021-10-011-12/+10
| | | | | | | | | | | | | | | | | | | | | | To improve performance and flexibility (bug#50777). * lisp/progmodes/xref.el (xref-location): Remove. (xref-file-location): Change to cl-struct. (xref-buffer-location, xref-bogus-location): Ditto. (xref-item, xref-match-item): Same. And update all method definitions accordingly. (xref--insert-xrefs): Don't use 'oref', use 'xref-item-location'. (xref--insert-xrefs, xref-show-definitions-completing-read): Insetad of 'with-slots', use 'xref-item-summary' and 'xref-item-location'. * lisp/progmodes/etags.el (xref-etags-location): Change from EIEIO class into a cl-struct. (xref-etags-apropos-location): Ditto. Update all method definitions. * test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-test-run): Avoid using 'oref'.
* ; Mark cl-flet indentation test as failing (bug#9622)Mattias Engdegård2021-09-301-0/+1
|
* ; * test/lisp/emacs-lisp/bytecomp-tests.el: remove ineffective \Mattias Engdegård2021-09-301-1/+1
|
* ; * test/lisp/electric-tests.el: Reduce python-mode log spam.Mattias Engdegård2021-09-281-31/+35
|
* Adapt tramp-tests.el for macOSMichael Albinus2021-09-281-13/+9
| | | | | * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process) (tramp-test30-make-process): Adapt for macOS.
* Use ert-resource-file in the shorthand testsLars Ingebrigtsen2021-09-282-16/+6
| | | | Also move to the standard directory naming.
* 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.
* ; Still more instrumentation on autorevert-tests.elMichael Albinus2021-09-271-9/+12
|
* Merge branch 'master' of git.sv.gnu.org:/srv/git/emacsMichael Albinus2021-09-271-0/+12
|\
| * Fix automatic filling of docstring in cl-defstructStefan Kangas2021-09-271-0/+12
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix bug where a paragraph was filled as if it were a single line, which led to garbled output in the docstring. (Bug#50839) * test/lisp/subr-tests.el (subr-test-internal--format-docstring-line): New test.
* | ; More instrumentation in autorevert-tests.elMichael Albinus2021-09-271-2/+25
|/ | | | | | * test/lisp/autorevert-tests.el (auto-revert-test--instrument-kill-buffer-hook): New defun. (auto-revert-test05-global-notify): More instrumentation.
* Make comint understand the ccrypt password phrasesLars Ingebrigtsen2021-09-271-0/+3
| | | | | | | | * lisp/comint.el (comint-password-prompt-regexp): Add the ccrypt confirmation phrase (bug#50837). * lisp/international/mule-conf.el (password-word-equivalents): Add the ccrypt phrases.
* Add "passwd" (change password) prompt to comintLars Ingebrigtsen2021-09-271-0/+1
| | | | | * lisp/comint.el (comint-password-prompt-regexp): Add "passwd" (to change the password) first promp in Debian bullseye.
* 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-272-11/+10
|
* Add #_ reader macro to escape shorthand renamingJoão Távora2021-09-272-1/+14
| | | | | | | | | | | | * src/lread.c (read1): Add skip_shorthand variable. Add a '#_' case. If skip_shorthand call oblookup instead of oblookup_considering_shorthand. * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-escape): New test. * test/lisp/progmodes/elisp-resources/simple-shorthand-test.el (#_f-test4---): New fixture function.
* Consider shorthands in Elisp's elisp-completion-at-pointJoão Távora2021-09-272-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of referencing obarray directly, that function has to consider a collection of completions which includes the shorthand versions of some of the symbols. That collection changes from buffer to buffer, depending on the choice of elisp-shorthands. To make this process efficient, and avoid needless recalculation of the above collection, a new obarray-specific cache was invented. The Elisp variable obarray-cache is immediately nullified if something touches the obarray. * lisp/progmodes/elisp-mode.el : New helper. (elisp-completion-at-point): Use new helpers. (elisp--completion-local-symbols) (elisp--fboundp-considering-shorthands) (elisp--bboundp-considering-shorthands): New helpers * src/lread.c (intern_driver): Nullify Qobarray_cache. (syms_of_lread): Add Qobarray_cache. * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-completion-at-point): New test. * test/lisp/progmodes/elisp-resources/simple-shorthand-test.el (f-test-complete-me): New fixture.
* Rework Elisp shorthands to only allow only prefix substitutionJoão Távora2021-09-272-6/+6
| | | | | | | | | | | | | | | | | | | This simplification in requirements makes for more complex C code but that code is much less wasteful in Lisp strings than the previous implementation. * src/lread.c (read1): Rework. (Fintern): Rework. (Fintern_soft): Rework. (Funintern): Rework. (oblookup_considering_shorthand): Rewrite. * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer) (elisp-shorthand-read-from-string): Use new format of elisp-shorthands. * test/lisp/progmodes/elisp-resources/simple-shorthand-test.el (f-test) (f-test2, f-test3): Use new form of elisp-shorthands.
* Move most of the shorthand implementation to C codeJoão Távora2021-09-273-60/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It passes the tests designed for the previous Elisp implementation. Likely, this isn't the final form of the implementation. For one, the reader is much slower and allocates a Lisp string for every atom read, regardless if its already interned or not. This has the potential to be catastrophic in terms of GC. Also rename the main variable to elisp-shorthands, from the repetitive shorthand-shorthands. For some reason, I had to put 'hack-elisp-shorthands' and 'load-with-shorthands-and-code-conversion', the new source-file loading functions, in lisp/international/mule.el. Otherwise, lisp/loadup.el wouldn't see them, for some reason that I didn't investigate. This should probably be fixed. * lisp/shorthand.el: Remove. * test/lisp/shorthand-tests.el: Remove. * src/lread.c: (read1, Fintern, Fintern_soft, Funintern): Use oblookup_considering_shorthand. (oblookup_considering_shorthand): New helper. (syms_of_lread): Declare elisp-shorthands. * lisp/progmodes/elisp-mode.el (elisp-shorthands): Put a safe-local-variable spec. * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer) (elisp-shorthand-read-from-string) (elisp-shorthand-byte-compile-a-file) (elisp-shorthand-load-a-file): New tests. * test/lisp/progmodes/elisp-resources/simple-shorthand-test.el: New file * lisp/loadup.el (load-source-file-function): Set to load-with-shorthands-and-code-conversion. * lisp/international/mule.el (hack-elisp-shorthands): Move here. (load-with-shorthands-and-code-conversion): And here.
* First Elisp version of lisp/shorthand.el, failing some testsJoão Távora2021-09-271-0/+60
| | | | | | * lisp/shorthand.el: New file * test/lisp/shorthand-tests.el: New file
* Move two incorrectly named test filesStefan Kangas2021-09-262-6/+4
| | | | | | | * 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-2696-134/+195
|
* ; Clarify and simplify time-stamp commentsStephen Gildea2021-09-261-3/+3
| | | | | | | * lisp/time-stamp.el (time-stamp-end, time-stamp-string-preprocess, time-stamp-formatz-from-parsed-options): Simplify doc. * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): Refactor to set limit-number only once.
* 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.
* ; Adjust overly long docstrings to fit 80 charactersStefan Kangas2021-09-262-5/+7
|
* 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.
* ; More instrumentation in autorevert-tests.elMichael Albinus2021-09-261-1/+1
|
* Adapt Tramp's make-process for macOS.Michael Albinus2021-09-261-4/+18
| | | | | | | | | | | | | * lisp/net/tramp-sh.el (tramp-check-remote-uname): New defun. (tramp-sh-handle-file-ownership-preserved-p) (tramp-sh-handle-make-process, tramp-find-executable) (tramp-find-shell, tramp-get-remote-stat): Use it. (Bug#50748) * test/lisp/net/tramp-tests.el (tramp-check-remote-uname): Declare. (tramp-test29-start-file-process, tramp-test30-make-process): Instrument for macOS. (tramp--test-hpux-p): Adapt function. (tramp--test-macos-p): New defun.
* 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.
* ; More instrumentation in autorevert-tests.elMichael Albinus2021-09-251-4/+4
|
* 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.
* Revert change to use seq-random-elt in Tramp testStefan Kangas2021-09-241-2/+6
| | | | | | * test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests): Revert change to use seq-random-elt, as Tramp needs to be compatible with Emacs 25, and the function was only added in 26.1.
* Prefer seq-random-elt to nth+randomStefan Kangas2021-09-241-3/+2
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-random-elt): Autoload. * lisp/avoid.el (mouse-avoidance-random-shape): * lisp/epa-ks.el (epa-ks--query-url): * lisp/erc/erc-networks.el (erc-server-select): * lisp/gnus/gnus-fun.el (gnus--random-face-with-type) (gnus-fun-ppm-change-string): * lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type): * lisp/obsolete/landmark.el (landmark-random-move): * lisp/play/mpuz.el (mpuz-build-random-perm): * lisp/play/zone.el (zone-pgm-stress): * lisp/vc/add-log.el (add-change-log-entry): * test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests): Prefer seq-random-elt to nth+random.
* Fix auto-revert-test05-global-notifyMichael Albinus2021-09-241-1/+1
| | | | | * test/lisp/autorevert-tests.el (auto-revert-test05-global-notify): Adapt test for killed buffer.
* ; Instrument autorevert-tests.elMichael Albinus2021-09-241-0/+3
|
* Pacify recent warnings in ansi-color-tests.elBasil L. Contovounesios2021-09-241-39/+37
| | | | | | | | | | | | * test/lisp/ansi-color-tests.el: Remove invalid package keyword 'ansi', and unused dependency on cl-lib. (yellow, bright-yellow): Replace prefix-less dynvars with corresponding local lexvars. (test-strings): Rename prefix-less dynvar... (ansi-color-tests--strings): ...to this. All users updated. (ansi-color-apply-on-region-test) (ansi-color-apply-on-region-bold-is-bright-test): Simplify. (ansi-color-apply-on-region-preserving-test): Reindent.
* Add support for "bright" ANSI colors in term-modeJim Porter2021-09-231-1/+64
| | | | | | | | | | | | | | | * list/term.el (ansi-term-color-vector): Add new faces. (term-color-black, term-color-red, term-color-green, term-color-yellow) (term-color-blue, term-color-magenta, term-color-cyan, term-color-white): Inherit from 'ansi-color-COLOR'. (term-color-bright-black, term-color-bright-red, term-color-bright-green) (term-color-bright-yellow, term-color-bright-blue) (term-color-bright-magenta, term-color-bright-cyan) (term-color-bright-white): New faces. (term--maybe-brighten-color): New function. (term-handle-colors-array): Handle bright colors. * test/lisp/term-tests.el (term-colors, term-colors-bold-is-bright): New functions.
* Add support for "bright" ANSI colors in ansi-colorJim Porter2021-09-231-7/+48
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/ansi-color.el (ansi-color-bold, ansi-color-faint, ansi-color-italic) (ansi-color-underline, ansi-color-slow-blink, ansi-color-fast-blink) (ansi-color-inverse, ansi-color-red, ansi-color-green, ansi-color-yellow) (ansi-color-blue, ansi-color-magenta, ansi-color-cyan, ansi-color-white) (ansi-color-bright-red, ansi-color-bright-green, ansi-color-bright-yellow) (ansi-color-bright-blue, ansi-color-bright-magenta, ansi-color-bright-cyan) (ansi-color-bright-white): New faces. (ansi-color-basic-faces-vector, ansi-color-normal-colors-vector) (ansi-color-bright-colors-vector): New constants. (ansi-color-faces-vector, ansi-color-names-vector): Make obsolete. (ansi-color-bold-is-bright): New defcustom. (ansi-color--find-face): Sort ANSI codes and check 'ansi-color-bold-is-bright'. (ansi-color-apply-sequence): Support bright ANSI colors. (ansi-color-make-color-map, ansi-color-map, ansi-color-map-update): Make obsolete. (ansi-color-get-face-1): Add BRIGHT parameter. * lisp/man.el (Man-ansi-color-basic-faces-vector): New variable. (Man-ansi-color-map): Make obsolete. (Man-fontify-manpage): Use 'Man-ansi-color-basic-faces-vector' here. * test/lisp/ansi-color-tests.el (ansi-color-apply-on-region-bold-is-bright-test): New function.
* 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.
* Don't rely on lexical-binding being nil in testsMattias Engdegård2021-09-222-0/+3
| | | | | | | * test/lisp/button-tests.el (button--help-echo-form): * test/lisp/files-tests.el (files-tests-permanent-local-variables): Remove assumption that `with-temp-buffer` creates a buffer where `lexical-binding` is nil.