From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: What is this syntax for in php-mode.el Date: Fri, 20 Apr 2007 16:17:40 +0200 Message-ID: <4628CB84.4040004@gmail.com> References: <462816B3.7080000@gmail.com> <86fy6v5x01.fsf@rakim.cfhp.org> <87slav8a7u.fsf@comcast.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1177078758 28187 80.91.229.12 (20 Apr 2007 14:19:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2007 14:19:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Robert D. Crawford" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 20 16:19:12 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 1Hetx9-0003os-3s for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2007 16:19:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Heu2D-0007E7-0m for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2007 10:24:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Heu0Y-0006i5-7l for help-gnu-emacs@gnu.org; Fri, 20 Apr 2007 10:22:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Heu0X-0006hh-O3 for help-gnu-emacs@gnu.org; Fri, 20 Apr 2007 10:22:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Heu0X-0006hZ-DO for help-gnu-emacs@gnu.org; Fri, 20 Apr 2007 10:22:41 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HetvS-0003Cr-FA for help-gnu-emacs@gnu.org; Fri, 20 Apr 2007 10:17:26 -0400 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:61619 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1HetvQ-0001Sk-8J; Fri, 20 Apr 2007 16:17:25 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 In-Reply-To: <87slav8a7u.fsf@comcast.net> X-Antivirus: avast! (VPS 000735-0, 2007-04-20), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HetvQ-0001Sk-8J. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1HetvQ-0001Sk-8J bc99bcfd131f524f2c02de93b0ffa41a X-detected-kernel: Linux 2.6? (barebone, rare!) 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:42892 Archived-At: Robert D. Crawford wrote: > "Lennart Borgman (gmail)" writes: > >> Thanks Ted. Now I only wonder about that strange >> font-lock-syntactic-keywords spec that I can not find in the Emacs >> lisp manual. > > This might help, fetched with apropos: > > font-lock-syntactic-keywords is a variable defined in `font-lock.el'. > Its value is nil > > > Documentation: > A list of the syntactic keywords to put syntax properties on. > The value can be the list itself, or the name of a function or variable > whose value is the list. > > See `font-lock-keywords' for a description of the form of this list; > only the differences are stated here. MATCH-HIGHLIGHT should be of the form: > > (SUBEXP SYNTAX OVERRIDE LAXMATCH) > > where SYNTAX can be a string (as taken by `modify-syntax-entry'), a syntax > table, a cons cell (as returned by `string-to-syntax') or an expression whose > value is such a form. OVERRIDE cannot be `prepend' or `append'. > > Here are two examples of elements of `font-lock-syntactic-keywords' > and what they do: > > ("\\$\\(#\\)" 1 ".") > > gives a hash character punctuation syntax (".") when following a > dollar-sign character. Hash characters in other contexts will still > follow whatever the syntax table says about the hash character. > > ("\\('\\).\\('\\)" > (1 "\"") > (2 "\"")) > > gives a pair single-quotes, which surround a single character, a SYNTAX of > "\"" (meaning string quote syntax). Single-quote characters in other > contexts will not be affected. > > This is normally set via `font-lock-defaults'. Maybe. My trouble is that I can not fit something like the below into this format: (list ;; Mark _all_ # chars as being comment-start. That will be ;; ignored when inside a quoted string. '("\\(\#\\)" (1 (11 . nil))) ;; Mark all newlines ending a line with # as being comment-end. ;; This causes a problem, premature end-of-comment, when '#' ;; appears inside a multiline C-style comment. Oh well. '("#.*?\\([\n]\\)" (1 (12 . nil))) This code works except for trouble of the kind noted in the comment. I am trying to understand if there is any way around this problem.