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

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

Re: Emacs - Time-stanp:


From: Kevin Rodgers
Subject: Re: Emacs - Time-stanp:
Date: Thu, 05 Oct 2006 18:21:49 -0600
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Rick Stanley wrote:
Hello!

In trying to use the emacs Time-stamp: in writing some XHTML/CSS code, I
used the following:

<meta name="revised" content="Time-stamp: <2006-10-04 13:55:39 rick>" />

This will not pass the W3C XHTML or CSS validators, for a '<' or '>'
being embedded within an XML attribute .

The only way I could get Time-stamp: to work was to comment out the
whole line:

<!--  <meta name="revised" content="Time-stamp: &lt;2006-10-04 13:55:39
rick&gt;" /> -->

The Time-stamp: works, but I loose the 'revised' Meta Data.

I would like to see '&lt;' and '&gt;' be recognized along with the
current '<>' and '""' deliminators for Time-stamp:, or some other
deliminator that conforms to valid characters as data inside of an XML
attribute.

Assuming your XHTML files (which are not code, by the way) are in XML
mode (aka SGML mode in Emacs), try this:

(add-hook 'sgml-mode-hook
          (lambda ()
            (set (make-local-variable 'time-stamp-start)
                 (replace-regexp-in-string (regexp-quote "[\"<]")
                                           "\\(\"\\|&lt;\\)"
                                           time-stamp-start
                                           t t))
            (set (make-local-variable 'time-stamp-end)
                 (replace-regexp-in-string (regexp-quote "[\">]")
                                           "\\(\"\\|&gt;\\)"
                                           time-stamp-end
                                           t t))))


--
Kevin





reply via email to

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