From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tim McNamara Newsgroups: gmane.emacs.help Subject: Re: Highlight comment in HTML Date: Tue, 06 Jan 2004 12:36:35 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <65ef16d2.0401060700.3a9f8a6a@posting.google.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073414778 23726 80.91.224.253 (6 Jan 2004 18:46:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2004 18:46:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 06 19:46:15 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 1AdwDX-0001xp-00 for ; Tue, 06 Jan 2004 19:46:15 +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 1Adx9Y-0003ET-0e for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jan 2004 14:46:12 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!gemini.bitstream.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (darwin) Cancel-Lock: sha1:NOgc6aOEHcTOGoeFe5HflyvYKcw= Original-Lines: 29 Original-NNTP-Posting-Host: 4a34a74c.news.bitstream.net Original-X-Trace: 1073414259 gemini.bitstream.net 1102 216.243.177.155 Original-X-Complaints-To: abuse@bitstream.net Original-Xref: shelby.stanford.edu gnu.emacs.help:119788 Original-To: help-gnu-emacs@gnu.org 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:15731 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15731 GianUberto.Lauri@eng.it (Gian Uberto Lauri) writes: > What could be a good way to highlight HTML comments (they can span > multiple lines) ? > > Syntax tables only support 1 character and 2 character delimiters. Could it be a defined function (e.g., html-comment-highlight) and added to html-helper-mode that way? I haven't seen the Lisp that html-helper-mode uses to highlight tags, but couldn't comments be defined as a special tag to be highlighted in a different color? Since comments are placed within tags, comments ought to at least highlight in the same color as other tags. I can't tell, I don't have any comments in any handy .html files to check against and don't have time to create a file to play with on my lunch break. I'll try later on this evening, if I can. Since the opening and closing tags have a unique structure, perhaps that could be exploited for highlighting. html-helper-mode is one of the most useful things I've seen in Emacs, for my purposes. One idea I might suggest is something that I found in BBEdit, which is that an area of text could be highlighted, the desired tag selected from a menu, and the opening and closing tags were automatically placed at the appropriate end of the selected text. It worked really well; Emacs might be able to be more sophisticated by working automatically around newlines and white space and such for locating the proper placement of tags since it already has those capacities in the text modes.