summaryrefslogtreecommitdiff
path: root/test/src/lread-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* Handle #@00 in new reader in a compatible way (bug#63722)Mattias Engdegård2023-05-261-0/+16
| | | | | | | | | | This was a regression from Emacs 28. * src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which is a quirk from the old reader that we preserve for compatibility. * test/src/lread-tests.el (lread-skip-to-eof): Verify it. Reported by Richard Newton.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Prefer pos-bol and pos-eol in testsStefan Kangas2022-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Make force-load-doc-strings work againMattias Engdegård2022-08-071-0/+17
| | | | | | | | | | | | | | | When load-force-doc-strings is true, read (#$ . POS) as the (unibyte) string referred to. This feature was lost by mistake in the recent nonrecursive reader rewrite. Noticed by Stefan Monnier. * src/lread.c (get_lazy_string): New function (code mostly recycled from an old version). (read0): Detect (#$ . FIXNUM) and retrieve the string if appropriate. * test/src/lread-resources/lazydoc.el: * test/src/lread-tests.el (lread-force-load-doc-strings): New test.
* Let ?\LF signal an error (bug#55738)Mattias Engdegård2022-06-031-2/+2
| | | | | | | | | As suggested by Stefan Monnier. * src/lread.c (read_escape): Signal an error for ?\LF since it cannot reasonably be intended. * test/src/lread-tests.el (lread-escaped-lf): Update test. * etc/NEWS: Announce.
* Make ?\LF generate 10, not -1 (bug#55738)Mattias Engdegård2022-06-021-0/+5
| | | | | | | | | | The old -1 value was an artefact of the reader implementation. * src/lread.c (read_escape): Remove the `stringp` argument; assume character literal syntax. Never return -1. (read_string_literal): Handle string-specific escape semantics here and simplify. * test/src/lread-tests.el (lread-escaped-lf): New test.
* Nonrecursive Lisp reader (bug#55676)Mattias Engdegård2022-05-301-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure the reader to be nonrecursive so that it is not limited by the C stack or crashes Emacs when reading deeply nested data. This also improves performance. A few minor bugs were fixed: - (a .{NBSP}b) where {NBSP} is a non-breaking space (U+00A0) is now the dotted pair (a . b), not the 3-element list (a \. b), since U+00A0 is treated as whitespace everywhere else. - #_ with no symbol following is now equivalent to ## (empty interned symbol), not #: (empty uninterned symbol). * src/alloc.c (garbage_collect): Call mark_lread. * src/lread.c (readevalloop): Use read0 instead of read_list. (stackbufsize): Increase to 1024, now that read0 isn't recursive. (invalid_radix_integer): Buffer overflow check. (read1, read_list, read_vector): Remove. (read_char_literal, read_string_literal) (hash_table_from_plist, record_from_list, vector_from_rev_list) (bytecode_from_rev_list, char_table_from_rev_list) (sub_char_table_from_rev_list, string_props_from_rev_list) (read_bool_vector, skip_lazy_string, symbol_char_span) (skip_space_and_comments) (enum read_entry_type, struct read_stack_entry, struct read_stack) (rdstack, mark_lread, read_stack_top, read_stack_pop) (read_stack_empty_p, grow_read_stack, read_stack_push): New. (read0): Rewrite to be nonrecursive. * test/src/lread-tests.el (lread-deeply-nested, lread-misc): New tests.
* Fix reader infinite recursion for circular mixed-type valuesMattias Engdegård2022-03-261-0/+22
| | | | | | | | | | | | | | Make sure that the value added to the `read_objects_completed` set is the one we actually return; previously this wasn't the case for conses because of an optimisation (bug#54501). Also add a check for vacuous self-references such as #1=#1# instead of returning a nonsense value from thin air. * src/lread.c (read1): Treat numbered conses correctly as described above. Detect vacuous self-references. * test/src/lread-tests.el (lread-test-read-and-print) (lread-test-circle-cases, lread-circle): Add tests.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | * src/lread.c (read_escape): Fix handling of ?\C-<char> for chars 128-255Stefan Monnier2021-11-141-0/+4
| |
* | Replace some macros with ert-with-temp-(file|directory)Stefan Kangas2021-11-061-9/+1
|/ | | | | | | | | | | | * test/lisp/custom-tests.el (custom-tests--with-temp-dir): * test/lisp/files-tests.el (files-tests--with-temp-file): * test/lisp/progmodes/project-tests.el (project-tests--with-temporary-directory): * test/src/emacs-module-tests.el (module--with-temp-directory): * test/src/emacs-tests.el (emacs-tests--with-temp-file): * test/src/lread-tests.el (lread-tests--with-temp-file): * test/src/process-tests.el (process-tests--with-temp-directory): Replace macros with 'ert-with-temp-(file|directory)'. Update callers.
* Fix lexing of numbers with trailing decimal point and exponentMattias Engdegård2021-05-271-0/+67
| | | | | | | | | | | | | | Numbers with a trailing dot and an exponent were incorrectly read as integers (with the exponent ignored) instead of the floats they should be. For example, 1.e6 was read as the integer 1, not 1000000.0 as every sane person would agree was meant. (Bug#48678) Numbers with a trailing dot but no exponent are still read as integers. * src/lread.c (string_to_number): Fix float lexing. * test/src/lread-tests.el (lread-float): Add test. * doc/lispref/numbers.texi (Float Basics): Clarify syntax.
* Add a new variable `inhibit-interaction'Lars Ingebrigtsen2021-01-121-0/+6
| | | | | | | | | | | | | | | | | | | * doc/lispref/elisp.texi (Top): Add a link. * doc/lispref/errors.texi (Standard Errors): Mention the new error. * doc/lispref/minibuf.texi (Minibuffers): Add a link. (Inhibiting Interaction): New node. * src/data.c (syms_of_data): Define the `inhibited-interaction' error. * src/lisp.h: Export the barfing function. * src/lread.c (Fread_char, Fread_event, Fread_char_exclusive): Barf if inhibited. * src/minibuf.c (barf_if_interaction_inhibited): New function. (Fread_from_minibuffer, Fread_no_blanks_input): Barf if inhibited. (syms_of_minibuf): Define the `inhibit-interaction' variable.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Move some test data to follow our conventionsStefan Kangas2020-10-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory.
* ; Fix license statements.Stefan Kangas2020-08-271-3/+3
|
* Remove lread tests for a feature that was deletedGlenn Morris2020-02-141-16/+0
| | | | | * test/src/lread-tests.el (lread-tests--old-style-backquotes) (lread-tests--force-new-style-backquotes): Remove.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Stop signaling an error when reading "smart quotes" in symbolsNoam Postavsky2019-11-281-17/+0
| | | | | | | | | | | Revert commits from 2018-01-28 "Fix round tripping of read->print for symbols with strange quotes", and 2017-07-22 "Signal error for symbol names with strange quotes (Bug#2967)". * etc/NEWS: Remove corresponding entries. * src/character.c (confusable_symbol_character_p): * test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove. * src/lread.c (read1): Don't signal error on confusable character. * src/print.c (print_object): Don't escape confusable characters.
* Fix some quoting glitches in doc stringsPaul Eggert2019-11-111-1/+1
|
* Don’t hard-loop on cycles in ‘read’ etc.Paul Eggert2019-08-211-0/+3
| | | | | | | | | | | | | | | Problem for ‘read’ reported by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html * src/fns.c (Frequire): Protect against circular current-load-list. * src/lread.c (Fget_load_suffixes): Protect against circular load-suffixes or load-file-rep-suffixes. (Fload): Protect against circular loads-in-progress. (openp): Protect against circular PATH and SUFFIXES. (build_load_history): Protect against circular load-history or current-load-list. (readevalloop_eager_expand_eval): Protect against circular SUBFORMS. (read1): Protect against circular data. * test/src/lread-tests.el (lread-circular-hash): New test.
* Make warning about unescaped character literals more helpful.Philipp Stephani2019-04-191-1/+3
| | | | | | | | | | | | | | | | | See Bug#31676. * lisp/emacs-lisp/byte-run.el (byte-run--unescaped-character-literals-warning): New defun. * src/lread.c (load_warn_unescaped_character_literals): Use new defun. (syms_of_lread): Define symbol for new defun. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Use new defun. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Fix assertion failure when reading 'BIGNUM.'Paul Eggert2018-08-211-0/+9
| | | | | | | | | | | | | | | | Problem reported by Stefan Monnier (Bug#32476). * src/lread.c (string_to_number): Don't pass leading "+" or trailing "." or junk to make_bignum_str. * test/src/lread-tests.el (lread-string-to-number-trailing-dot): New test.
* | Add some bignum testsTom Tromey2018-07-121-3/+1
| | | | | | | | | | | | | | | | * test/src/data-tests.el (data-tests-bignum, data-tests-+) (data-tests-/, data-tests-number-predicates): New tests. * test/src/fns-tests (test-bignum-eql): New test. * test/src/lread-tests (lread-long-hex-integer): Expect bignum. * test/src/print-tests (print-bignum): New test.
* | Fix failed assertion when load-force-doc-stringsPaul Eggert2018-05-221-0/+4
| | | | | | | | | | | | | | Problem reported by Philipp Stephani (Bug#31556). * src/lread.c (read_vector): When load_force_doc_strings, check for byte code vectors that are invalid because they are too short. * test/src/lread-tests.el (lread-invalid-bytecodes): New test.
* | Merge from origin/emacs-26Glenn Morris2018-04-201-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5de608f (origin/emacs-26) Update the documentation of 'perform-replace' 06245b6 * etc/NEWS: Another fix for the last change (noted by Juri Li... 8f6293c Fix use of @key in Texinfo manuals f4c9894 Improve documentation of actual arglist ce0e253 ; * etc/NEWS: Improve last change as proposed by Phil Sainty b89ff0e Don't assume term-current-row cache is valid (Bug#31193) 326a296 ; * etc/NEWS: Mention 'display-buffer-in-major-side-window' c... 3bdc9a1 Fix flyspell-auto-correct-previous-word broken by recent change a539eb5 * test/src/lread-tests.el (lread-test-bug-31186): New test. 3fa472b Fix undefined behaviour while looking for lexical-binding fil... 4341aac Minor wording improvement in "Bookmarks" Conflicts: test/src/lread-tests.el
| * * test/src/lread-tests.el (lread-test-bug-31186): New test.Eli Zaretskii2018-04-171-0/+8
| |
| * Revert "Signal error for symbol names with strange quotes (Bug#2967)"Noam Postavsky2018-01-281-17/+0
| | | | | | | | | | | | | | | | | | | | That commit did not make the corresponding change to printing, thus breaking the (eq (read (prin1-to-string SYM)) SYM) invariant for those symbols. It's too late in the release cycle to change printing behavior, therefore revert the reader change. Don't merge to master, the print function will be updated there (see "Fix round tripping of read->print for symbols with strange quotes").
* | Fix signal for large integers with valid syntaxPaul Eggert2018-04-171-0/+5
| | | | | | | | | | | | * src/lread.c (read_integer): If a radixed integer has valid syntax but is waayyy too large, signal overflow instead of invalid syntax. * test/src/lread-tests.el (lread-long-hex-integer): New test.
* | Improve error message for old-style backquotesPhilipp Stephani2018-01-071-2/+1
| | | | | | | | | | | | | | | | * src/lread.c (load_error_old_style_backquotes): Improve error message if no file is being loaded. * test/src/lread-tests.el (lread-tests--force-new-style-backquotes): Adapt test.
* | Add new variable to force new-style backquote interpretation.Philipp Stephani2018-01-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | * src/lread.c (syms_of_lread): Add new variable 'force-new-style-backquotes'. (read_internal_start): Use it. * test/src/lread-tests.el (lread-tests--force-new-style-backquotes): New test. * etc/NEWS: Document new variable.
* | Merge from origin/emacs-26Paul Eggert2018-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 63b04c11d5 Fix copyright years by hand 5c7dd8a783 Update copyright year to 2018 220a9ecba1 Merge from Gnulib 312c565566 Don't add empty keyboard macro to macro ring (Bug#24992) 39ca289a7a Allow customization of decoding of "man" command f8240815ea * etc/NEWS: Add security consideration note on passphrase ... 0c78822c70 Fix subtle problem with scroll-down when scroll-margin is ... acd289c5a4 Fix problems with indexing in User manual b240c7846b * lisp/help.el (describe-key): Only (copy-sequence elt) wh... e879a5444a * src/buffer.c (Frestore_buffer_modified_p): Fix bug#29846 81b1028b63 Improve documentation of 'inhibit-modification-hooks' and ... 7175496d7a Fix doc string of 'enable-recursive-minibuffers' 5b38406491 Fix documentation of delsel and of killing text # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex
| * Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | | | | | Run admin/update-copyright.
* | Raise an error when detecting old-style backquotes.Philipp Stephani2017-12-091-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They have been deprecated for a decade now. * src/lread.c (Fload): Don't use record_unwind_protect to warn about old-style backquotes any more. They now generate a hard error. (read1): Signal an error when detecting old-style backquotes. Remove unused label. (syms_of_lread): Remove unused internal variable 'lread--old-style-backquotes'. (load_error_old_style_backquotes): Rename from 'load_warn_oldstyle_backquotes'. Signal an error. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove check from byte compiler. It isn't triggered any more. * test/src/lread-tests.el (lread-tests--old-style-backquotes): Adapt unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--old-style-backquotes) (bytecomp-tests-function-put): Adapt unit tests. * etc/NEWS: Document change.
* | Revert "Raise an error when detecting old-style backquotes."Philipp Stephani2017-10-091-5/+5
| | | | | | | | This reverts commit 9613690f6e51e2f2aa2bcbbede3e209d08cfaaad.
* | Raise an error when detecting old-style backquotes.Philipp Stephani2017-10-081-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | They have been deprecated for a decade now. * src/lread.c (Fload): Don't use record_unwind_protect to warn about old-style backquotes any more. They now generate a hard error. (read1): Signal an error when detecting old-style backquotes. Remove unused label. (syms_of_lread): Remove unused internal variable 'lread--old-style-backquotes'. (load_error_old_style_backquotes): Rename from 'load_warn_oldstyle_backquotes'. Signal an error. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove check from byte compiler. It isn't triggered any more. * test/src/lread-tests.el (lread-tests--old-style-backquotes): Adapt unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--old-style-backquotes) (bytecomp-tests-function-put): Adapt unit tests. * etc/NEWS: Document change.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-2/+2
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Signal error for symbol names with strange quotes (Bug#2967)Noam Postavsky2017-07-221-0/+17
| | | | | | | | * src/lread.c (read1): Signal an error when a symbol starts with a non-escaped quote-like character. * test/src/lread-tests.el (lread-tests--funny-quote-symbols): New test. * etc/NEWS: Announce change.
* Fix core dump in substitute-object-in-subtreePaul Eggert2017-07-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this fix, (substitute-object-in-subtree #0=(#0# 'a) 'a) would dump core, since the C code would recurse indefinitely through the infinite structure. This patch adds an argument to the function, and renames it to lread--substitute-object-in-subtree as the function is not general-purpose and should not be relied on by outside code. See Bug#23660. * src/intervals.c (traverse_intervals_noorder): ARG is now void *, not Lisp_Object, so that callers need not cons unnecessarily. All callers changed. Also, remove related #if-0 code that was “temporary” in the early 1990s and has not been compilable for some time. * src/lread.c (struct subst): New type, for substitution closure data. (seen_list): Remove this static var, as this info is now part of struct subst. All uses removed. (Flread__substitute_object_in_subtree): Rename from Fsubstitute_object_in_subtree, and give it a 3rd arg so that it doesn’t dump core when called from the top level with an already-cyclic structure. All callers changed. (SUBSTITUTE): Remove. All callers expanded and then simplified. (substitute_object_recurse): Take a single argument SUBST rather than a pair OBJECT and PLACEHOLDER, so that its address can be passed around as part of a closure; this avoids the need for an AUTO_CONS call. All callers changed. If the COMPLETED component is t, treat every subobject as potentially circular. (substitute_in_interval): Take a struct subst * rather than a Lisp_Object, for the closure data. All callers changed. * test/src/lread-tests.el (lread-lread--substitute-object-in-subtree): New test, to check that the core dump does not reoccur.
* Make `old-style-backquotes' variable internalPhilipp2017-05-131-0/+9
| | | | | | | | | | | | | * src/lread.c (load_warn_old_style_backquotes, Fload, read1) (syms_of_lread): Rename `old-style-backquotes' to `lread--old-style-backquotes', and clarify that it's for internal use only. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename variable. * test/src/lread-tests.el (lread-tests--old-style-backquotes): Add unit test. * emacs-lisp/bytecomp-tests.el (bytecomp-tests--old-style-backquotes): Add unit test.
* Improve unescaped character literal warningsPhilipp Stephani2017-05-131-1/+1
| | | | | | | | | | | * src/lread.c (load_warn_unescaped_character_literals) (syms_of_lread): lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Improve formatting of unescaped character literal warnings. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): Adapt unit tests.
* Fix finding test .el filesGlenn Morris2017-05-091-8/+7
| | | | | * test/Makefile.in (ELFILES): Exclude the data/ directory. * test/src/lread-tests.el (lread-test-bug26837): Revert previous.
* Tweak a recent testTino Calancha2017-05-101-7/+8
| | | | | | | This test fails in my local machine because the data files are compiled, and the test doesn't expect that. * test/src/lread-tests.el (lread-test-bug26837): Match a suffix ending with '.elc' when the data files are compiled.
* Put re-loaded file back at start of load-history (bug#26837)Glenn Morris2017-05-091-0/+13
| | | | | | | | | * src/lread.c (readevalloop): Fix the "whole buffer" check to operate in the correct buffer. (Feval_buffer): Move point back to the start after checking for lexical binding. * test/src/lread-tests.el (lread-test-bug26837): New test. * test/data/somelib.el, test/data/somelib2.el: New test data files.
* Warn about missing backslashes during loadPhilipp Stephani2017-05-011-0/+26
| | | | | | | | | | | | | | | | * src/lread.c (load_warn_unescaped_character_literals, Fload, read1) (syms_of_lread): Warn if unescaped character literals are found (Bug#20152). * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check for unescaped character literals during byte compilation. * test/src/lread-tests.el (lread-tests--unescaped-char-literals): New unit test. (lread-tests--with-temp-file, lread-tests--last-message): Helper functions for unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--unescaped-char-literals): New unit test. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): Helper macro for unit test.
* Fix circular read syntax for records.Lars Brinkhoff2017-04-081-0/+4
| | | | | | * lread.c (substitute_object_recurse): Work with records. * lread-tests.el (lread-record-1): New test.