fc2ブログ

漫録

2008年12月15日

xyzzyのhtml+-modeに於けるhtml+-guess-listの補完候補をカスタマイズした
先日xyzzyのhtml+-modeに於けるhtml+-guess-listの補完候補をカスタマイズしたので公開
html+-guess-listの代替案
手書で自然言語をマークアップすることに主眼をおいてゐる。
一往ISO-HTMLのを意識してゐる。が、煩雑さを避けるために削った要素があるのであんまり反映されてゐないかも知れない。
テーブル關聯、リスト關聯はない。
候補数を増やさないやうに、ol要素が必要なときには、ul要素を選んでからol要素に書換へることを想定してゐる。同様に、h*要素はh2要素、del要素はins要素、b要素はi要素、sup要素はsub要素をそれぞれ書換へる。
属性値があった方がいゝ要素には、必要な属性値をあらかじめ書いてある。
html+-guess-listの代替案
311行目からのところを以下に書換へる。
(defvar *html+-guess-list*
'((""
     . ("html lang=\"ja\"" "!DOCTYPE HTML PUBLIC \"ISO/IEC 15445:2000//DTD HyperText Markup Language//EN\""))
    ("html"
     . ("head" "body"))
    ("head"
     . ("title" "link rel=\"stylesheet\" type=\"text/css\" href=\"*.css\""))
    ("body"
     . ("p" "dl" "h2" "blockquote cite=\"\" title=\"\"" "ul" "div id=\"\" class=\"\" title=\"\""))
    ("blockquote"
     . ("p" "dl" "ul" "pre" ))
    ("div"
     . ("p" "blockquote" "h2" "dl" "ul" "div id=\"\" class=\"\" title=\"\""))
    ("dl"
     . ("dd" "dt"))
    ("dt"
     . ("em" "strong" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("dd"
     . ("em" "q cite=\"\" title=\"\"" "dl" "ul" "blockquote cite=\"\" title=\"\"" "cite title=\"\"" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("ul"
     . ("li"))
    ("ol"
     . ("li"))
    ("li"
     . ("em" "dl" "ul" "ol" "blockquote cite=\"\" title=\"\"" "pre"))
    ("h2"
     . ("em" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("p"
     . ("em" "q cite=\"\" title=\"\"" "cite title=\"\"" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("em"
     . ("q cite=\"\" title=\"\"" "strong" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("q"
     . ("em" "q cite=\"\" title=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\"" "ins datetime=\"\""))
    ("ins"
     . ("em" "q cite=\"\" title=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\""))
    ("span"
     . ("em" "q cite=\"\" title=\"\"" "ins datetime=\"\" cite=\"\"" "i" "sub" "span id=\"\" class=\"\" title=\"\"")))
  "html+-mode: 状況依存したタグの候補")
因みに、私が実際に使ってゐる設定。

(defvar *html+-guess-list*
'((""
     . ("p" "dl" "h2" "blockquote cite=\"\" title=\"\"" "ul" "title" "html lang=\"ja\"" "!DOCTYPE HTML PUBLIC \"ISO/IEC 15445:2000//DTD HyperText Markup Language//EN\"" "div id=\"\" class=\"\" title=\"\""))
    ("html"
     . ("head" "body"))
    ("head"
     . ("title" "link rel=\"stylesheet\" type=\"text/css\" href=\"*.css\"" "body"))
    ("body"
     . ("p" "dl" "h2" "blockquote cite=\"\" title=\"\"" "ul" ))
    ("blockquote"
     . ("p" "dl" "ul"))
    ("div"
     . ("p" "blockquote" "h2" "dl" "ul"))
    ("dl"
     . ("dd" "dt"))
    ("dt"
     . ("em" "ins datetime=\"\" cite=\"\""))
    ("dd"
     . ("em" "q cite=\"\" title=\"\"" "dl" "ul" "blockquote cite=\"\" title=\"\"" "cite title=\"\"" "ins datetime=\"\" cite=\"\""))
    ("ul"
     . ("li"))
    ("ol"
     . ("li"))
    ("li"
     . ("em" "dl" "ul" "ol" "blockquote cite=\"\" title=\"\""))
    ("h2"
     . ("em" "ins datetime=\"\" cite=\"\"" "span id=\"\" class=\"\" title=\"\""))
    ("p"
     . ("em" "q cite=\"\" title=\"\"" "cite title=\"\"" "ins datetime=\"\" cite=\"\""))
    ("em"
     . ("q cite=\"\" title=\"\"" "ins datetime=\"\" cite=\"\""))
    ("q"
     . ("em" "q cite=\"\" title=\"\"" "ins datetime=\"\""))
    ("ins"
     . ("em" "q cite=\"\" title=\"\"" ))
    ("span"
     . ("em" "q cite=\"\" title=\"\"" "ins datetime=\"\" cite=\"\"")))
  "html+-mode: 状況依存したタグの候補")

別記

りそーすの情報
広告