GNU bug report logs -
#34160
json-pretty-print deletes everything after first JSON object
Previous Next
Full log
Message #24 received at 34160 <at> debbugs.gnu.org (full text, mbox):
> From: Tassilo Horn <tsdh <at> gnu.org>
> Date: Wed, 31 Jul 2019 09:39:00 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 34160 <at> debbugs.gnu.org
>
> Hi Lars,
>
> when fixing bug#34160 you've reverted my changes that made json pretty
> printing use replace-region-contents. That had the major benefit that
> pretty printing the JSON object at point didn't move point. I use that
> many times a week on large JSON objects using the following command.
>
> --8<---------------cut here---------------start------------->8---
> (defun th/json-pretty-print-snippet-at-point (&optional minimize)
> "Pretty-print the json snippet at point."
> (interactive "P")
> (save-excursion
> (when-let ((beg (car (nth 9 (syntax-ppss)))))
> (goto-char beg)
> (forward-sexp)
> (when (looking-back "\n" beg)
> (backward-char))
> (json-pretty-print beg (point) minimize))))
> --8<---------------cut here---------------end--------------->8---
>
> AFAICS, the problem in bug#34160 was not caused by my changes (the user
> used Emacs 24 and not a 27 snapshot) so I see no justification for
> removing my feature.
>
> Could you please reinstall the feature or describe why it is not
> feasible to keep it?
Oops, sorry about that.
I think Lars is on vacation. If he doesn't respond in a day or two, I
will revert the change until this issue is resolved.
This bug report was last modified 5 years and 354 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.