emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-29 fbaf113bf38: rust-ts-mode: appropriately fontify doc string


From: Dmitry Gutov
Subject: Re: emacs-29 fbaf113bf38: rust-ts-mode: appropriately fontify doc strings
Date: Mon, 4 Dec 2023 15:42:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 04/12/2023 15:27, Arash Esbati wrote:
Dmitry Gutov<dgutov@yandex.ru>  writes:

branch: emacs-29
commit fbaf113bf38ee7db8416f0c0581d479c40b2d69c
Author: Christophe Troestler<Christophe.Troestler@umons.ac.be>
Commit: Dmitry Gutov<dmitry@gutov.dev>

     rust-ts-mode: appropriately fontify doc strings
* lisp/progmodes/rust-ts-mode.el
     (rust-ts-mode--comment-docstring): New function.
     (rust-ts-mode--font-lock-settings): Use it
     (https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00019.html).
[...]
+(defun rust-ts-mode--comment-docstring (node override start end &rest _args)
+  "Use the comment or documentation face appropriately for comments."
+  (let* ((beg (treesit-node-start node))
+         (end (treesit-node-end node))
+         (face (save-excursion
+                 (goto-char beg)
+                 (if (looking-at "///")
+                     'font-lock-doc-face
+                   'font-lock-comment-face))))
+    (treesit-fontify-with-override beg end face override start end)))
+
I think this change now produces:

   In rust-ts-mode--comment-docstring:
   progmodes/rust-ts-mode.el:296:61: Warning: Unused lexical argument ‘end’

This is with Emacs from master (cf11fdfd8e) on macOS.

Thanks, but this has been fixed 2 days ago (in a547b0e2e83).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]