From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: font-lock-defaults doesn't work?? Date: Sun, 15 Apr 2007 09:48:27 +0200 Message-ID: <4621D8CB.5030905@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1176623281 18728 80.91.229.12 (15 Apr 2007 07:48:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2007 07:48:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: tury.peter@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 15 09:47:55 2007 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 1HczSj-0002AF-Ui for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Apr 2007 09:47:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HczXC-0003Nu-At for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Apr 2007 03:52:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HczX0-0003Nf-4D for help-gnu-emacs@gnu.org; Sun, 15 Apr 2007 03:52:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HczWx-0003N3-Ao for help-gnu-emacs@gnu.org; Sun, 15 Apr 2007 03:52:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HczWx-0003N0-23 for help-gnu-emacs@gnu.org; Sun, 15 Apr 2007 03:52:15 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HczSR-0000fn-Il for help-gnu-emacs@gnu.org; Sun, 15 Apr 2007 03:47:36 -0400 Original-Received: (qmail invoked by alias); 15 Apr 2007 07:47:29 -0000 Original-Received: from N776P031.adsl.highway.telekom.at (EHLO [62.47.40.255]) [62.47.40.255] by mail.gmx.net (mp040) with SMTP; 15 Apr 2007 09:47:29 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/JHrdYZMLJVhKKrAzFJYufPtsjlE0dI4mJ1Qewbg 1HTiVYLWeoY7pm User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:42698 Archived-At: The problem is that for `t-syntax-table' you use `make-syntax-table' which inherits from `standard-syntax-table' (the one used for Fundamental mode) since you don't specify an OLDTABLE argument. `font-lock-set-defaults' first uses `copy-syntax-table' with the value returned by `syntax-table' as argument (which could be `emacs-lisp-mode-syntax-table' since you encounter problems with semicolons) and then applies the modifications you provided. But when you define t-mode you eventually have to think about other things as well - moving around in that buffer, parsing, skipping comments, ... Hence you eventually need t-syntax-table with the comment-syntax you define anyway for buffers in t-mode. What's wrong with providing that syntax-table as the current one to font-locking?