--- Begin Message ---
Subject: |
30.0.50; 'pp-to-string' emits extra newline |
Date: |
Tue, 14 Nov 2023 21:12:34 +0100 |
On Emacs 29 and earlier, with `-Q`, we have:
(pp-to-string "foo")
=> "\"foo\""
On master with `-Q`, we get an extra newline at the end of the string:
(pp-to-string "foo")
=> "\"foo\"
"
AFAICT this change in behavior breaks `agda2-mode` completely on master.
This happens because apparently `agda2-mode` uses `pp-to-string` to
quote strings before sending them to a REPL (that doesn't expect the
newline the middle of a command):
--8<---------------cut here---------------start------------->8---
(defun agda2-string-quote (s)
"..."
(let ((pp-escape-newlines t)
(s2 (copy-sequence s)))
(set-text-properties 0 (length s2) nil s2)
(mapconcat 'agda2-char-quote (pp-to-string s2) "")))
^^^^^^^^^^^^^^^^^
--8<---------------cut here---------------end--------------->8---
In GNU Emacs 30.0.50 (build 24, x86_64-apple-darwin23.0.0, NS
appkit-2487.00 Version 14.0 (Build 23A344)) of 2023-11-13
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#67180: 30.0.50; 'pp-to-string' emits extra newline |
Date: |
Thu, 16 Nov 2023 11:20:44 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> Like this?
>>
>> diff --git a/etc/NEWS b/etc/NEWS
>> index 23f4a8b5311..2dcb2f5664e 100644
>> --- a/etc/NEWS
>> +++ b/etc/NEWS
>> @@ -1099,6 +1099,9 @@ showcases all their customization options.
>>
>> * Incompatible Lisp Changes in Emacs 30.1
>>
>> +** 'pp' and 'pp-to-string' now always include a terminating newline.
>> +In the past they included a terminating newline in most cases but not
>> all.
>> +
>> ** 'buffer-match-p' and 'match-buffers' take '&rest args'.
>> They used to take a single '&optional arg' and were documented to use
>> an unreliable hack to try and support condition predicates that
>>
>
> Exactly, yes. Thanks!
Thanks, pushed to `master`.
Closing,
Stefan
--- End Message ---