GNU bug report logs - #60338
[PATCH] Add option to present server changes as diffs

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Mon, 26 Dec 2022 13:43:02 UTC

Severity: normal

Tags: patch

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 60338 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: bug#60338: [PATCH] Add option to present server changes as diffs
Date: Mon, 12 Jun 2023 14:56:30 +0300
> From: Philip Kaludercic <philipk <at> posteo.net>
> Date: Sun, 11 Jun 2023 21:33:40 +0000
> 
> +       ((eq confirm 'diff)
> +        (with-current-buffer (get-buffer-create " *Changes*")
> +          (buffer-disable-undo (current-buffer))
> +          (let ((buffer-read-only t))
> +            (diff-mode))
> +          (let ((inhibit-read-only t)
> +                (target (current-buffer)))
> +            (erase-buffer)
> +            (pcase-dolist (`(,path ,edits ,_) prepared)
> +              (with-temp-buffer
> +                (let ((diff (current-buffer)))
> +                  (with-temp-buffer
> +                    (insert-file-contents path)
> +                    (eglot--apply-text-edits edits)
> +                    (diff-no-select path (current-buffer)
> +                                    nil t diff))

Isn't there a better way of presenting the edits in human-readable
form than apply them and then run Diff?  What format is used by the
server itself to send the edits?

Besides, this assumes the 'diff' command is available, which is not
portable -- one more reason not to go that way, or at leas provide an
alternative.




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

Previous Next


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