From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Elena Newsgroups: gmane.emacs.help Subject: Re: How to make font lock work with comments? Date: Thu, 30 Dec 2010 00:43:29 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <8649bced-1240-483b-ba41-9bc581938275@t8g2000prh.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: dough.gmane.org 1293702122 11441 80.91.229.12 (30 Dec 2010 09:42:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 09:42:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 30 10:41:58 2010 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.69) (envelope-from ) id 1PYF1A-0006QS-65 for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 10:41:56 +0100 Original-Received: from localhost ([127.0.0.1]:41362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYF19-0002tp-LH for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2010 04:41:55 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!l32g2000yqc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: 89.96.190.244 Original-X-Trace: posting.google.com 1293698614 8325 127.0.0.1 (30 Dec 2010 08:43:34 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 30 Dec 2010 08:43:34 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l32g2000yqc.googlegroups.com; posting-host=89.96.190.244; posting-account=AFCLjAoAAABJAOf_HjgEEEi3ty-lG5m2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:183737 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:77962 Archived-At: On Dec 29, 9:50=C2=A0am, rusi wrote: > Im hacking on an apl mode > > =C2=A0(let ((st (make-syntax-table)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (comment-char ?\x235d)) > : > : > =C2=A0(modify-syntax-entry comment-char "<" st) > > This char shows as follows (Dont know if it shows elsewhere..) > > =E2=8D=9D A comment > > When I put point on the char and call describe-char I get > > --------------------------------- > =C2=A0 =C2=A0 =C2=A0 =C2=A0 character: =E2=8D=9D (9053, #o21535, #x235d) > preferred charset: unicode (Unicode (ISO10646)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0code point: 0x235D > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0syntax: < =C2=A0 =C2=A0 =C2=A0 = =C2=A0 which means: comment > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0category: .:Base > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0to input: type "{upshoe-jot}" or "{lamp= }" or "{comment}" or > "{@}" with apl-ascii > =C2=A0 =C2=A0 =C2=A0 buffer code: #xE2 #x8D #x9D > =C2=A0 =C2=A0 =C2=A0 =C2=A0 file code: not encodable by coding system iso= -latin-1-unix > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display: by this font (glyph code) > =C2=A0 =C2=A0 xft:-unknown-unifont-normal-normal-normal-*-12-*-*-*-d-0- > iso10646-1 (#x2359) > ------------------------------ > > In other words emacs sees this as a comment-type char (similar to what > it says for semicolon in elisp buffers > > And yet in an elisp buffer the ; to EOL is red > but here it is not. > > Any clues? Syntax and font-locking are two different things and are handled separately. Commands look at syntax, humans look at font-locking. Try typing the string ";" (quotes included) into an Elisp buffer and then calling `describe-char' on the semicolon: Emacs will tell you the semicolon is a comment char, yet it will be highlighting it as string. Check out `font-lock-add-keywords'.