all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim McNamara <timmcn@bitstream.net>
Subject: Re: Highlight comment in HTML
Date: Tue, 06 Jan 2004 12:36:35 -0600	[thread overview]
Message-ID: <m24qv8vs98.fsf@Stella-Blue.local> (raw)
In-Reply-To: mailman.29.1073407916.928.help-gnu-emacs@gnu.org

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 <!-- 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.

  parent reply	other threads:[~2004-01-06 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-06 15:00 Highlight comment in gauss mode jyangstat
2004-01-06 15:51 ` Highlight comment in HTML Gian Uberto Lauri
2004-01-06 18:39 ` Highlight comment in gauss mode Stefan Monnier
2004-01-07  0:20   ` jyangstat
2004-01-07  1:04     ` Stefan Monnier
2004-01-07 13:33       ` jyangstat
2004-01-07 15:30         ` Stefan Monnier
2004-01-08 21:30           ` jyangstat
2004-01-08 22:41             ` Stefan Monnier
2004-01-09 12:46               ` jyangstat
     [not found] ` <mailman.29.1073407916.928.help-gnu-emacs@gnu.org>
2004-01-06 18:36   ` Tim McNamara [this message]
2004-01-06 18:57     ` Highlight comment in HTML Tim McNamara
2004-01-06 19:13   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24qv8vs98.fsf@Stella-Blue.local \
    --to=timmcn@bitstream.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.