I am writing a minor mode for enabling support for JML within Java files. I realized the syntax highlighting with cc-mode's support for documentation comments.

It works if I set c-doc-comment-style to (jml javadoc) in a file-local variable. Enabling JML doc comments interactively (similar SO question) with

(add-to-list 'c-doc-comment-style '(java-mode . jml))

does not work. (The call of c-setup-doc-comment-style is explicit mention in the documentation.)

Has anyone experience with interactive en- and disabling doc comment highlighting in cc-mode and can give me a hint on my mistake? Or should I file a bug report?

Via the great font-lock-studio, I found out that the font-lock-keywords are not updated by c-setup-doc-comment-style. In particular the entry:

  (c-font-lock-doc-comments jml-start-multiline limit jml--font-lock-doc-comments))
  (0 nil)

is missing.

Tested with built-in cc-mode from GNU Emacs 26.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-29.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.