all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: 69647@debbugs.gnu.org
Cc: "João Távora" <joaotavora@gmail.com>
Subject: bug#69647: [PATCH 1/2] Delete trailing whitespace when formatting LSP documentation
Date: Fri, 08 Mar 2024 15:48:43 +0000	[thread overview]
Message-ID: <87cys4enc4.fsf@posteo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Tags: patch

LSP servers like clangd generate trailing whitespace, that when rendered
as markdown causes parts of the buffer to be underlined.  Unless there
is a reason for this, I'd suggest helping out by deleting trailing
whitespace before continuing to process the documentation.



In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-03-08 built on peregrine
Repository revision: 4818022c7c45b04c55cf2a80ef689ee2681a5d78
Repository branch: master
System Description: Fedora Linux 39 (Workstation Edition)

Configured using:
 'configure --with-pgtk --with-native-compilation=aot
 --with-imagemagick'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Delete-trailing-whitespace-when-formatting-LSP-docum.patch --]
[-- Type: text/patch, Size: 859 bytes --]

From 0b0232193c40a39000576e49cd8fa7aada3a49e9 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Fri, 8 Mar 2024 16:02:40 +0100
Subject: [PATCH 1/2] Delete trailing whitespace when formatting LSP
 documentation

* lisp/progmodes/eglot.el (eglot--format-markup): Use
'delete-trailing-whitespace'.
---
 lisp/progmodes/eglot.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 1ec186e75f8..50820e81107 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1823,6 +1823,7 @@ eglot--format-markup
     (with-temp-buffer
       (setq-local markdown-fontify-code-blocks-natively t)
       (insert string)
+      (delete-trailing-whitespace (point-min) (point-max))
       (let ((inhibit-message t)
             (message-log-max nil)
             match)
-- 
2.44.0


[-- Attachment #3: Type: text/plain, Size: 37 bytes --]


-- 
	Philip Kaludercic on peregrine

             reply	other threads:[~2024-03-08 15:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 15:48 Philip Kaludercic [this message]
2024-03-08 20:41 ` bug#69647: [PATCH 1/2] Delete trailing whitespace when formatting LSP documentation João Távora
2024-03-08 20:54 ` Jim Porter
2024-03-08 21:02   ` João Távora
2024-03-08 21:36     ` Jim Porter
2024-03-09  3:08       ` Jim Porter
2024-03-09  9:02         ` Philip Kaludercic
2024-03-09 18:28           ` Jim Porter
2024-03-09 18:46             ` Philip Kaludercic
2024-03-11  3:50             ` Jim Porter
2024-03-22  8:49               ` Philip Kaludercic

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=87cys4enc4.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=69647@debbugs.gnu.org \
    --cc=joaotavora@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 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.