From: Mark Wooding Date: Thu, 12 Sep 2024 12:14:49 +0000 (+0100) Subject: el/dot-emacs (mdw-fontify-rust): Defeat doc-comment highlighting properly. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/e09f045c4bc7703f709178b07f6c80a809daa03a el/dot-emacs (mdw-fontify-rust): Defeat doc-comment highlighting properly. I don't want to highlight documentation comments differently from ordinary comments. I noticed, back in 77ccc2aa..., that this was done using `font-lock-syntactic-face-function, and decided to force that to `nil'. I was right about the cause, but so wrong about the solution. If the variable is `nil', then you just get errors about trying to apply `nil'. There is a default value, which selects `string' or `comment' based on the `parse-partial-sexp' state, but for some stupid reason this default is just a lambda expression in the `defvar' form rather than having a name like `font-lock-default-syntactic-face-function' or something. Override the Rust-mode choice with the default (which isn't doing anything other than the doc-comment highlighting behaviour that I don't want) with the default. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index fddcf78..911226b 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -3389,7 +3389,8 @@ (defun mdw-fontify-rust () ;; And anything else is punctuation. (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)" '(0 mdw-punct-face))) - font-lock-syntactic-face-function nil)) + font-lock-syntactic-face-function + (default-value 'font-lock-syntactic-face-function))) ;; Hack key bindings. (local-set-key [?{] 'mdw-self-insert-and-indent)