GNU bug report logs - #79282
30.1; scheme-mode docstrings not highlighting with font-lock-doc-face

Previous Next

Package: emacs;

Reported by: Joe <jjbigorra <at> gmail.com>

Date: Wed, 20 Aug 2025 21:55:02 UTC

Severity: normal

Found in version 30.1

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Joe <jjbigorra <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 79282 <at> debbugs.gnu.org
Subject: bug#79282: 30.1; scheme-mode docstrings not highlighting with font-lock-doc-face
Date: Thu, 21 Aug 2025 09:39:29 +0300
> From: Joe <jjbigorra <at> gmail.com>
> Date: Wed, 20 Aug 2025 23:54:37 +0200
> 
> Dear Emacs Maintainers,
> 
> I am writing to report an issue I've observed in scheme-mode,
> specifically concerning the highlighting of docstrings. In scheme-mode
> (which inherits from lisp-mode), docstrings are currently being
> displayed as regular strings, using `font-lock-string-face', instead
> of being highlighted with `font-lock-doc-face'.
> 
> I expected docstrings in Scheme code, similar to those in Elisp or
> Common Lisp modes, should be highlighted distinctly using
> `font-lock-doc-face' for better readability and semantic distinction.
> I noticed in Elisp and Common Lisp this works perfectly, for all forms
> and variants (variables, defmethods, defun, etc.)
> 
> The problem is, when defining functions or macros in scheme-mode with
> a docstring, the docstring string literal is treated identically to
> any other string literal in terms of font locking.
> 
> I am a bit of a newbie when it comes to the lower levels of Emacs, and
> its modes, but I have looked into the source code of scheme-mode and
> it appears to contain the necessary functionality to correctly
> identify and highlight docstrings. For instance, I found lines such as
> :
> 
> (put 'define* 'scheme-doc-string-elt 2)
> 
> which seems to properly register docstring elements for font locking.
> This suggests that the mechanism for identifying docstrings is in
> place, but perhaps the application of font-lock-doc-face isn't
> occurring as intended, or there's an interaction issue with
> lisp-mode's inheritance.
> 
> Example (for illustration and clarity purposes):
> 
> (define (my-function arg)
>   "This is a docstring for my-function."
>   (+ arg 1))
> 
> In the example above, the string "This is a docstring for
> my-function." now appears with the font-lock-string-face , when it
> should instead be using font-lock-doc-face.
> 
> I run Emacs on Guix btw.
> 
> I would appreciate it if you could investigate this issue. Thank you
> for your time and dedication to maintaining the allmighty Emacs.

Stefan, any suggestions?




This bug report was last modified today.

Previous Next


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