From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Trouble fontifying /** ... */ Date: Fri, 9 Jan 2009 05:21:57 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <9e66205f-0f64-47da-8eef-b351311beba6@d42g2000prb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1231518058 25238 80.91.229.12 (9 Jan 2009 16:20:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Jan 2009 16:20:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 09 17:22:07 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LLK7E-0003Mb-TT for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jan 2009 17:21:45 +0100 Original-Received: from localhost ([127.0.0.1]:40203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LLK5y-0007I3-Tv for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jan 2009 11:20:26 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!b38g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1231507317 6868 127.0.0.1 (9 Jan 2009 13:21:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 9 Jan 2009 13:21:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b38g2000prf.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165870 X-Mailman-Approved-At: Fri, 09 Jan 2009 11:20:11 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61209 Archived-At: On Jan 8, 8:54=C2=A0pm, Davin Pearson wrote: > I have invented a language called SJS that it a mixture of Pascal and > Java for easier learning of the Java language. =C2=A0In sjs-mode > I would like the following code: > > /** > =C2=A0 I am a Javadoc-style comment. > */ > > To be fontified in font-lock-doc-face but I cannot find an elegant way > to do this. =C2=A0What 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 * =E2=80=9C# ...\n=E2=80=9D. Start with a char to newline char. * =E2=80=9C// ... \n=E2=80=9D. Start with 2 identical chars to newline = char. * =E2=80=9C(* ... *)=E2=80=9D. A matching pair chars with another char. * =E2=80=9C/* ... */=E2=80=9D. Two chars used in a ad hoc way as matchi= ng 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. =E2=80=A2 How To Add Comment Handling In Your Major Mode http://xahlee.org/emacs/elisp_comment_handling.html See also Rick (rgb)'s experience, at =E2=80=A2 http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/4= 65e9d84d8e5dadd# =E2=80=A2 http://groups.google.com/group/comp.emacs/browse_frm/thread/c1b7d= e4489be181?tvc=3D1 Xah =E2=88=91 http://xahlee.org/ =E2=98=84