Skip to content

Instantly share code, notes, and snippets.

@sluchin
Created April 6, 2013 06:51
Show Gist options
  • Save sluchin/5325178 to your computer and use it in GitHub Desktop.
Save sluchin/5325178 to your computer and use it in GitHub Desktop.
;;; Psgml モード
;; C-c C-p DTD の Parse
;; C-c C-o 文章の Parse
;; C-c C-e element の挿入
;; C-c / 終了タグを挿入
(when (eval-and-compile
(and (require 'nxml-mode nil t)
(require 'psgml nil t)))
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
;; 拡張子のリスト
(setq auto-mode-alist
(append
'(("\\.\\(html\\|xml\\|sgml\\)$" . xml-mode)
("\\.xhtml\\([.]?\\w+\\)*$" . xml-mode))
auto-mode-alist))
;; DTD の自動読み込み
(when (boundp 'sgml-auto-activate-dtd)
(setq sgml-auto-activate-dtd t))
;; 色の設定
(when (boundp 'sgml-set-face)
(setq sgml-set-face t))
(when (boundp 'sgml-markup-faces)
(setq sgml-markup-faces
'((start-tag . font-lock-keyword-face)
(end-tag . font-lock-keyword-face)
(comment . font-lock-comment-face)
(pi . font-lock-constant-face)
(sgml . font-lock-type-face)
(doctype . bold)
(entity . italic)
(shortref . font-lock-reference-face))))
(message "Loading %s (psgml)...done" this-file-name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment