From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gento Newsgroups: gmane.emacs.help Subject: syntax highlighting for comments Date: Tue, 8 Sep 2009 01:26:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <42fdb144-4df2-4489-9842-243504e404d0@a7g2000yqo.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1252399241 21290 80.91.229.12 (8 Sep 2009 08:40:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2009 08:40:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 08 10:40:34 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 1MkwFd-0000DT-Jp for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Sep 2009 10:40:33 +0200 Original-Received: from localhost ([127.0.0.1]:35981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MkwFc-0005qd-Uf for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Sep 2009 04:40:32 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!a7g2000yqo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 80.75.192.71 Original-X-Trace: posting.google.com 1252398365 2426 127.0.0.1 (8 Sep 2009 08:26:05 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 8 Sep 2009 08:26:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a7g2000yqo.googlegroups.com; posting-host=80.75.192.71; posting-account=m5mUNAoAAACclRRo3KuF4zL6ydgW80wn User-Agent: G2/1.0 X-HTTP-Via: 1.0 chbad-s-sa2px02.ch.abb.com:8082 (squid/2.5.STABLE12) X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:172814 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:67954 Archived-At: Hi All, I'm using emacs to edit journal text files *.jou, for which commented lines start with the character "/". I apply the comment syntax for the "*.jou" files by adding to the .emacs file the lines (add-hook 'find-file-hooks (lambda () (when (string-match "\\.jou$" (buffer-file-name)) (setq comment-start "/") ) ) ) Now I would also like to turn the text of the commented lines into red, and for this I added the line (font-lock-add-keywords nil '("\\(/.*\\)$" (1 font-lock-comment- face))) which unfortunately doesn=92t work. Does anybody know where the mistake is? Many thanks gento