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: Font-lock of comments using comment tokens, does it work? Date: Wed, 03 Jun 2015 23:42:02 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433389521 21488 80.91.229.3 (4 Jun 2015 03:45:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jun 2015 03:45:21 +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 Jun 04 05:45:21 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z0M5l-00019e-3f for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Jun 2015 05:45:17 +0200 Original-Received: from localhost ([::1]:40037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0M5k-0005uL-BW for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Jun 2015 23:45:16 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Injection-Info: mx02.eternal-september.org; posting-host="7d373ed72892ee578c208d3ba2c61e92"; logging-data="11695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4V7Ndqkn2N5LRrxaXnKFd" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:KhUD/fEzObWHzgC6jW/3/3QzVcs= sha1:f9URUnikMR4pGEt3fgvXT4zNs+E= Original-Xref: usenet.stanford.edu gnu.emacs.help:212458 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104742 Archived-At: > If you think you know what it should be changed to, can you tell me? I don't know enough of the context to be sure. Also, as Emacs maintainer I have enough experience/knowledge to fix most users's problems, but if I do that I'll just end up with more users with new problems to fix. So instead I'm better off trying to train them so they can fix their problems themselves and even help me improve Emacs. > I've tried a dozen different permutations of the regexp and none of > them produces the desired result. What have you tried? What/where were the undesired results? > I've also read the syntactic font-lock and syntax table sections of > the manual several times and I still don't get it. So you've covered the basics, good. The thing you need to understand is that it all boils down to the "syntax" given to the "!" character. The default is set in the buffer-local syntax-table, and this default is adjusted by `syntax-table' text-properties which are applied via syntax-propertize. So you can always go to a "!" and then hit C-u C-x = to see what is the syntax of *this* particular "!" character, and whether that is the desired syntax. If it's not, then you can try M-: (re-search-forward "theregexp" nil t) to see if the pattern you used does match or doesn't match this char. Stefan