From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: GianUberto.Lauri@eng.it (Gian Uberto Lauri) Newsgroups: gmane.emacs.help Subject: advice needed for font-lock-syntactic-face-function Date: Fri, 16 Jan 2004 12:52:49 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16391.53393.343787.521286@mail.eng.it> References: Reply-To: saint@eng.it NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=unknown Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1074280618 8572 80.91.224.253 (16 Jan 2004 19:16:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2004 19:16:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 16 20:16:51 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AhZSc-0002Qy-00 for ; Fri, 16 Jan 2004 20:16:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AhZIA-0000mg-OB for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Jan 2004 14:06:02 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AhYv4-00041n-Ff for help-gnu-emacs@gnu.org; Fri, 16 Jan 2004 13:42:10 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AhXNY-00085E-NM for help-gnu-emacs@gnu.org; Fri, 16 Jan 2004 12:04:00 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AhSqR-0005jc-DH for help-gnu-emacs@gnu.org; Fri, 16 Jan 2004 07:12:59 -0500 Original-Received: from [62.101.90.2] (helo=mail.eng.it) by mx20.gnu.org with esmtp (Exim 4.24) id 1AhSTw-0002p8-Ta for help-gnu-emacs@gnu.org; Fri, 16 Jan 2004 06:49:45 -0500 Original-Received: from paperoga (localhost [127.0.0.1]) by mail.eng.it (Postfix) with ESMTP id 4D03817803 for ; Fri, 16 Jan 2004 12:49:40 +0100 (CET) Original-To: help-gnu-emacs@gnu.org Original-Newsgroups: gnu.emacs.help In-Reply-To: X-Mailer: VM 7.07 under Emacs 21.2.1 X-attribution: CC X-Home-Page: http://www.gest.unipd.it/~saint X-Zippy: Did an Italian CRANE OPERATOR just experience uninhibited sensations in a MALIBU HOT TUB? X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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:16109 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16109 I'm trying to borrow the function from tex-mode.el (CVS version) to mark. html tags and JSP/ASP/PHP blocks, and I took the piece of code that matches \verb+ + blocks as example. (defun html-helper-font-lock-last-char-helper () (when (eq (char-syntax (preceding-char)) ?/) (put-text-property (1- (point)) (point) 'syntax-table '(1))) (unless (eobp) (put-text-property (point) (1+ (point)) 'syntax-table '(7)))) (defun html-helper-font-lock-syntactic-face-function (state) (let ((char (nth 3 state))) (cond ;; char ,bh(B nil ((not char) font-lock-comment-face) (t (cond ((string-match "[a-zA-Z]" (char-to-string char)) ;; This is an HTML tag (save-excursion (unless (search-forward-regexp "[^%?]>" nil t) (goto-char (point-max))) (html-helper-font-lock-last-char-helper)) html-helper-tag-face) ((string-match "[%?]" (char-to-string char)) ;; This is a server script block (save-excursion (unless (search-forward-regexp "[%?]>" nil t) (goto-char (point-max))) (html-helper-font-lock-last-char-helper)) html-helper-server-script-face) ((eq ? char) ;; This is a server script block (unless (search-forwardd "-->" nil t) (save-excursion (goto-char (point-max)))) font-lock-comment-face)))))) Executing my function step by step i verified that I successfully set up font-lock-syntactic-keywords, I successfully matched a tag but after leaving the save-excursion block I see that the program enters this sexp (set-syntax-table old-syntax-table) and after some more steps (about 8) I get stuck in the (mode-line-mode-name) sexp. I fear that there's something weird in the put-text-property sexps in html-helper-font-lock-last-char-helper function. Is there anybody who can (and wants) to give me some advice ? The tex-mode original works fine, of course :). TIA /\ ___ /___/\__|_|\_|__|___Gian Uberto Lauri_____________________ //--\ | | \| | Integralista GNUslamico e fancazzista \/