unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 72597@debbugs.gnu.org, brownts@troybrown.dev,
	felician.nemeth@gmail.com,
	Daniel Pettersson <daniel@dpettersson.net>
Subject: bug#72597: 30.0.60; Eglot: MarkedString with embedded Carriage Return
Date: Fri, 6 Sep 2024 20:31:08 +0100	[thread overview]
Message-ID: <CALDnm53UwUGiLd3ad+9sFFP5O40bWDhBdD_1=krZd2o5Xrz=Dw@mail.gmail.com> (raw)
In-Reply-To: <861q1x2v6j.fsf@gnu.org>

On Fri, Sep 6, 2024 at 6:44 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Daniel Pettersson <daniel@dpettersson.net>
> > Cc: Eli Zaretskii <eliz@gnu.org>,  Troy Brown <brownts@troybrown.dev>,
> >   felician.nemeth@gmail.com,  72597@debbugs.gnu.org
> > Date: Thu, 05 Sep 2024 23:32:08 +0200
> >
> > > Anyway, if the solution is to be performed at this lower
> > > level (which I think it should), then Daniel Petterson
> > > jsonrpc.el maintainer should be added.
> >
> > I might be missing something, but jsonrpc should not in my mind
> > convert/format/encode any json data.  Any assumptions on line endings
> > can only be made on header and content separators, not on the json
> > payload itself.
>
> That depends on the reason why the CR character appeared there in the
> first place.  Are they required for the strings in questions, or are
> they simply an artifact of how the server marshaled JSON data on the
> wire?

Indeed this is the question.  And it is not necessarily easy to asnwer.
For example most LSP servers may be used to edit CRLF terminated
files, and when doing so they will possibly exchange file snippets with
intentional CR chars in them (however odd that may be for most
people, it can happen).  But that is theoretically completely independent
of the decision to terminate documentation snippets with CRLF or just
LF or just CR.  Both these kinds of snippets are transmitted as JSON
strings over the wire.  jsonrpc.el makes them Elisp strings and (afair)
doesn't do any newline conversion.

Even if Eglot is most well positioned to answer this question in
the LSP case, i don't think it can: there's no interface for doing so.
If it could, then it could theoretically ask jsonrpc.el to do that
conversion. But it can't.

So perhaps something like Troys patch for the "doc view" layer
is best if inefficient/hacky.  Even fixing it in gfm-view-mode isn't a bad
idea. But also, I don't think this is a very urgent matter: the server
that does this is clearly in the minority.  I would just ask this server's
devs if they wouldn't mind not sending these odd doc snippets.

João





  parent reply	other threads:[~2024-09-06 19:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13  1:16 bug#72597: 30.0.60; Eglot: MarkedString with embedded Carriage Return Troy Brown
2024-08-13 11:18 ` Eli Zaretskii
2024-08-13 18:32   ` Felician Nemeth
2024-08-13 18:45     ` João Távora
2024-08-13 21:35       ` Troy Brown
2024-08-14  4:37         ` Eli Zaretskii
2024-08-14  5:54           ` Felician Nemeth
2024-08-14  6:37             ` Eli Zaretskii
2024-08-14 11:41               ` Troy Brown
2024-08-31  7:55                 ` Eli Zaretskii
2024-09-01 20:49                   ` Troy Brown
2024-09-02 11:24                     ` Eli Zaretskii
2024-09-02 12:31                       ` João Távora
2024-09-05 21:32                         ` Daniel Pettersson
2024-09-05 21:58                           ` João Távora
2024-09-06  5:44                           ` Eli Zaretskii
2024-09-06 16:00                             ` Daniel Pettersson
2024-09-06 19:31                             ` João Távora [this message]
2024-09-09  0:31                               ` Troy Brown

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CALDnm53UwUGiLd3ad+9sFFP5O40bWDhBdD_1=krZd2o5Xrz=Dw@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=72597@debbugs.gnu.org \
    --cc=brownts@troybrown.dev \
    --cc=daniel@dpettersson.net \
    --cc=eliz@gnu.org \
    --cc=felician.nemeth@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).