From: Po Lu <luangruo@yahoo.com>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: master f866c85ac4e: (jsonrpc--log-event): Try and fix bug#68072
Date: Sun, 07 Jan 2024 18:38:31 +0800 [thread overview]
Message-ID: <87jzol77iw.fsf@yahoo.com> (raw)
In-Reply-To: <20240107050218.48567C002E0@vcs2.savannah.gnu.org> (Stefan Monnier via Mailing list for Emacs changes's message of "Sun, 7 Jan 2024 00:02:18 -0500 (EST)")
Stefan Monnier via Mailing list for Emacs changes <emacs-diffs@gnu.org>
writes:
> branch: master
> commit f866c85ac4e32df8061b285b6b44b15346994f3d
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
> (jsonrpc--log-event): Try and fix bug#68072
>
> * lisp/jsonrpc.el (jsonrpc--log-event): Force the use of
> `lisp-indent-function` in `pp-to-string`.
> ---
> lisp/jsonrpc.el | 21 +++++++++++----------
> 1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
> index 3f33443f321..f0f5842a0ee 100644
> --- a/lisp/jsonrpc.el
> +++ b/lisp/jsonrpc.el
> @@ -1003,16 +1003,17 @@ of the API instead.")
> (or method "")
> (if id (format "[%s]" id) "")))))
> (msg
> - (cond ((eq format 'full)
> - (format "%s%s\n" preamble (or json log-text)))
> - ((eq format 'short)
> - (format "%s%s\n" preamble (or log-text "")))
> - (t
> - (format "%s%s" preamble
> - (or (and foreign-message
> - (concat "\n" (pp-to-string
> - foreign-message)))
> - (concat log-text "\n")))))))
> + (pcase format
> + ('full (format "%s%s\n" preamble (or json log-text)))
> + ('short (format "%s%s\n" preamble (or log-text "")))
> + (_
> + (format "%s%s" preamble
> + (or (and foreign-message
> + (let ((lisp-indent-function ;bug#68072
> + #'lisp-indent-function))
> + (concat "\n" (pp-to-string
> + foreign-message))))
> + (concat log-text "\n")))))))
> (goto-char (point-max))
> ;; XXX: could use `run-at-time' to delay server logs
> ;; slightly to play nice with verbose servers' stderr.
Is there any substantive reason it was necessary to replace cond with
pcase? If not, why was cond replaced with pcase?
Thanks.
next parent reply other threads:[~2024-01-07 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <170460373801.27011.3995281640682361109@vcs2.savannah.gnu.org>
[not found] ` <20240107050218.48567C002E0@vcs2.savannah.gnu.org>
2024-01-07 10:38 ` Po Lu [this message]
2024-01-07 15:02 ` master f866c85ac4e: (jsonrpc--log-event): Try and fix bug#68072 Stefan Monnier
2024-01-08 2:19 ` Po Lu
2024-01-07 16:54 ` Stefan Kangas
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=87jzol77iw.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).