>From 17865a7df25d8482dcfd2f763386bb786c5b7a06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?=
Date: Sun, 27 Mar 2016 14:56:21 +0200
Subject: [PATCH] Add HTML4 tags to HTML mode
* lisp/textmodes/sgml-mode.el (html-tag-alist): Add HTML4 tags.
(html-tag-help): Add short descriptions of those tags.
---
lisp/textmodes/sgml-mode.el | 82 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 74 insertions(+), 8 deletions(-)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index e6eb060..0937c00 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1779,11 +1779,12 @@ html-display-text
"Value of `sgml-display-text' for HTML mode.")
-;; should code exactly HTML 3 here when that is finished
(defvar html-tag-alist
(let* ((1-7 '(("1") ("2") ("3") ("4") ("5") ("6") ("7")))
(1-9 `(,@1-7 ("8") ("9")))
(align '(("align" ("left") ("center") ("right"))))
+ (ialign '(("align" ("top") ("middle") ("bottom") ("left")
+ ("right"))))
(valign '(("top") ("middle") ("bottom") ("baseline")))
(rel '(("next") ("previous") ("parent") ("subdocument") ("made")))
(href '("href" ("ftp:") ("file:") ("finger:") ("gopher:") ("http:")
@@ -1796,16 +1797,26 @@ html-tag-alist
("title")))
(list '((nil \n ("List item: " "" str
(if sgml-xml-mode "") \n))))
+ (shape '(("shape" ("rect") ("circle") ("poly") ("default"))))
(cell `(t
,@align
("valign" ,@valign)
("colspan" ,@1-9)
("rowspan" ,@1-9)
- ("nowrap" t))))
+ ("nowrap" t)))
+ (cellhalign '(("align" ("left") ("center") ("right")
+ ("justify") ("char"))
+ ("char") ("charoff")))
+ (cellvalign '(("valign" ("top") ("middle") ("bottom")
+ ("baseline")))))
;; put ,-expressions first, else byte-compile chokes (as of V19.29)
;; and like this it's more efficient anyway
`(("a" ,name ,@link)
+ ("area" t ,@shape ("coords") ("href") ("nohref" "nohref") ("alt")
+ ("tabindex") ("accesskey") ("onfocus") ("onblur"))
("base" t ,@href)
+ ("col" t ,@cellhalign ,@cellvalign ("span") ("width"))
+ ("colgroup" \n ,@cellhalign ,@cellvalign ("span") ("width"))
("dir" ,@list)
("font" nil "size" ("-1") ("+1") ("-2") ("+2") ,@1-7)
("form" (\n _ \n "<" str ?> _
(if sgml-xml-mode (concat "<" str ">")) \n))
("border" t ,@1-9) ("width" "10") ("cellpadding"))
+ ("tbody" \n ,@cellhalign ,@cellvalign)
("td" ,@cell)
("textarea" ,name ("rows" ,@1-9) ("cols" ,@1-9))
+ ("tfoot" \n ,@cellhalign ,@cellvalign)
("th" ,@cell)
+ ("thead" \n ,@cellhalign ,@cellvalign)
("ul" ,@list ("type" ("disc") ("circle") ("square")))
,@sgml-tag-alist
- ("abbrev")
+ ("abbr")
("acronym")
("address")
("array" (nil \n
@@ -1856,19 +1873,24 @@ html-tag-alist
("aside" \n)
("au")
("b")
+ ("bdo" nil ("lang") ("dir" ("ltr") ("rtl")))
("big")
("blink")
- ("blockquote" \n)
+ ("blockquote" \n ("cite"))
("body" \n ("background" ".gif") ("bgcolor" "#") ("text" "#")
("link" "#") ("alink" "#") ("vlink" "#"))
("box" (nil _ "" _ (if sgml-xml-mode "")))
("br" t ("clear" ("left") ("right")))
+ ("button" nil ("name") ("value")
+ ("type" ("submit") ("reset") ("button"))
+ ("disabled" "disabled")
+ ("tabindex") ("accesskey") ("onfocus") ("onblur"))
("caption" ("valign" ("top") ("bottom")))
("center" \n)
("cite")
("code" \n)
("dd" ,(not sgml-xml-mode))
- ("del")
+ ("del" nil ("cite") ("datetime"))
("dfn")
("div")
("dl" (nil \n
@@ -1878,8 +1900,13 @@ html-tag-alist
("dt" (t _ (if sgml-xml-mode "")
"" (if sgml-xml-mode "") \n))
("em")
+ ("fieldset" \n)
("fn" "id" "fn") ;; Footnotes were deprecated in HTML 3.2
("footer" \n)
+ ("frame" t ("longdesc") ("name") ("src")
+ ("frameborder" ("1") ("0")) ("marginwidth") ("marginheight")
+ ("noresize" "noresize") ("scrolling" ("yes") ("no") ("auto")))
+ ("frameset" \n ("rows") ("cols") ("onload") ("onunload"))
("head" \n)
("header" \n)
("hgroup" \n)
@@ -1894,22 +1921,37 @@ html-tag-alist
"