aboutsummaryrefslogtreecommitdiffstats
path: root/test/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Fix warnings in builds without tree-sitterMattias Engdegård2022-11-221-17/+47
|
* ; * test/src/treesit-tests.el (treesit-misc): Remove test.Yuan Fu2022-11-211-21/+0
| | | | | This test is for treesit--setting-for-mode, which is removed when we switched from using treesit-settings to using separate major modes.
* Merge remote-tracking branch 'savannah/master' into feature/tree-sitterYuan Fu2022-11-2111-148/+6975
|\
| * ; Fix typosStefan Kangas2022-11-203-7/+7
| |
| * ; Fix typosStefan Kangas2022-11-182-2/+2
| |
| * Reduce buffer-tests noisiness even moreEli Zaretskii2022-11-161-5/+5
| | | | | | | | | | | | | | | | * test/src/buffer-tests.el (test-kill-buffer-auto-save-default) (test-kill-buffer-auto-save-delete-yes) (test-kill-buffer-auto-save-delete-no) (test-buffer-modifications, test-restore-buffer-modified-p): Shut up auto-save messages. (Bug#59028)
| * Reduce buffer-tests noisiness when run in batch mode.Matt Armstrong2022-11-161-42/+35
| | | | | | | | | | | | | | * test/src/buffer-tests.el (overlay-modification-hooks): Remove noisy `message' calls and use `ert-info' to log context of test failures. (bug#59028) (overlay-tests-start-recording-modification-hooks): ditto.
| * ; Fix typosStefan Kangas2022-11-111-1/+1
| |
| * Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)Matt Armstrong2022-11-101-58/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests had been annoying to me when run in interactive mode. They failed to bind `kill-buffer-delete-auto-save' as needed, so they depended on the user's settings, and they failed to mock out the "Buffer modified, save?" prompt. * test/src/buffer-tests.el (test-kill-buffer-auto-save): New helper function that mocks the two different kinds of prompts that occur when killing modified buffers that visit a file. Tests fail if expected prompts are not issued. (test-kill-buffer-auto-save-default): Use it, and explicitly bind `kill-buffer-delete-auto-save' to nil. (test-kill-buffer-auto-save-delete): Delete it. (test-kill-buffer-auto-save-delete-yes): New test for the "yes" half of the old `test-kill-buffer-auto-save-delete'. (test-kill-buffer-auto-save-delete-yes): Ditto for the "no" half.
| * itree.c and buffer-tests.el: Incorporate code review feedbackMatt Armstrong2022-11-061-12/+17
| | | | | | | | | | | | | | | | * src/itree.c: Improve wording in `itree_insert_gap` comment. * test/src/buffer-tests.el (test-overlay-insert-before-markers-at-start): Don't rely on (point-min) being 1. (test-overlay-insert-before-markers-at-end): ditto. (test-overlay-insert-before-markers-empty): ditto.
| * buffer.c: evaporate overlays in all indirect buffersStefan Monnier2022-11-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug#58928. The patch works by moving the `evaporate_overlays` check closer to `itree_delete_gap`. * src/buffer.c (adjust_overlays_for_delete_in_buffer): New function, integrating the functionality of `evaporate_overlays`. (adjust_overlays_for_delete): Use it. (evaporate_overlays): Delete function. * src/buffer.h (evaporate_overlays): Delete declaration. * src/insdel.c (adjust_markers_for_replace): Minor optimization. (adjust_after_replace, replace_range, replace_range_2, del_range_2): Don't call `evaporate_overlays`. * test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate): Remove the `:expected-result :failed` attribute.
| * Add a test for overlay evaporation across indirect buffersMatt Armstrong2022-11-051-0/+36
| | | | | | | | | | | | * test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate): Test evaporation of overlays triggered by deleting text in base and in indirect buffers. Test doesn't pass at the moment.
| * Tweak the overlay related `insert-before-markers' testsMatt Armstrong2022-11-051-22/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/buffer-tests.el (test-overlay-insert-before-markers-empty): Move code down to the other tests related to insertion. Test all front/rear insert combinations. To make the test more clear, at least to me, hard code all character positions. (test-overlay-insert-before-markers-at-start): For both front-advance modes verify that `insert-before-markers' at and overlay's start advances it. (test-overlay-insert-before-markers-at-end): For both rear-advance modes test that `insert-before-markers' at an overlay's end advances it. (test-overlay-insert-before-markers-non-empty): Delete, replaced by the two tests above.
| * itree: Reproduce markers's behavior more faithfully (bug#58928)Stefan Monnier2022-11-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The most obvious problem was the lack of support for `insert-before-markers`, but the behavior was also different in a few other cases. * src/itree.h (itree_insert_gap): * src/itree.c (itree_insert_gap): Add `before_markers` arg. * src/lisp.h (adjust_overlays_for_insert): * src/buffer.c (adjust_overlays_for_insert): Add `before_markers` arg. * src/insdel.c (adjust_markers_for_replace, adjust_markers_for_insert) (adjust_markers_for_delete): Adjust overlays directly from here. (insert_1_both, insert_from_string_1, insert_from_gap) (insert_from_buffer_1, adjust_after_replace, replace_range) (replace_range_2, del_range_2): Don't adjust overlays explicitly here any more. * test/src/buffer-tests.el (test-overlay-insert-before-markers-empty) (test-overlay-insert-before-markers-non-empty): New tests.
| * src/buffer.c: Fix interaction between overlays & indirect buffers (bug#58928)Stefan Monnier2022-11-011-0/+21
| | | | | | | | | | | | | | | | | | | | * src/buffer.c (adjust_overlays_for_insert) (adjust_overlays_for_delete): Repeat for all buffers sharing the same text. * src/itree.c (itree_insert_gap, itree_delete_gap): Allow an empty tree. * test/src/buffer-tests.el (buffer-tests--overlays-indirect-bug58928): New test.
| * Merge remote-tracking branch 'origin/feature/noverlay'Stefan Monnier2022-10-281-0/+6665
| |\
| | * Add `get-pos-property' tests covering bug#58706Matt Armstrong2022-10-221-0/+43
| | | | | | | | | | | | | | | | | | | | | * test/src/buffer-tests.el (get-pos-property-overlay-beg): New test. (get-pos-property-overlay-empty-rear-advance): ditto. (get-pos-property-overlay-past-rear-advance): ditto. (get-pos-property-overlay-at-narrowed-end): ditto.
| | * Fix a narrow-to-region vs. overlays-at bugMatt Armstrong2022-10-211-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See bug#58703. * src/buffer.c (overlays_in): Add a new TRAILING arg expressing the behavior wanted by `overlays-at', namely to include all overlays beginning at the POS passed to `overlays-at', even if POS is the end of the narrowed region. Pass true and the search range is extended to ZV+1 if END is greater than ZV, just as is done for EMPTY. (overlays_at): Pass 'true' for the new trailing arg. At present this is the only caller passing 'true'. (mouse_face_overlay_overlaps): Pass 'false' for the new trailing arg. (disable_line_numbers_overlay_at_eob): ditto. (Foverlays_in): ditto. * src/editfns.c (overlays_around): ditto. * test/src/buffer-tests.el (sorted-overlays): Add a spot test for this.
| | * Fix handling of overlays that begin at END in 'overlays_in'Matt Armstrong2022-10-211-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passed EMPTY, 'overlays_in' should return empty overlays at END. It was doing so, but it was also returning any other overlay that happened to begin at END. bug#58672 * src/buffer.c (overlays_in): Don't return overlays at END unless they are empty overlays. (disable_line_numbers_overlay_at_eob): Pass 'false' instead of 'NULL' for the bool 'empty' arg. * test/src/buffer-tests.el (sorted-overlays-in): New helper function. (test-overlays-in-empty-range): New test exhaustively covering these edge conditions. (test-overlays-in-empty-range-bug58672): Simple test for one case.
| | * src/textprop.c (get_char_property_and_overlay): Fix bug#58479Stefan Monnier2022-10-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Correct `get-char-property` which failed to ignore empty overlays. * src/textprop.c (get_char_property_and_overlay): Make sure the overlay covers the character. * test/src/buffer-tests.el (buffer-tests--overlay-bug58479): New test. * src/buffer.h (buffer_has_overlays): Avoid `interval_tree_size`.
| | * ; * test/src/buffer-tests.el: Remove unecessary `message' calls.Matt Armstrong2022-10-091-2/+0
| | |
| | * ; * test/src/buffer-tests.el (test-overlay-randomly): new test.Matt Armstrong2022-10-081-0/+92
| | |
| | * Merge 'master' into noverlayStefan Monnier2022-09-2556-888/+11446
| | |\
| | * | Expand overlay multibyte testsAndreas Politz2017-10-071-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | * test/src/buffer-tests.el (test-overlay-multibyte-transition-1): Expand test. (test-overlay-multibyte-transition-2): New test.
| | * | Add test exposing overlay bugAndreas Politz2017-10-051-0/+101
| | | | | | | | | | | | | | | | * test/src/buffer-tests.el (overlay-autogenerated-test-64): New test.
| | * | Add test regarding overlay and buffer encodingAndreas Politz2017-10-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | * test/src/buffer-tests.el (test-overlay-multibyte-transition-1): New test exposing a bug regarding overlays when changing the multibyteness of a buffer.
| | * | Provide a new tree data-structure for overlays.Andreas Politz2017-10-041-0/+7519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/itree.c (interval_generator_narrow, interval_generator_next) (interval_node_init, interval_node_begin) (interval_node_end, interval_node_set_region) (interval_tree_create, interval_tree_clear) (interval_tree_init, interval_tree_destroy) (interval_tree_size, interval_tree_insert) (interval_tree_contains, interval_tree_remove) (interval_tree_validate, interval_tree_iter_start) (interval_tree_iter_finish, interval_tree_iter_next) (interval_tree_iter_ensure_space, interval_tree_max_height) (interval_tree_insert_gap, interval_tree_delete_gap) (interval_generator_create, interval_generator_reset) (interval_generator_ensure_space, interval_node_intersects) (interval_generator_next, interval_generator_narrow) (interval_generator_destroy, interval_stack_create) (interval_stack_destroy, interval_stack_clear) (interval_stack_ensure_space, interval_stack_push) (interval_stack_push_flagged, interval_stack_pop) (interval_tree_update_limit, interval_tree_inherit_offset) (interval_tree_propagate_limit, interval_tree_rotate_left) (interval_tree_rotate_right, interval_tree_insert_fix) (interval_tree_remove_fix, interval_tree_transplant) (interval_tree_subtree_min): New file and new functions. * src/itree.h: New file. * configure.ac: Create Makefile for manual overlay tests. * src/Makefile.in: Add itree.o target. * src/alloc.c (build_overlay, mark_overlay, mark_buffer) (sweep_misc, sweep_buffers): Adapt to new tree data-structure. * src/buffer.c (overlays_in, overlays_at): Remove unused arguments prev_ptr and change_req, adapt to new data-structure and reuse code. (copy_overlays, drop_overlays, delete_all_overlays) (reset_buffer, kill-buffer, buffer-swap-text, next_overlay_change) (previous_overlay_change, mouse_face_overlay_overlaps) (disable_line_numbers_overlay_at_eob, overlay_touches_p) (overlay_strings, adjust_overlays_for_insert) (adjust_overlays_for_delete, overlayp, make-overlay, move-overlay) (delete-overlay, overlay-start, overlay-end, overlay-buffer) (overlay-properties, overlays-at, overlays-in) (next-overlay-change, previous-overlay-change, overlay-put) (overlay-get, report_overlay_modification, evaporate_overlays) (init_buffer_once): Adapt to changes and tree data-structure. (overlay-lists, overlay-recenter): Funtions are now obsolete, but kept anyway. (set_buffer_overlays_before, set_buffer_overlays_after) (recenter_overlay_lists,fix_start_end_in_overlays,fix_overlays_before) (unchain_overlay,): Removed functions of the old list data-structure. (swap_buffer_overlays, make_sortvec_item): New functions. (sort_overlays): Adapt to changes and tree data-structure. (sortvec): Moved to buffer.h . (make_lispy_interval_node, overlay_tree, overlay-tree) [ITREE_DEBUG]: New debugging functions. * src/buffer.h (overlays_before, overlays_after): Removed struct member of the list data-structure. (overlays): Added tree struct member. (sortvec): Moved here from buffer.c . (GET_OVERLAYS_AT): Adapt to changes. (set_buffer_intervals, OVERLAY_START, OVERLAY_END, OVERLAY_PLIST): Adapt to tree data-structure. (OVERLAY_POSITION): Removed macro of the list data-structure. (OVERLAY_REAR_ADVANCE_P, OVERLAY_FRONT_ADVANCE_P): New macros. (overlay_start, overlay_end) (set_overlay_region, maybe_alloc_buffer_overlays) (free_buffer_overlays, add_buffer_overlay) (remove_buffer_overlay, buffer_overlay_iter_start) (buffer_overlay_iter_next, buffer_overlay_iter_finish) (buffer_overlay_iter_narrow): New functions. (compare_overlays, make_sortvec_item): Export functions. * src/editfns.c (overlays_around): Reuse overlays_in. (get-pos-property): Adapt to tree data-structure. (transpose-regions): Remove call to deleted function. * src/fileio.c: (insert-file-contents): Remove references to deleted struct member. * src/fns.c (internal_equal): Adapt to tree data-structure. * src/indent.c (check_display_width): Adapt to tree data-structure. (skip_invisible): Remove call to deleted function. * src/insdel.c (adjust_markers_for_insert): Remove calls to deleted functions. * src/intervals.c (adjust_for_invis_intang): Adapt to tree data-structure. * src/keyboard.c (adjust_point_for_property): Adapt to tree data-structure. * src/lisp.h (Lisp_Overlay): Modified struct layout. * src/print.c (temp_output_buffer_setup, print_object): Adapt to tree data-structure. * src/textprop.c (get_char_property_and_overlay): Adapt to tree data-structure. Take advantage of the new data-structure. * src/window.h (overlay_matches_window): New function. * src/xdisp.h (next_overlay_change): Removed function. Use next-overlay-change, which does not use xmalloc anymore. (handle_single_display_spec, load_overlay_strings) (back_to_previous_visible_line_start, note_mouse_highlight): Adapt to tree data-structure. (move_it_to, display_line): Remove calls to deleted functions. * src/xfaces.c (face_at_buffer_position): Adapt to changes and tree data-structure. * test/src/buffer-tests.el: Many tests regarding overlays added. * test/manual/noverlay/itree-tests.c: New file with tests of the tree data-structure on the C level. * test/manual/noverlay/Makefile.in: New file. * test/manual/noverlay/check-sanitize.sh: New file. * test/manual/noverlay/emacs-compat.h: New file. * test/manual/noverlay/.gitignore: New file. * test/manual/noverlay/overlay-perf.el: New file providing performance tests. * test/manual/noverlay/many-errors.h: New file.
| * | | ; Fix several symbol name typosStefan Kangas2022-10-262-2/+2
| | | |
| * | | Fix regexp matching with atomic strings and optimised backtrackingMattias Engdegård2022-10-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug occurs when an atomic pattern is matched at the end of a string and the on-failure-keep-string-jump optimisation is in effect, as in: (string-match "\\'\\(?:ab\\)*\\'" "a") which succeeded but clearly should not (bug#58726). Reported by Michael Heerdegen. * src/regex-emacs.c (PREFETCH): Add reset parameter. (re_match_2_internal): Use it for proper atomic pattern treatment. * test/src/regex-emacs-tests.el (regexp-atomic-failure): New test.
| * | | Audit some plist uses with new predicate argumentBasil L. Contovounesios2022-10-221-31/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Improve description of default predicate. * lisp/emacs-lisp/cl-extra.el (cl-getf, cl--set-getf): Assume plist-member always returns a cons. * lisp/emacs-lisp/gv.el (plist-get): Support new optional predicate argument (bug#47425#91). * lisp/emacs-lisp/map.el: Bump minor version. (map--dispatch): Remove now that bug#58563 is fixed. Break two remaining uses out into corresponding cl-defmethods. (map--plist-p): Add docstring. (map--plist-has-predicate, map--plist-member-1, map--plist-member) (map--plist-put-1, map--plist-put): New definitions for supporting predicate argument backward compatibly. (map-elt): Fix generalized variable getter under a predicate (bug#58531). Use predicate when given a plist. (map-put): Avoid gratuitous warnings when called without the hidden predicate argument. Improve obsoletion message. (map-put!): Use predicate when given a plist. (map-contains-key): Ditto. Declare forgotten advertised-calling-convention (bug#58531#19). (map--put): Group definition in file together with that of map-put!. * lisp/files-x.el (connection-local-normalize-criteria): Simplify using mapcan + plist-get. * lisp/net/eudc.el (eudc--plist-member): New convenience function. (eudc-plist-member, eudc-plist-get, eudc-lax-plist-get): Use it instead of open-coding plist-member. * src/fns.c (Fplist_get, plist_get, Fplist_put, plist_put): Pass the plist element as the first argument to the predicate, for consistency with assoc + alist-get. (Fplist_member, plist_member): Move from widget to plist section. Open-code the EQ case in plist_member, and call it from Fplist_member in that case, rather than the other way around. * test/lisp/apropos-tests.el (apropos-tests-format-plist): Avoid polluting obarray. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): Extend test with generalized variables, degenerate plists, and improper lists. * test/lisp/emacs-lisp/gv-tests.el: Byte-compile file; in the meantime bug#24402 seems to have been fixed or worked around. (gv-setter-edebug): Inhibit printing messages. (gv-plist-get): Avoid modifying constant literals. Also test with a predicate argument. * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Simplify docstring. (test-map-elt-testfn): Rename... (test-map-elt-testfn-alist): ...to this. Also test with a predicate argument. (test-map-elt-testfn-plist, test-map-elt-gv, test-map-elt-signature) (test-map-put!-plist, test-map-put!-signature) (test-map-contains-key-signature, test-map-plist-member) (test-map-plist-put): New tests. (test-map-contains-key-testfn): Also test with a predicate argument. (test-map-setf-alist-overwrite-key, test-map-setf-plist-insert-key) (test-map-setf-plist-overwrite-key): Avoid modifying constant literals. (test-hash-table-setf-insert-key) (test-hash-table-setf-overwrite-key): Fix indentation. (test-setf-map-with-function): Make test more precise. * test/lisp/net/eudc-tests.el: New file. * test/lisp/subr-tests.el (test-plistp): Extend test with circular list. * test/src/fns-tests.el (test-cycle-equal, test-cycle-nconc): Move from plist section to circular list section. (plist-put/odd-number-of-elements): Avoid modifying constant literals. (plist-member/improper-list): Simplify. (test-plist): Move to plist section. Also test with a predicate argument.
| * | | Expand 'random' testsuiteStefan Kangas2022-10-161-3/+17
| | | | | | | | | | | | | | | | | | | | * test/src/fns-tests.el (ert): Require. (fns-tests-random): Expand test.
| * | | ; Prefer HTTPS to HTTP in many URLsStefan Kangas2022-10-151-1/+1
| | | |
| * | | Add a test for sqlite "insert ... returning"Lars Ingebrigtsen2022-10-101-0/+13
| | | | | | | | | | | | | | | | | | | | * test/src/sqlite-tests.el (sqlite-returning): Add a test for "insert ... returning".
| * | | ; * test/src/fns-tests.el (fns-tests--string-lessp-cases): Extend.Mattias Engdegård2022-10-081-0/+2
| | | |
* | | | ; * test/src/treesit-tests.el (treesit-misc): Don't fail without tsMattias Engdegård2022-11-211-0/+1
| | | |
* | | | Allow checking for outdated nodes in tree-sitterYuan Fu2022-11-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now you can run (treesit-node-check node 'outdated). * doc/lispref/parsing.texi (Accessing Node Information): Update manual. * src/treesit.c (Ftreesit_node_check): Add new property 'outdated'. * test/src/treesit-tests.el (treesit-node-check): Add tests.
* | | | ; Remove some tree-sitter testsYuan Fu2022-11-141-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | * test/src/treesit-tests.el (treesit-parser-supplemental): Remove treesit-set-ranges, and treesit-get-ranges, as these functions are removed.
* | | | ; * test/src/treesit-tests.el (treesit-node-check): New test.Yuan Fu2022-11-141-0/+18
| | | |
* | | | Improve treesit-node-atYuan Fu2022-11-111-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/parsing.texi (Retrieving Node): Update manual. * lisp/treesit.el (treesit-node-at): Change semantic. It tries to return the node that a user would expect in various circumstances. * test/src/treesit-tests.el (treesit-node-at): New test.
* | | | Revise tree-sitter facility for multi-language buffersYuan Fu2022-11-041-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/parsing.texi (Multiple Languages): Extend and update manual. * lisp/treesit.el (treesit-range-functions): Remove variable. (treesit-range-settings): New variable. (treesit-range-rules): New function. (treesit--merge-ranges): New function. (treesit-update-ranges): Use treesit-range-settings instead of treesit-range-functions. (treesit-font-lock-rules): Fix docstring. (treesit-indent) (treesit-indent-region): Only update ranges in a region. * test/src/treesit-tests.el (treesit-range): New test.
* | | | Remove test of treesit-language-atYuan Fu2022-10-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because now it just calls a user-supplied function rather than doing any work by itself. * test/src/treesit-tests.el (treesit-parser-supplemental): Remove the test.
* | | | ; Update copyright yearsStefan Kangas2022-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/parsing.texi: * src/treesit.h: * test/src/treesit-tests.el: Update copyright years.
* | | | New tree-sitter toggle schemeYuan Fu2022-10-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version: central variable, everything controlled by treesit-settings. Major mode sets up tree-sitter/non-tree-sitter in a conditional branch, based on the setting. * lisp/treesit.el (treesit-settings): New option. (treesit-defun-type-regexp): Change docstring. (treesit-mode-supported) (treesit-required-languages) (treesit--local-variable-backup): Remove variables. (treesit--backup-local-variable) (treesit-mode) (global-treesit-mode--turn-on) (global-treesit-mode): Remove functions. (treesit--setting-for-mode): New function. (treesit-ready-p): New argument MODE, changed REPORT to QUIET, and LANGUAGEs to LANGUAGE (now it can be a single symbol or a list of them). (treesit-major-mode-setup): New function. Mostly comes from treesit-mode. * test/src/treesit-tests.el (treesit-misc): New test. * lisp/progmodes/python.el (python-mode): Move some setup code into the conditional branch at the end. * lisp/progmodes/js.el (js-json-mode) (js-mode): Move some setup code into the conditional branch at the end. * lisp/progmodes/ts-mode.el: Move tree-sitter setup into the conditional branch.
* | | | Skip tree-sitter tests unless language definition is availableYuan Fu2022-10-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/treesit-tests.el (treesit-basic-parsing) (treesit-node-api) (treesit-query-api) (treesit-narrow) (treesit-cross-boundary) (treesit-multi-lang) (treesit-node-supplemental): Add skip-unless form.
* | | | Merge branch 'master' into feature/tree-sitterYuan Fu2022-10-0510-330/+368
|\ \ \ \ | |/ / /
| * | | Strengthen string-lessp testsMattias Engdegård2022-09-301-35/+42
| | | | | | | | | | | | | | | | | | | | * test/src/fns-tests.el (fns-tests--string-lessp-cases) (fns-tests-string-lessp): Check more cases, and in a more robust way.
| * | | Port better to C23 bool+true+false keywordsPaul Eggert2022-09-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C23 is adding the C++ keywords bool, true, and false; prefer them to <stdbool.h> if they are available. * admin/merge-gnulib (GNULIB_MODULES): Add stdbool, which emulates C23 on pre-C23 platforms. (AVOIDED_MODULES): Remove stdbool; Gnulib has renamed this module to stdbool-c99 and nobody uses it so it does not need to be avoided. * m4/c-bool.m4: New file, from Gnulib stdbool module. * lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h: * src/emacs-module.c, src/nsterm.m, src/systhread.h: * test/src/emacs-module-resources/mod-test.c: Use the C23 style and use bool without including <stdbool.h>. The Gnulib stdbool module causes config.h to include stdbool.h on pre-C23 platforms. * src/emacs-module.h.in: Don’t include <stdbool.h> if C23 or later, or if it has already been included.
| * | | Don't crash in copy-alist with non-list argumentMattias Engdegård2022-09-251-0/+27
| | |/ | |/| | | | | | | | | | * src/fns.c (Fcopy_alist): Check argument type. * test/src/fns-tests.el (fns--copy-alist): New test.
| * | Remove max-specpdl-size overrun testMattias Engdegård2022-09-231-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/eval-tests.el (eval-tests--exceed-specbind-limit) (eval-exceed-specbind-with-signal-hook): Remove test that is no longer useful, since there is no longer any specpdl limit to overrun. (The test still passed but vacuously so, by hitting the max-lisp-eval-depth limit instead.) This silences an obsoletion warning.
| * | ; Fix warnings in --without-x buildStefan Kangas2022-09-231-0/+4
| | | | | | | | | | | | | | | | | | | | | * lisp/image/image-crop.el (image-scaling-factor) (image-property, image-size, imagep): * test/src/image-tests.el (image-size, image-mask-p) (image-metadata): Declare.