GNU bug report logs - #67180
30.0.50; 'pp-to-string' emits extra newline

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Tue, 14 Nov 2023 20:14:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: bug-gnu-emacs <at> gnu.org
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




This bug report was last modified 1 year and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.