From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.help Subject: Re: help with font-lock-multiline Date: Tue, 28 Sep 2004 11:12:11 +0900 Organization: Emacsen advocacy group Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1096337993 3079 80.91.229.6 (28 Sep 2004 02:19:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 28 Sep 2004 02:19:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 28 04:19:45 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CC7aj-00006q-00 for ; Tue, 28 Sep 2004 04:19:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CC7h0-0003TO-BF for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Sep 2004 22:26:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-X-Trace: news.uni-berlin.de MNQydE/ueSxPAArSyQUe+wJLUMLyopQwl48xMWrnlkwq/kW7c= X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:h7oMFisCDbKQxRUDFf4nrdIkb8E= Original-Xref: shelby.stanford.edu gnu.emacs.help:125561 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20917 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20917 >>>>> In >>>>> Raul Acevedo wrote: > I'm doing JSP development, and I want something very simple. I want to > fontify the text between <% and %> tags, even if spread across multiple > lines. You will need to use a function which searches for a range larger than the range which font-lock usually searches for, instead of a regexp. I tried it in the *scratch* buffer using the following configuration: (defun find-brackets (limit) (or (re-search-forward "<%[^>]*%>" nil t) (let ((start (point))) (if (and (search-backward "<%" nil t) (search-forward "%>" nil t)) (goto-char limit) (goto-char start) nil)))) (setq font-lock-keywords (append font-lock-keywords '((find-brackets (0 'underline t)))) font-lock-multiline t)