summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* gv.el and cl-macs.el: Fix bug#57397Stefan Monnier2022-09-031-1/+14
| | | | | | | | | * lisp/emacs-lisp/gv.el (gv-get): Obey symbol macros. * lisp/emacs-lisp/cl-macs.el (cl--letf): Remove workaround placed to try and handle symbol macros. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add new testcase.
* Disable a lisp-mode test that now failsLars Ingebrigtsen2022-08-231-10/+12
| | | | | * test/lisp/emacs-lisp/lisp-mode-tests.el (test-lisp-current-defun-name): Comment-out now-failing tests.
* Prefer pos-bol and pos-eol in testsStefan Kangas2022-08-212-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/calendar/todo-mode-tests.el (todo-test-toggle-item-header02, todo-test-edit-item-date-month) (todo-test-multiline-item-indentation-1) (todo-test-multiline-item-indentation-2) (todo-test-multiline-item-indentation-3): * test/lisp/cedet/semantic-utest-ia.el (semantic-ia-utest-buffer) (semantic-sr-utest-buffer-refs): * test/lisp/cedet/semantic-utest.el (semantic-utest-kill-indicator) (semantic-utest-unkill-indicator): * test/lisp/dired-tests.el (dired-test-bug27968): * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--verify-single-and-multi-line): * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--find-library-verbose): * test/lisp/erc/erc-tests.el (erc-ring-previous-command) (erc-log-irc-protocol): * test/lisp/gnus/message-tests.el (message-mode-propertize): * test/lisp/info-xref-tests.el (info-xref-test-emacs-manuals): * test/lisp/mail/footnote-tests.el (footnote-tests-same-place): * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-completion-at-point): * test/lisp/progmodes/f90-tests.el (f90-test-bug38415): * test/lisp/progmodes/python-tests.el (python-indent-electric-comma-inside-multiline-string) (python-indent-electric-comma-after-multiline-string) (python-indent-electric-colon-1, python-indent-electric-colon-2) (python-indent-electric-colon-3, python-indent-electric-colon-4) (python-mark-defun-2, python-mark-defun-3, python-mark-defun-4) (python-mark-defun-5, python-nav-end-of-defun-2) (python-nav-end-of-statement-1, python-nav-end-of-block-1) (python-indent-dedent-line-backspace-2) (python-indent-dedent-line-backspace-3) (python-eldoc--get-symbol-at-point-1) (python-info-beginning-of-statement-p-1) (python-info-beginning-of-statement-p-2): * test/lisp/replace-tests.el (replace-occur-revert-bug32543) (replace-occur-revert-bug32987): * test/lisp/simple-tests.el (simple-delete-indentation-boundaries) (simple-delete-indentation-region) (line-number-at-pos-in-narrow-buffer) (line-number-at-pos-keeps-restriction): * test/lisp/textmodes/css-mode-tests.el (css-mode-test-selectors) (scss-mode-test-selectors): * test/lisp/textmodes/fill-tests.el (fill-test-unbreakable-paragraph) (fill-test-breakable-paragraph): * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): * test/src/lread-tests.el (lread-tests--last-message): * test/src/process-tests.el (set-process-filter-t): * test/src/undo-tests.el (undo-test-skip-invalidated-markers): Prefer pos-bol and pos-eol.
* Further seq-uniq speed-ups for listsLars Ingebrigtsen2022-08-121-1/+6
| | | | | * lisp/emacs-lisp/seq.el (seq-uniq): Speed up more for long lists (bug#57079).
* Add a faster seq-uniq for listsLars Ingebrigtsen2022-08-091-0/+13
| | | | | * lisp/emacs-lisp/seq.el (seq-uniq): Add a faster method for lists (bug#57079).
* Make which-func-mode output less junkLars Ingebrigtsen2022-08-081-0/+23
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Use edebug specs to find the name (if they exist), and default to returning the top-level symbol if there isn't a define-like form (bug#49592).
* * test/lisp/emacs-lisp/nadvice-tests.el: Re-add no-byte-compile.Stefan Kangas2022-08-081-0/+4
|
* Remove no-byte-compile cookie from some librariesStefan Kangas2022-08-082-8/+0
| | | | | | | | | | | This gives us back byte-compiler warnings for these files. * lisp/mh-e/mh-acros.el: * test/lisp/comint-tests.el: * test/lisp/emacs-lisp/nadvice-tests.el: * test/lisp/emacs-lisp/syntax-tests.el: * test/lisp/xml-tests.el: * test/src/font-tests.el: Remove no-byte-compile cookie. * test/src/font-tests.el (font-parse-explain): Fix warning.
* Consider built-in packages to be installedMatt Armstrong2022-08-021-0/+15
| | | | | * lisp/emacs-lisp/package.el (package-installed-p): Check for built-in packages before initialization. (bug#56877).
* Add support for user-customizable iconsLars Ingebrigtsen2022-07-281-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/custom.texi (Specific Customization): Mention it. * doc/emacs/display.texi (Icons): New node. * doc/lispref/display.texi (Icons): New node. * lisp/button.el (buttonize): (button--properties, buttonize-region): Allow not overriding faces. * lisp/cus-edit.el (custom-save-all): Save icons. (custom-icon): New widget. (custom-icon-value-create, custom-toggle-hide-icon) (custom--icons-widget-value, custom-icon-set): Helper functions for the widget. (customize-icon): Main command. (custom-icon-state-set, custom-icon-state): Helper functions. (custom-theme-set-icons): Function to be used by theme writers. (custom-set-icons): Function to be used in .emacs. (custom-save-icons): New function. * lisp/custom.el (custom-push-theme): Add icons. * lisp/emacs-lisp/icons.el: New file. * test/lisp/emacs-lisp/icons-tests.el: Add some tests.
* Fix off-by-one error in string-truncate-leftLars Ingebrigtsen2022-07-231-0/+5
| | | | | * lisp/emacs-lisp/subr-x.el (string-truncate-left): Fix off-by-one error (bug#56685).
* Speed up `seq-subseq` for lists (bug#56521)Mattias Engdegård2022-07-181-1/+28
| | | | | | | | * lisp/emacs-lisp/seq.el (seq-subseq): Make faster by using `take` instead of a lisp loop, and more importantly by not front-loading the error text formatting. * test/lisp/emacs-lisp/seq-tests.el (seq-tests--list-subseq-ref) (test-seq-subseq): Test `seq-subseq` for lists more thoroughly.
* Merge from origin/emacs-28Stefan Kangas2022-07-141-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | 5e47ec9511 ; * lisp/url/url-http.el (url-http-parse-headers): Fix typo. ba0871bef1 ; Fix typos: prefer American spelling e3e7f31faa Adapt Tramp doc # Conflicts: # etc/NEWS # etc/themes/modus-themes.el # lisp/emacs-lisp/byte-opt.el # test/lisp/so-long-tests/spelling-tests.el
| * ; Fix typos: prefer American spellingStefan Kangas2022-07-131-4/+4
| |
| * Fix copyright-find-copyright when searching from the endLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179). Do not merge to master.
| * Fix copyright.el comment and add a testLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179). Do not merge to master.
| * Mark a few more map tests as unstable on Emacs 28 (Bug#46722).Philipp Stephani2022-01-151-0/+12
| | | | | | | | | | | | | | | | | | | | At least for me, these tests still occasionally fail. Do not merge to master. * test/lisp/emacs-lisp/map-tests.el (test-map-into-hash-test) (test-map-merge, test-map-merge-with, test-map-merge-empty): Mark as unstable.
| * Mark test-map-into as unstableLars Ingebrigtsen2022-01-141-0/+3
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/map-tests.el (test-map-into): Mark as unstable (bug#46722). Do not merge to master.
* | Make string-limit with encoding return complete glyphsLars Ingebrigtsen2022-07-031-4/+19
| | | | | | | | | | | | | | * lisp/emacs-lisp/subr-x.el (string-limit): Return more correct results in the CODING-SYSTEM case for coding systems with BOM and charset designations (bug#48324). Also amend the algorithm to return complete glyphs, not just complete code points.
* | Add new function `seq-split'Lars Ingebrigtsen2022-07-031-0/+21
| | | | | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-split): New function. * lisp/emacs-lisp/shortdoc.el (sequence): Mention it.
* | Make two text-property-search tests easier to readStefan Kangas2022-06-291-13/+12
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/text-property-search-tests.el (text-property-search-forward/point-at-beginning) (text-property-search-backward/point-at-end): Rewrite to make tests easier to read.
* | (oclosure-test-limits): Fix test failure when interpretedStefan Monnier2022-06-261-0/+1
| | | | | | | | | | * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test-limits): Make sure we bind `byte-compile-debug` dynamically.
* | Fix cl-generic bootstrap problemsLars Ingebrigtsen2022-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/sqlite-mode.el (require): * lisp/net/eudc.el (require): * lisp/arc-mode.el (require): Require subr-x, since these files are using macros from there. * lisp/emacs-lisp/subr-x.el (with-memoization): Move from here... * lisp/subr.el (with-memoization): ... to here, as it's used from the preloaded cl-generic.el file. * lisp/emacs-lisp/cl-generic.el (cl--generic-compiler): Don't use the autoloaded `byte-compile' function during bootstrap. (cl--generic-get-dispatcher): Don't require subr-x, either. cl-generic has been preloaded since 2015, and most usages of it (in preloaded files) work fine. In particular, using `cl-defgeneric' is unproblematic. However, `cl-defmethod' would end up pulling in the byte compiler (at load time), which would make it impossible to use `cl-defmethod' in pre-loaded files, and this change fixes that (but possibly not in the most self-evidently correct way).
* | bindat (strz): Null terminate fixed-length strings if there is roomRichard Hansen2022-06-221-6/+6
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--pack-strz): For fixed-length strz fields, explicitly write a null terminator after the packed string if there is room (bug#56048). * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc): Update tests.
* | Document and test 'no-byte-compile' behavior.Philipp Stephani2022-06-212-0/+8
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Document behavior if 'no-byte-compile' is set. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-compile-file/no-byte-compile): New unit test. * test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el: New test file.
* | Fix edebug parsing of .,Lars Ingebrigtsen2022-06-191-0/+9
| | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-next-token-class): Parse ., correctly (bug#37653).
* | Slightly faster hash-table-keys and hash-table-valuesMattias Engdegård2022-06-171-0/+7
| | | | | | | | | | | | | | * lisp/emacs-lisp/subr-x.el (hash-table-keys, hash-table-values): Omit the reversal of the returned list. It is not ordered anyway. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x--hash-table-keys-and-values): New test.
* | Warn about misplaced or duplicated function/macro declarationsMattias Engdegård2022-06-172-0/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doc strings, `declare` and `interactive` forms must appear in that order and at most once each. Complain if they don't, instead of silently ignoring the problem (bug#55905). * lisp/emacs-lisp/byte-run.el (byte-run--parse-body) (byte-run--parse-declarations): New. (defmacro, defun): Check for declaration well-formedness as described above. Clarify doc strings. Refactor some common code. * test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el: * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-fun-attr-warn): New test.
* | bindat (strz): Write null terminator after variable length stringRichard Hansen2022-06-161-2/+2
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--pack-strz): Explicitly write a null byte after packing a variable-length string to ensure proper termination when packing to a pre-allocated string. * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--str-strz-prealloc): Update tests.
* | Normalise setq during macro-expansionMattias Engdegård2022-06-143-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Early normalisation of setq during macroexpand-all allows later stages, cconv, byte-opt and codegen, to be simplified and duplicated checks to be eliminated. * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Normalise all setq forms to a sequence of (setq VAR EXPR). Emit warnings if necessary. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form): * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): * lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Simplify. * test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el; * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el: New files.
* | bindat (strz): Error on null byte if packing variable-length stringRichard Hansen2022-06-131-1/+6
| | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Signal an error if a null byte is encountered while packing a string to a variable-length strz field. * test/lisp/emacs-lisp/bindat-tests.el (strz): Add tests (bug#55938).
* | bindat (str, strz): Reject non-ASCII, non-`eight-bit' charactersRichard Hansen2022-06-121-0/+16
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (str) (strz): Signal an error if the user attempts to pack a multibyte string containing characters other than ASCII and `eight-bit' characters (bug#55897). * doc/lispref/processes.texi (Bindat Types): Update documentation. * test/lisp/emacs-lisp/bindat-tests.el (str) (strz): Add tests.
* | Bindat: Document `sint`; add `le` arg to `uint`; deprecate `uintr`Stefan Monnier2022-06-111-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (bindat--type) <uint>: Add `le` optional arg. (bindat--type) <uintr>: Delete method. (uintr): Re-define as a bindat-macro instead. (bindat-type): Update docstring accordingly. (bindat--primitives): Update. (sint): Simplify. * doc/lispref/processes.texi (Bindat Types): Update `uint`, add `sint`, and remove `uintr`. * test/lisp/emacs-lisp/bindat-tests.el (data-bindat-spec): Use the new `le` arg of `uint` instead of `uintr`.
* | ; bindat-tests (str, strz): Refine testsRichard Hansen2022-06-101-12/+46
| | | | | | | | | | | | | | | | | | | | | | str and strz: * Add tests for packing into a pre-allocated string. strz: * Add test cases to probe more boundary conditions. * Delete comments that no longer apply. * Add tests to ensure that truncated packed strings are rejected. * Keep the legacy spec tests in sync with the modern spec tests.
* | Preserve doc string in `byte-compile` (bug#55830)Mattias Engdegård2022-06-081-0/+21
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Don't transpose doc string and interactive spec, which must come in this order. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-function-attributes): New test.
* | find-func.el: Fix bug#41104Stefan Monnier2022-06-071-0/+7
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/find-func.el (find-function-advised-original): Look at the actual function definition rather than `advice--symbol-function` which sometimes returns only the advice. * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--find-library-verbose): Add test.
* | Test warning suppressions with lexical bindingMattias Engdegård2022-06-061-6/+14
| | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load): Add lexical cookie to file being compiled as part of the test. (bytecomp-test--with-suppressed-warnings): Comment out the test for suppressing warnings when attempting to let-bind `nil`, as that (1) doesn't work and (2) is a silly thing to do anyway.
* | bindat (strz): Fix wrong-type-argument error when unpackingRichard Hansen2022-06-011-1/+0
| | | | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Fix (wrong-type-argument number-or-marker-p nil) error when unpacking a strz with unspecified (variable) length. * test/lisp/emacs-lisp/bindat-tests.el (strz): Mark test as passing.
* | bindat (strz): Fix off-by-one bug in computed lengthRichard Hansen2022-06-011-2/+0
| | | | | | | | | | | | * lisp/emacs-lisp/bindat.el (strz): Include null terminator when computing packed string length. * test/lisp/emacs-lisp/bindat-tests.el (strz): Mark tests as passing.
* | ; bindat-tests (strz): Add more testsRichard Hansen2022-06-011-0/+69
| |
* | Fix bytecomp-test--with-suppressed-warnings testLars Ingebrigtsen2022-05-221-1/+1
| | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Adjust test to change in warning message.
* | Fix pp-emacs-lisp-code printing of cons cellsLars Ingebrigtsen2022-05-171-0/+12
| | | | | | | | | | * lisp/emacs-lisp/pp.el (pp--insert-lisp): Fix printing of cons cells (bug#55478).
* | Warn about quoted symbols in defcustom choice/other formsLars Ingebrigtsen2022-05-111-0/+6
| | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--suspicious-defcustom-choice): New function (bug#16271). (byte-compile-nogroup-warn): Use it to warn about forms like (choice (const :tag "foo" 'bar)).
* | Move buffer-local-set-state to subr because it's used at runtimeLars Ingebrigtsen2022-05-061-12/+0
| | | | | | | | | | | | * lisp/subr.el (buffer-local-set-state) (buffer-local-set-state--get, buffer-local-restore-state): Moved from easy-mmode.el because they have to be available run-time.
* | Add new helper macros for minor modes to restore variablesLars Ingebrigtsen2022-05-061-1/+11
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/modes.texi (Defining Minor Modes): Document it. * lisp/emacs-lisp/easy-mmode.el (buffer-local-set-state): New macro. (buffer-local-set-state--get): Helper function. (buffer-local-restore-state): New function. * lisp/textmodes/word-wrap-mode.el (word-wrap-whitespace-mode): Use it to simplify code.
* | Remove unused lexvar in subr-x-tests.elBasil L. Contovounesios2022-05-041-13/+11
| | | | | | | | | | | | * test/lisp/emacs-lisp/subr-x-tests.el (test-with-buffer-unmodified-if-unchanged): Pacify unused lexvar byte-compiler warning. Simplify slightly and reindent.
* | Make some recently added tests actually runLars Ingebrigtsen2022-05-031-0/+34
| |
* | nadvice.el: Use OClosuresStefan Monnier2022-04-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/nadvice.el (advice): New OClosure type. (advice--how-alist): Make it hold prototype OClosures rather than bytecode strings. (advice--bytecodes): Delete var. (advice--where): Make it an obsolete alias of new `advice--how`. (oclosure-interactive-form, cl-print-object) <advice>: New methods. (advice--make-1): Delete function. (advice--make): Use `advice-copy` and `advice-cons`. (advice--tweak): Use `advice-cons`. (add-function, advice-add): Rename `where` arg to `how`. * lisp/emacs-lisp/cl-print.el (cl-print-object) <:extra "nadvice">: Remove now-redundant ad-hoc method. * test/lisp/emacs-lisp/nadvice-tests.el (advice-test-print): New test.
* | Pretty print OClosure slot accessorsStefan Monnier2022-04-261-4/+4
| | | | | | | | | | | | | | * lisp/emacs-lisp/oclosure.el (oclosure--accessor-cl-print): New function. * lisp/emacs-lisp/cl-print.el (cl-print-object) <accessor>: New method. * test/lisp/emacs-lisp/nadvice-tests.el (advice-test-call-interactively): Avoid `defun` within a function.
* | New generic function `oclosure-interactive-form`Stefan Monnier2022-04-261-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's used by `interactive-form` when it encounters an OClosure. This lets one compute the `interactive-form` of OClosures dynamically by adding appropriate methods. This does not include support for `command-modes` for Oclosures. * lisp/simple.el (oclosure-interactive-form): New generic function. * src/data.c (Finteractive_form): Delegate to `oclosure-interactive-form` if the arg is an OClosure. (syms_of_data): New symbol `Qoclosure_interactive_form`. * src/eval.c (Fcommandp): Delegate to `interactive-form` if the arg is an OClosure. * src/lisp.h (VALID_DOCSTRING_P): New function, extracted from `store_function_docstring`. * src/doc.c (store_function_docstring): Use it. * lisp/kmacro.el (kmacro): Don't carry any interactive form. (oclosure-interactive-form) <kmacro>: New method, instead. * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-interactive-form) <oclosure-test>: New method. (oclosure-test-interactive-form): New test. * doc/lispref/commands.texi (Using Interactive): Document `oclosure-interactive-form`.