aboutsummaryrefslogtreecommitdiffstats
path: root/test/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add binary format specifications '%b' and '%B'Jacob S. Gordon2025-12-221-2/+81
| | | | | | | | | | | | | | | | These produce the binary representation of a number. '%#b' and '%#B' prefix with '0b' and '0B', respectively. (bug#79990) * etc/NEWS: Announce change. * doc/lispref/strings.texi (Formatting Strings): Describe new format specs and add to comment on reconstructing the value with 'read'. * src/editfns.c (format): Update doc string. (styled_format): Add support for '%b' and '%B'. To remain portable, avoid use of 'sprintf' by converting by hand. * test/src/editfns-tests.el (format-binary-zero, format-binary-floats) (format-binary-nonzero-integers): Add tests. (read-large-integer): Add binary test cases. Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
* Improve handling of non-ASCII characters in 'transpose-regions'Jens Schmidt2025-12-201-0/+204
| | | | | | | | | | | * src/editfns.c (Ftranspose_regions): Separate code related to character semantics from that related to byte semantics and in that way leverage optimizations for regions of equal length with respect to both semantics. Move and update comments dating back to the initial implementation. * test/src/editfns-tests.el (editfns-tests--transpose-regions-tests) (editfns-tests--transpose-regions-markups) (editfns-tests--transpose-regions): New test and accompanying variables.
* Don't emit print-circle refs for empty string and vectorMattias Engdegård2025-12-041-1/+4
| | | | | | | | | The empty vector and string(s) are immutable, contain no references and always read as the same objects. * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Turn macro into... (print_circle_candidate_p): ...a function, and exclude [] and "". * test/src/print-tests.el (print-circle): Add test case.
* * test/src/data-tests.el (data-tests-ash-lsh): Test for bug#79876.Mattias Engdegård2025-11-291-0/+2
|
* ; Fix cleanup in buffer-testsEli Zaretskii2025-11-161-3/+13
| | | | | | * test/src/buffer-tests.el (test-restore-buffer-modified-p) (test-buffer-chars-modified-ticks): Don't leave unsaved and modified file buffers after the tests.
* * test/src/comp-tests.el (setcarcdr): Don't mutate literals.Mattias Engdegård2025-11-061-3/+3
|
* Change tree-sitter query predicate names (bug#79687)Yuan Fu2025-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Latest tree-sitter library throws a syntax error if the predicate names in a query don't end with question mark. So we made the following change: :equal changed to :eq? :match changed to :match? :pred changed to :pred? Old names are transparently converted to new names when expanding patterns. :match predicate can now take the regexp and the node in any order: it'll figure out which is which automatically. This way it works with current Emacs convention (regexp first), as well as tree-sitter's match convention (regexp second). * doc/lispref/parsing.texi (Pattern Matching): Update manuel to use new predicate names. * src/treesit.c: (Ftreesit_pattern_expand): (Ftreesit_query_expand): (treesit_predicate_match): (treesit_eval_predicates): (syms_of_treesit): Use new predicate names. * test/src/treesit-tests.el (treesit-query-api): Update test.
* Avoid face inheritance cyclesEli Zaretskii2025-10-271-0/+13
| | | | | | | | | | | | * src/xfaces.c (face_inheritance_cycle): New function. (Finternal_set_lisp_face_attribute): Signal an error if the ':inherit' attribute of a face is modified in a way that will cause it to inherit from itself. (Bug#79672) * test/src/xfaces-tests.el (xfaces-test-circular-inheritance): New test. * etc/NEWS: Announce the incompatible change.
* Add a test for puthashHelmut Eller2025-10-181-0/+16
| | | | | | | It's actually for a bug on the feature/igc branch. * test/src/fns-tests.el (ft-puthash-weak): New test (ft--puthash-weak): New helper.
* Respect keymaps in buffer text for clicks on displayed stringsSpencer Baugh2025-10-181-5/+16
| | | | | | | | | | | | | | | | | | | When clicking on a string displayed by a display property, also look at the text properties of the underlying buffer text for keymaps, not just the displayed string. The displayed string takes precedence over the buffer text, but it doesn't replace it. Also, we should use the buffer's local map even for clicks on the mode line. (Otherwise, what's the point of the <mode-line> event?) * src/keymap.c (Fcurrent_active_maps): Consider displayed string, then buffer text, then fall back to local map. (Bug#79505) * test/src/keymap-tests.el (keymap-test-keymaps-for-non-buffer-positions): Add more tests.
* Add some tests for weak hashtablesHelmut Eller2025-10-171-0/+127
| | | | | | | | | | | | Also add ft- as shorthand for fns-tests-. * test/src/fns-tests.el (ft-hash-table-weakness, ft-weak-key-removal) (ft-weak-value-removal, ft-weak-and-removal, ft-weak-or-removal): New tests. (ft--test-weak-removal, ft--gc, ft--check-entries, ft--check-entry) (ft--hash-table-entries, ft--populate-hashtable, ft--component-num) (ft--parse-component, ft--dead-component, ft--format-component) (ft--init-rng, ft--nentries): New helpers.
* Allow creating a pipe process without a bufferSpencer Baugh2025-10-111-0/+6
| | | | | | | | | | | | | Previously, even passing :buffer nil to make-pipe-process would create a buffer. Now, if you explicitly call (make-pipe-process :buffer nil), it will create a pipe process without a buffer, just like all the other process creation functions. * src/process.c (Fmake_pipe_process): Check for explicit :buffer nil and don't make a buffer. (bug#79596) * doc/lispref/processes.texi (Asynchronous Processes): Update. * test/src/process-tests.el (process-test-make-pipe-process-no-buffer): Add test.
* Fix failed tests on embaMichael Albinus2025-09-181-0/+2
| | | | | | | * test/lisp/autorevert-tests.el (auto-revert-test05-global-notify) (auto-revert-test07-auto-revert-several-buffers): Adapt tests. * test/src/comp-resources/comp-test-funcs.el (foo): Define error symbol.
* ; even less test log spam from loadMattias Engdegård2025-09-121-2/+2
|
* Ignore keymaps at point for positions outside the bufferSpencer Baugh2025-09-091-0/+27
| | | | | | | | | | | | | | | | Correct a few edge cases where we used the keymaps at point when looking up keymaps for an event position which is outside the current buffer. Namely: - Clicking on a part of the mode line which is after the end of mode-line-format produces an event with non-nil posn-area but nil posn-string. - Even if posn-string doesn't have a local keymap, we should still ignore the keymaps at point if posn-string is non-nil. * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point for more positions outside the buffer. (bug#76620)
* Disallow string data resizing (bug#79784)Mattias Engdegård2025-08-242-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Only allow string mutation that is certain not to require string data to be resized and reallocated: writing bytes into a unibyte string, and changing ASCII to ASCII in a multibyte string. This ensures that mutation will never transform a unibyte string to multibyte, that the size of a string in bytes never changes, and that the byte offsets of characters remain the same. Most importantly, it removes a long-standing obstacle to reform of string representation and allow for future performance improvements. * src/data.c (Faset): Disallow resizing string mutation. * src/fns.c (clear_string_char_byte_cache): * src/alloc.c (resize_string_data): Remove. * test/src/data-tests.el (data-aset-string): New test. * test/lisp/subr-tests.el (subr--subst-char-in-string): Skip error cases. * test/src/alloc-tests.el (aset-nbytes-change): Remove test that is no longer relevant. * doc/lispref/strings.texi (Modifying Strings): * doc/lispref/sequences.texi (Array Functions): * doc/lispref/text.texi (Substitution): Update manual. * etc/NEWS: Announce.
* Speed up JSON parsing by not maintaining line and column (bug#79192)Mattias Engdegård2025-08-211-0/+29
| | | | | | | | | | | | | | | | | | | | | | We use the current parsing position instead. The line and column in the error weren't used (nor very accurate to begin with) and the user can easily compute them when needed. The line number calculation is kept just in case but deprecated, for removal in Emacs 32. * src/json.c (struct json_parser, json_parser_init): Update parser state. (json_signal_error): New position computation. (json_skip_whitespace_internal): Remove. (is_json_whitespace): New. (json_skip_whitespace, json_skip_whitespace_if_possible) (json_parse_unicode, json_parse_string, json_parse_number) (json_parse_value): Simplify and rewrite for efficiency. (count_chars, count_newlines) (string_byte_to_pos, string_byte_to_line) (buffer_byte_to_pos, buffer_byte_to_line): New. (Fjson_parse_string, Fjson_parse_buffer): Adapt to new parser state. * test/src/json-tests.el (json-tests--parse-string-error-pos) (json-tests--parse-buffer-error-pos, json-parse-error-position): New. * etc/NEWS: Note deprecation of line and column.
* ; Stabilize a Windows-specific process-testEli Zaretskii2025-08-161-6/+6
| | | | | * test/src/process-tests.el (process-sentinel-interrupt-event): Improve stability of results, and show all of the results.
* ; Skip a process-test that is unreliable on MS-WindowsEli Zaretskii2025-08-161-0/+3
| | | | | * test/src/process-tests.el (process-tests/multiple-threads-waiting): Skip on MS-Windows.
* ; Fix thread-testsEli Zaretskii2025-08-101-1/+3
| | | | | | * test/src/thread-tests.el (make-thread): Fix declaration. (thread-set-buffer-disposition, thread-buffer-disposition): Declare. (Bug#76969)
* Allow thread's buffer to be killed, by defaultDmitry Gutov2025-08-091-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/thread.c (Fmake_thread): Add new argument (bug#76969). (thread_set_error): New function, extracted from thread-signal. (Fthread_buffer_disposition): Add getter. (Fthread_set_buffer_disposition): And setter. (thread_check_current_buffer): Check the values of threads' buffer_disposition. (thread_all_before_buffer_killed): New function. (init_threads): Set buffer_disposition to nil for the main thread. (syms_of_threads): Add new symbols and define the error. * src/thread.h (thread_state): New field buffer_disposition. (thread_all_before_buffer_killed): Declare. * src/buffer.c (Fkill_buffer): Call thread_check_current_buffer one more time after all hooks and after that call thread_all_before_buffer_killed. * src/comp.c (ABI_VERSION): Increase the value. * test/src/thread-tests.el (thread-buffer-disposition-t) (thread-buffer-disposition-nil) (thread-buffer-disposition-silently) (thread-set-buffer-disposition) (thread-set-buffer-disposition-main-thread): New tests. * doc/lispref/threads.texi (Basic Thread Functions): Document buffer-disposition in make-thread and its getter and setter. * etc/NEWS: Add entry.
* Fix some tests on OpenBSDManuel Giraud2025-08-071-1/+5
| | | | | | | * test/lisp/eshell/em-script-tests.el (em-script-test/batch-file/shebang): "env -S" is not supported. * test/src/fns-tests.el (fns-tests-random): 'random' is non-deterministic on OpenBSD. (Bug#79190)
* Move keyboard input functions from lread.c to keyboard.cMattias Engdegård2025-07-302-6/+6
| | | | | | | | | | | | These have nothing to do with the Lisp reader at all. Suggested by Lynn Winebarger (bug#79035). * src/lread.c (read_filtered_event, Fread_char, Fread_event) (Fread_char_exclusive, Qascii_character): Move... * src/keyboard.c: ...here. * test/src/lread-tests.el (test-inhibit-interaction): Move... * test/src/keyboard-tests.el (keyboard-inhibit-interaction): ...here.
* Check for end-of-file when reading character escapes (bug#79097)Mattias Engdegård2025-07-251-0/+31
| | | | | * src/lread.c (read_char_escape): Add check. * test/src/lread-tests.el (lread-char-escape-eof): New test.
* ; Avoid lexical-binding warning in lread-testsEli Zaretskii2025-07-191-2/+6
| | | | | * test/src/lread-tests.el (lread-test-bug-31186) (lread-tests--unescaped-char-literals): Avoid lexical-binding warning.
* ; silence some compiler warnings in testsMattias Engdegård2025-07-191-0/+1
| | | | | | | * test/lisp/savehist-tests.el (savehist-test-saved-variables): (savehist-test-duplicated-saved-symbols): * test/src/data-tests.el (binding-test-toplevel-values): Suppress harmless warnings.
* Speed up unintern, and fix symbol shorthand edge case (bug#79035)Mattias Engdegård2025-07-191-0/+77
| | | | | | | | | | Don't do a full lookup if the argument is a symbol, and only compute the hash index once. Fix a bug that occurred when there is another symbol whose shorthand is equal to the true name of the symbol being removed. * src/lread.c (Funintern): Rewrite for speed and correctness. (oblookup_last_bucket_number, oblookup): Remove now unused variable. * test/src/lread-tests.el (lread-unintern): New test.
* ; Fix last change.Eli Zaretskii2025-07-171-0/+1
|
* ; * test/src/fileio-tests.el (fileio-tests--read-directory): New test.Eli Zaretskii2025-07-171-0/+15
|
* ; Fix 'threads-join-error' testEli Zaretskii2025-07-141-5/+10
| | | | | | | * test/src/thread-tests.el (threads-thread-sleeps): New helper function. (threads-join-error): Fix to work as intended, and remove the 'unstable' tag. (Bug#40823)
* * src/fns.c (Flength): Fix char table length off-by-one bug.Mattias Engdegård2025-07-111-1/+2
|
* Nativecomp don't materialize non-materializable objects (bug#78606)Andrea Corallo2025-07-092-0/+11
| | | | | | | | | | | | | | The native compiler should not try to generate in rendered code immediate floats produced by the constrain on the '=' operator. * test/src/comp-tests.el (comp-test-78606-1): Add test. * test/src/comp-resources/comp-test-funcs.el (comp-test-78606-1-f): New function. * src/comp.c (emit_mvar_rval): Check if an immediate is materializable. * lisp/emacs-lisp/comp.el (comp-ctxt): Add 'non-materializable-objs-h' slot. (comp--fwprop-insn): Update call. * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Add parameter.
* Read non-ASCII chars from unibyte string sources as raw bytesMattias Engdegård2025-07-071-0/+6
| | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/lread.c (readchar): Convert to raw byte. * test/src/lread-tests.el (lread-unibyte-string-source): New test.
* Print non-ASCII chars in unibyte symbols as raw bytesMattias Engdegård2025-07-071-0/+7
| | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/print.c (print_object): Call the correct function. * test/src/print-tests.el (print-unibyte-symbols): New test.
* Read characters from functions as multibyteMattias Engdegård2025-07-071-0/+5
| | | | | | | Previously, latin-1 was incorrectly assumed (bug#70988). * src/lread.c (readchar): Set multibyte flag. * test/src/lread-tests.el (lread-function-source): New test.
* (Ftranspose_regions): Fix bug#76124Stefan Monnier2025-07-061-0/+25
| | | | | | | * src/editfns.c (Ftranspose_regions): Be careful that ELisp code could move the gap from under our feet. * test/src/editfns-tests.el (editfns-tests--bug76124): New test.
* Avoid extra output in Vprin1_to_string_buffer (bug#78842)Pip Cet2025-06-281-1/+3
| | | | | | | | | | | print_error_message can throw after producing some output, so use unwind-protect to ensure prin1-to-string-buffer is cleared. * src/print.c (erase_prin1_to_string_buffer): New. (Ferror_message_string): Use it to catch errors thrown in 'print_error_message'. * test/src/print-tests.el (error-message-string-circular): Expand test.
* (Finsert_file_contents): Refine commit d07af40d8826Stefan Monnier2025-06-271-0/+26
| | | | | | | | * src/fileio.c (Finsert_file_contents): Inhibit ask-supersession only if we're VISITing in a non-narrowed buffer (bug#78866). * test/src/fileio-tests.el (ert--tests-dir): New var. (fileio-tests--insert-file-contents-supersession): New test.
* Fix usage of 'treesit-defun-type-regexp' in treesit-tests.Juri Linkov2025-06-251-1/+2
| | | | | | | | * test/src/treesit-tests.el (treesit--ert-test-defun-navigation): Replace 'treesit-defun-type-regexp' with '(or treesit-defun-type-regexp 'defun)' that fixes the tests for ts-modes that set up the 'defun' thing instead of 'treesit-defun-type-regexp'.
* Make nativecomp don't error when encountering undeclared types (bug#6573)Andrea Corallo2025-06-171-0/+3
| | | | | | | * test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New function. * lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type' is unknown.
* Fix segfault in profiler-cpu-log and profiler-memory-log (bug#78763)Zach Shaftel2025-06-141-0/+58
| | | | | | | | * src/profiler.c (export_log): Check if a log has been allocated first, and return nil if it hasn't. (Fprofiler_cpu_log, Fprofiler_memory_log): Doc fix. * test/src/profiler-tests.el (profiler-tests-cpu-profiler) (profiler-tests-memory-profiler): New tests.
* Gather variable binding tests in data-tests.elSean Whitton2025-05-301-0/+44
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/lisp-tests.el (c-e-x, c-e-l): Move to data-tests.el. (core-elisp-tests-2-window-configurations): Rename ... (core-elisp-tests-1-window-configurations): ... to this. (core-elisp-tests-3-backquote): Rename ... (core-elisp-tests-2-backquote): ... to this. (core-elisp-tests-1-defvar-in-let) (core-elisp-tests-4-toplevel-values): Move and rename ... * test/src/data-tests.el (binding-test-defvar-in-let) (binding-test-toplevel-values): ... to these. (c-e-x, c-e-l): Moved from data-tests.el.
* Fix unsafe SDATA usage in print.c (bug#78590)Pip Cet2025-05-281-0/+18
| | | | | | | * src/print.c (print_string_1): Renamed from 'print_string', with an extra argument to disable nonascii escaping. (print_string): New function. (print_object): Use 'print_string_1', not 'strout'.
* Fix filelock-tests on MS-WindowsEli Zaretskii2025-05-121-14/+5
| | | | | | | | * test/src/filelock-tests.el (filelock-tests-file-locked-p-spoiled) (filelock-tests-unlock-spoiled) (filelock-tests-kill-buffer-spoiled): Don't special-case MS-Windows, as it was evidently fixed to signal the same error as Posix systems.
* Add test for file time-stamp granularity on MS-WindowsEli Zaretskii2025-05-111-0/+19
| | | | | * test/src/fileio-tests.el (fileio-tests-w32-time-stamp-granularity): New test.
* ; More fixes for treesit testsEli Zaretskii2025-05-051-0/+9
| | | | | | | | * test/src/treesit-tests.el (treesit-parse-string) (treesit-parser-tracking-line-column-p) (treesit-tracking-line-column-p, treesit--linecol-at) (treesit--linecol-cache-set, treesit--linecol-cache) (treesit-languages-require-line-column-tracking): Declare.
* ; Fix recently added treesit testsEli Zaretskii2025-05-051-0/+3
| | | | | | | * test/src/treesit-tests.el (treesit-linecol-basic) (treesit-linecol-search-back-across-newline) (treesit-linecol-col-same-line): Skip tests if tree-sitter is not available.
* Add line-column tracking for tree-sitterYuan Fu2025-05-031-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add line-column tracking for tree-sitter parsers. Copied from comments in treesit.c: Technically we had to send tree-sitter the line and column position of each edit. But in practice we just send it dummy values, because tree-sitter doesn't use it for parsing and mostly just carries the line and column positions around and return it when e.g. reporting node positions[1]. This has been working fine until we encountered grammars that actually utilizes the line and column information for parsing (Haskell)[2]. [1] https://github.com/tree-sitter/tree-sitter/issues/445 [2] https://github.com/tree-sitter/tree-sitter/issues/4001 So now we have to keep track of line and column positions and pass valid values to tree-sitter. (It adds quite some complexity, but only linearly; one can ignore all the linecol stuff when trying to understand treesit code and then come back to it later.) Eli convinced me to disable tracking by default, and only enable it for languages that needs it. So the buffer starts out not tracking linecol. And when a parser is created, if the language is in treesit-languages-require-line-column-tracking, we enable tracking in the buffer, and enable tracking for the parser. To simplify things, once a buffer starts tracking linecol, it never disables tracking, even if parsers that need tracking are all deleted; and for parsers, tracking is determined at creation time, if it starts out tracking/non-tracking, it stays that way, regardless of later changes to treesit-languages-require-line-column-tracking. To make calculating line/column positons fast, we store linecol caches for begv, point, and zv in the buffer (buf->ts_linecol_cache_xxx); and in the parser object, we store linecol cache for visible beg/end of that parser. In buffer editing functions, we need the linecol for start/old_end/new_end, those can be calculated by scanning newlines (treesit_linecol_of_pos) from the buffer point cache, which should be always near the point. And we usually set the calculated linecol of new_end back to the buffer point cache. We also need to calculate linecol for the visible_beg/end for each parser, and linecol for the buffer's begv/zv, these positions are usually far from point, so we have caches for all of them (in either the parser object or the buffer). These positions are far from point, so it's inefficient to scan newlines from point to there to get up-to-date linecol for them; but in the same time, because they're far and outside the changed region, we can calculate their change in line and column number by simply counting how much newlines are added/removed in the changed region (compute_new_linecol_by_change). * doc/lispref/parsing.texi (Using Parser): Mention line-column tracking in manual. * etc/NEWS: Add news. * lisp/treesit.el: (treesit-languages-need-line-column-tracking): New variable. * src/buffer.c: Include treesit.h (for TREESIT_EMPTY_LINECOL). (Fget_buffer_create): (Fmake_indirect_buffer): Initialize new buffer fields. (Fbuffer_swap_text): Add new buffer fields. * src/buffer.h (ts_linecol): New struct. (buffer): New buffer fields. (BUF_TS_LINECOL_BEGV): (BUF_TS_LINECOL_POINT): (BUF_TS_LINECOL_ZV): (SET_BUF_TS_LINECOL_BEGV): (SET_BUF_TS_LINECOL_POINT): (SET_BUF_TS_LINECOL_ZV): New inline functions. * src/casefiddle.c (casify_region): Record linecol info. * src/editfns.c (Fsubst_char_in_region): (Ftranslate_region_internal): (Ftranspose_regions): Record linecol info. * src/insdel.c (insert_1_both): (insert_from_string_1): (insert_from_gap_1): (insert_from_buffer): (replace_range): (del_range_2): Record linecol info. * src/treesit.c (TREESIT_BOB_LINECOL): (TREESIT_EMPTY_LINECOL): (TREESIT_TS_POINT_1_0): New constants. (treesit_debug_print_linecol): (treesit_buf_tracks_linecol_p): (restore_restriction_and_selective_display): (treesit_count_lines): (treesit_debug_validate_linecol): (treesit_linecol_of_pos): (treesit_make_ts_point): (Ftreesit_tracking_line_column_p): (Ftreesit_parser_tracking_line_column_p): New functions. (treesit_tree_edit_1): Accept real TSPoint and pass to tree-sitter. (compute_new_linecol_by_change): New function. (treesit_record_change_1): Rename from treesit_record_change, handle linecol if tracking is enabled. (treesit_linecol_maybe): New function. (treesit_record_change): New wrapper around treesit_record_change_1 that handles some boilerplate and sets buffer state. (treesit_sync_visible_region): Handle linecol if tracking is enabled. (make_treesit_parser): Setup parser's linecol cache if tracking is enabled. (Ftreesit_parser_create): Enable tracking if the parser's language requires it. (Ftreesit__linecol_at): (Ftreesit__linecol_cache_set): (Ftreesit__linecol_cache): New functions for debugging and testing. (syms_of_treesit): New variable Vtreesit_languages_require_line_column_tracking. * src/treesit.h (Lisp_TS_Parser): New fields. (TREESIT_BOB_LINECOL): (TREESIT_EMPTY_LINECOL): New constants. * test/src/treesit-tests.el (treesit-linecol-basic): (treesit-linecol-search-back-across-newline): (treesit-linecol-col-same-line): (treesit-linecol-enable-disable): New tests. * src/lisp.h: Declare display_count_lines. * src/xdisp.c (display_count_lines): Remove static keyword.
* (decode_coding): Avoid nested *-change-functions (bug#78042)Stefan Monnier2025-05-021-4/+24
| | | | | | | | | | | | | * src/coding.c (decode_coding): Avoid nested *-change-functions (bug#78042). * test/src/editfns-tests.el (sanity-check-change-functions-before) (sanity-check-change-functions-after): Record notifications in `sanity-check-change-functions-op`. (sanity-check-change-functions-with-op): Don't rely on `sanity-check-change-functions-op` always holding only the `op`. (sanity-check-change-functions-errors): Include the sequence of notifications in the error info. (editfns-tests--before/after-change-functions): Add tests for (bug#78042).
* Don't escape "." in `prin1' when followed by a letterSpencer Baugh2025-04-281-2/+4
| | | | | | | | | | | | | | | | | | | Among other users, let-alist widely uses symbols which start with a ".". Make those symbols print more nicely by tweaking the escaping rules in print_object to not escape a leading "." followed by a letter. This is a conservative change to avoid constraining future lexer changes. This is a followup to 637dde4aba921435f78d0de769ad74c4f3230aa6, which removed some unnecessary escaping of "." and "?" when printing symbols in prin1. (Actually, if we always escaped "?" (which was the case before 637dde4aba92) then "." only ever needs to be escaped when string_to_number returns non-nil. So 637dde4aba92 could have just dropped the escaping of "." with no other changes, if it didn't also remove escaping of "?") * src/print.c (print_object): Don't escape "." as the first character in a symbol if followed by a letter. (bug#77656). * test/src/print-tests.el (test-dots): Update for new behavior.