help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Highlight comment in HTML


From: Tim McNamara
Subject: Re: Highlight comment in HTML
Date: Tue, 06 Jan 2004 12:36:35 -0600
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (darwin)

address@hidden (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 <!-- and //--!> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]