From: Mike Williams Date: Mon, 1 Apr 2002 12:08:13 +0000 (+0000) Subject: Add an explicit check for 'text syntax, to protect against future X-Git-Tag: ttn-vms-21-2-B4~15873 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=347ea5576b78210a4e4ca04c5935fd96884cc8ac;p=emacs.git Add an explicit check for 'text syntax, to protect against future enhancements to sgml-lexical-context. Add sgml-empty-tag-p and sgml-unclosed-tag-p. --- diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 71c40d384e0..ce42a5bcf7d 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -890,7 +890,7 @@ If this can't be done, return nil." (sgml-beginning-of-tag t)))))) (defun sgml-value (alist) - "Interactively insert value taken from attributerule ALIST. + "Interactively insert value taken from attribute-rule ALIST. See `sgml-tag-alist' for info about attribute rules." (setq alist (cdr alist)) (if (stringp (car alist)) @@ -924,9 +924,20 @@ With prefix argument, unquote the region." (?> . ">")))))))) +(defun sgml-empty-tag-p (tag-name) + "Return non-nil if TAG-NAME is an implicitly empty tag." + (and (not sgml-xml-mode) + (member-ignore-case tag-name sgml-empty-tags))) + +(defun sgml-unclosed-tag-p (tag-name) + "Return non-nil if TAG-NAME is a tag for which an end-tag is optional." + (and (not sgml-xml-mode) + (member-ignore-case tag-name sgml-unclosed-tags))) + (defun sgml-calculate-indent () "Calculate the column to which this line should be indented." (let ((lcon (sgml-lexical-context))) + ;; Indent comment-start markers inside