Stefan Monnier wrote:
The attached file is valid XHTML 1.1 but indents badly because of the < inte
<?php ... ?> part. I paste it here for simplicity too:

Hmm... does the patch below fix it for you?
If you put a "<?" inside your PHP code, it seems it would still be valid
XML, but indentation will probably get confused.

It fixes the last two lines (</body> and </html>), but not the </div> line.


        Stefan


--- orig/lisp/textmodes/sgml-mode.el
+++ mod/lisp/textmodes/sgml-mode.el
@@ -1183,6 +1183,15 @@
        ((sgml-looking-back-at "]]")  ; cdata
        (setq tag-type 'cdata
              tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t)))
+       ((sgml-looking-back-at "?")      ; XML processing-instruction
+        (setq tag-type 'pi
+              ;; IIUC: SGML processing instructions take the form <?foo ...>
+              ;; i.e. a "normal" tag, handled below.  In XML this is changed
+              ;; to <?foo ... ?> where "..." can contain < and > and even <?
+              ;; but not ?>.  This means that when parsing backward, there's
+              ;; no easy way to make sure that we find the real beginning of
+              ;; the PI.
+             tag-start (search-backward "<?" nil t)))
        (t
        (setq tag-start
              (with-syntax-table sgml-tag-syntax-table




_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to