all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 67180@debbugs.gnu.org
Subject: bug#67180: 30.0.50; 'pp-to-string' emits extra newline
Date: Tue, 14 Nov 2023 21:12:34 +0100	[thread overview]
Message-ID: <m1y1f0drgt.fsf@dazzs-mbp.home> (raw)


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





             reply	other threads:[~2023-11-14 20:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 20:12 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-14 20:37 ` bug#67180: 30.0.50; 'pp-to-string' emits extra newline Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 12:01 ` Eli Zaretskii
2023-11-15 12:52   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 13:10     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 14:16       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 15:34         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-16 16:20           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1y1f0drgt.fsf@dazzs-mbp.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67180@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.