help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Trouble fontifying /** ... */


From: Xah Lee
Subject: Re: Trouble fontifying /** ... */
Date: Fri, 9 Jan 2009 05:21:57 -0800 (PST)
User-agent: G2/1.0

On Jan 8, 8:54 pm, Davin Pearson <davin.pear...@gmail.com> wrote:
> I have invented a language called SJS that it a mixture of Pascal and
> Java for easier learning of the Java language.  In sjs-mode
> I would like the following code:
>
> /**
>   I am a Javadoc-style comment.
> */
>
> To be fontified in font-lock-doc-face but I cannot find an elegant way
> to do this.  What follows is some Emacs version information,
> via report-emacs-bug:

your question is a FAQ but without much polished answer.

Emac's syntax tables for comments address only the following classes
of comment syntax

    * “# ...\n”. Start with a char to newline char.
    * “// ... \n”. Start with 2 identical chars to newline char.
    * “(* ... *)”. A matching pair chars with another char.
    * “/* ... */”. Two chars used in a ad hoc way as matching pair.

If your comment syntax is more complex, you cannot use syntax table
for it. You have to use font-lock-syntactic-keywords, and also you'll
need to implement your own comment-dwim.

• How To Add Comment Handling In Your Major Mode
  http://xahlee.org/emacs/elisp_comment_handling.html

See also Rick (rgb)'s experience, at

• 
http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/465e9d84d8e5dadd#http://groups.google.com/group/comp.emacs/browse_frm/thread/c1b7de4489be181?tvc=1

  Xah
∑ http://xahlee.org/

reply via email to

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