>>>>> "Lennart" == Lennart Borgman (gmail) <[EMAIL PROTECTED]> writes:

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

The additional patch below should fix that, provided Emacs is in XHTML mode
(rather than HTML mode).  If I understand the HTML docs properly your
example code is not valid in HTML because the < is not allowed inside
<?php ...>.


        Stefan


--- orig/lisp/textmodes/sgml-mode.el
+++ mod/lisp/textmodes/sgml-mode.el
@@ -1033,6 +1033,13 @@
                   (let ((cdata-start (point)))
                     (unless (search-forward "]]>" pos 'move)
                       (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
+                 ((and sgml-xml-mode (looking-at "<\\?"))
+                  ;; Processing Instructions.
+                  ;; In SGML, it's basically a normal tag of the form
+                  ;; <?NAME ...> but in XML, it takes the form <? ... ?>.
+                  (let ((pi-start (point)))
+                    (unless (search-forward "?>" pos 'move)
+                      (list 0 nil nil 'pi nil nil nil nil pi-start))))
                  (t
                   ;; We've reached a tag.  Parse it.
                   ;; FIXME: Handle net-enabling start-tags


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to