Let ?\LF signal an error (bug#55738)

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.
This commit is contained in:
Mattias Engdegård
2022-06-03 10:12:24 +02:00
parent e48c9181b1
commit 28622d4dd0
3 changed files with 9 additions and 2 deletions

View File

@@ -318,8 +318,8 @@ literals (Bug#20852)."
'(## . 2))))
(ert-deftest lread-escaped-lf ()
;; ?\LF should produce LF (only inside string literals do we ignore \LF).
(should (equal (read-from-string "?\\\n") '(?\n . 3)))
;; ?\LF should signal an error; \LF is ignored inside string literals.
(should-error (read-from-string "?\\\n x"))
(should (equal (read-from-string "\"a\\\nb\"") '("ab" . 6))))
;;; lread-tests.el ends here