From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#69647: [PATCH 1/2] Delete trailing whitespace when formatting LSP documentation Date: Fri, 08 Mar 2024 15:48:43 +0000 Message-ID: <87cys4enc4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="347"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 69647@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 08 16:50:41 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ricUY-000AL8-Gb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Mar 2024 16:50:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ricTV-0003U4-FZ; Fri, 08 Mar 2024 10:49:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ricTT-0003Hw-BU for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 10:49:31 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ricTT-0004AZ-0q for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 10:49:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ricTy-0003bQ-QB; Fri, 08 Mar 2024 10:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2024 15:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Received: via spool by submit@debbugs.gnu.org id=B.170991297113791 (code B ref -1); Fri, 08 Mar 2024 15:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Mar 2024 15:49:31 +0000 Original-Received: from localhost ([127.0.0.1]:59332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ricTS-0003aH-Ux for submit@debbugs.gnu.org; Fri, 08 Mar 2024 10:49:31 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ricTQ-0003a6-Fd for submit@debbugs.gnu.org; Fri, 08 Mar 2024 10:49:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ricSu-0000q1-1K for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 10:48:56 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ricSm-00044D-1b for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2024 10:48:54 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B854E240101 for ; Fri, 8 Mar 2024 16:48:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1709912924; bh=OQPy3QBQR+HxiWpkt2JX5Znsm79QCI4HoDA0Sa+6xpc=; h=From:To:Subject:OpenPGP:Date:Message-ID:MIME-Version:Content-Type: From; b=IomhC06AgDj7g0UESOS2JcUbqqAZpn2gc5T4ZqgnO6o2zJobCmwrQpbTOvjKWlYCJ zs0kgvC8kD5+ROvGYqeceS+YLaYIaekNXd7jdM23KlsmyYIu9JOSUNbyX6RE0/ESA6 4jomwLETCt2Y6qOoVt/bZ9aCwZr2j7K9PnavSW4u6sdbRkA4YR0eNfer59bAPRPlTi TqtUuS46uCq8Xz6awbpf5pDJ+qAxvCHFTXPTSiM0qhWjF+4GOEXeQKe+nthZuqxn7v nVNzU1cBwZ7JkLVewBpKCrS3KERyZTYLM5BY/DmSVkTiWg9bLYAniWPcAZiZr5DMDJ 6cAarwZa/V7Jw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TrrDr2K8nz9rxL for ; Fri, 8 Mar 2024 16:48:44 +0100 (CET) OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281239 Archived-At: --=-=-= Content-Type: text/plain 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Delete-trailing-whitespace-when-formatting-LSP-docum.patch >From 0b0232193c40a39000576e49cd8fa7aada3a49e9 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic 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 --=-=-= Content-Type: text/plain -- Philip Kaludercic on peregrine --=-=-=--