all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69647: [PATCH 1/2] Delete trailing whitespace when formatting LSP documentation
@ 2024-03-08 15:48 Philip Kaludercic
  2024-03-08 20:41 ` João Távora
  2024-03-08 20:54 ` Jim Porter
  0 siblings, 2 replies; 11+ messages in thread
From: Philip Kaludercic @ 2024-03-08 15:48 UTC (permalink / raw)
  To: 69647; +Cc: João Távora

[-- 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-03-22  8:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08 15:48 bug#69647: [PATCH 1/2] Delete trailing whitespace when formatting LSP documentation Philip Kaludercic
2024-03-08 20:41 ` 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

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.