From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: What is this syntax for in php-mode.el Date: Fri, 20 Apr 2007 10:56:51 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177083464 27121 80.91.229.12 (20 Apr 2007 15:37:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Apr 2007 15:37:44 +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 Apr 20 17:37:35 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 1HevB0-0007EK-NB for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2007 17:37:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HevG4-0003oO-VD for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Apr 2007 11:42:49 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!nx01.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!bcklog2.nntp.dca.giganews.com!nntp.umontreal.ca!news.umontreal.ca.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 20 Apr 2007 09:56:51 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) Cancel-Lock: sha1:/egALHM0UU7uom9HS9V7We03aF8= Original-Lines: 38 Original-NNTP-Posting-Host: 132.204.27.213 Original-X-Trace: sv3-A3kciEH7gCIHW3G+2MRu56cLSpSVlRBnvF4899F5HHcM3Vzt00Jr50nHAKbPucgkQdAOPz6Kibwo5Fc!M8utuoCwR76sFPEw/eyjtYA6zj6aqIUvmj9XuxvvysQjnoRXaTFkqOBMhxg0ZaDZvP2UOqiyu9VS!n5ksZyZ9hcGoFYeNAA== Original-X-Complaints-To: abuse@umontreal.ca X-DMCA-Complaints-To: abuse@umontreal.ca X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Original-Xref: shelby.stanford.edu gnu.emacs.help:147296 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:42901 Archived-At: > I am looking at php-mode.el from Turadg. I can not understand this: > (defconst php-font-lock-syntactic-keywords > (if xemacsp nil > ;; Mark shell-style comments. font-lock handles this in a > ;; separate pass from normal syntactic scanning (somehow), so we > ;; get a chance to mark these in addition to C and C++ style > ;; comments. This only works in GNU Emacs, not XEmacs 21 which > ;; seems to ignore this same code if we try to use it. > (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))) > ))) > What is it for? Does php use # as a comment somewhere? > And what about the format for the list entries? I tried to look at > font-lock-syntactic-keywords, but I can not see that these entries follows > the spec there. > How does this work? Please tell the author that he doesn't need this gymnastics. Just set # to comment-starter in the syntax-table and be done with it. Make sure it has the comment-style (a or b) corresponding to the one of \n (presumably it's b, if I read the problem-comment above correctly): (modify-syntax-entry ?# "< b" php-mode-syntax-table) -- Stefan