889 |
(unless (search-forward "]]>" pos 'move) |
(unless (search-forward "]]>" pos 'move) |
890 |
(list 0 nil nil 'cdata nil nil nil nil cdata-start)))) |
(list 0 nil nil 'cdata nil nil nil nil cdata-start)))) |
891 |
(t |
(t |
892 |
;; We've reached a tag. Parse it. |
;; We've reached a tag. Parse it. |
893 |
;; FIXME: Handle net-enabling start-tags |
;; FIXME: Handle net-enabling start-tags |
894 |
(parse-partial-sexp (point) pos 0)))))) |
(parse-partial-sexp (point) pos 0)))))) |
895 |
(cond |
(cond |
1031 |
;; enclosing start-tags we'll have to ignore. |
;; enclosing start-tags we'll have to ignore. |
1032 |
(skip-chars-backward " \t\n") ; Make sure we're not at indentation. |
(skip-chars-backward " \t\n") ; Make sure we're not at indentation. |
1033 |
(while |
(while |
1034 |
(and (or ignore |
(and (or ignore |
1035 |
(not (if full (eq full 'empty) context)) |
(not (if full (eq full 'empty) context)) |
1036 |
(not (sgml-at-indentation-p)) |
(not (sgml-at-indentation-p)) |
1037 |
(and context |
(and context |
1104 |
(text |
(text |
1105 |
(let ((context (save-excursion (sgml-get-context)))) |
(let ((context (save-excursion (sgml-get-context)))) |
1106 |
(if context |
(if context |
1107 |
(progn |
(progn |
1108 |
(insert "</" (sgml-tag-name (car (last context))) ">") |
(insert "</" (sgml-tag-name (car (last context))) ">") |
1109 |
(indent-according-to-mode))))) |
(indent-according-to-mode))))) |
1110 |
(otherwise |
(otherwise |
1227 |
(save-excursion (indent-line-to indent-col)) |
(save-excursion (indent-line-to indent-col)) |
1228 |
(indent-line-to indent-col)))) |
(indent-line-to indent-col)))) |
1229 |
|
|
1230 |
|
(defun sgml-guess-indent () |
1231 |
|
"Guess an appropriate value for `sgml-basic-offset'. |
1232 |
|
Base the guessed identation level on the first indented tag in the buffer. |
1233 |
|
Add this to `sgml-mode-hook' for convenience." |
1234 |
|
(interactive) |
1235 |
|
(save-excursion |
1236 |
|
(goto-char (point-min)) |
1237 |
|
(if (re-search-forward "^\\([ \t]+\\)<" 100 'noerror) |
1238 |
|
(progn |
1239 |
|
(set (make-local-variable 'sgml-basic-offset) |
1240 |
|
(length (match-string 1))) |
1241 |
|
(message "Guessed sgml-basic-offset = %d" |
1242 |
|
sgml-basic-offset) |
1243 |
|
)))) |
1244 |
|
|
1245 |
(defun sgml-parse-dtd () |
(defun sgml-parse-dtd () |
1246 |
"Simplistic parse of the current buffer as a DTD. |
"Simplistic parse of the current buffer as a DTD. |
1247 |
Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)." |
Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)." |