Install TDTD

  1. Extract the files

    Install the tdtd mode, using the tdtd archive. Unzip the files tdtd.el and tdtd-font.el into your local site-lisp directory, e.g. C:\Programs\emacsen\site-lisp.

  2. Byte-compile the files

    Start Emacs and byte-compile the file tdtd.el by typing Alt-x byte-compile-file [Return] site-lisp-path/tdtd.el [Return], where site-lisp-path is your site-lisp directory. Use the same procedure to byte-compile tdtd-font.el.

  3. Modify your _emacs

    Copy the following lines into your _emacs file:

    ;; Start DTD mode for editing SGML-DTDs
    (autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs.")
    (autoload 'dtd-etags "tdtd"
    "Execute etags on FILESPEC and match on DTD-specific regular expressions."
    t)
    (autoload 'dtd-grep "tdtd" "Grep for PATTERN in files matching FILESPEC." t)
    
    ;; Turn on font lock when in DTD mode
    (add-hook 'dtd-mode-hooks
    'turn-on-font-lock)
    
    (setq auto-mode-alist
    (append
    (list
    '("\\.dcl$" . dtd-mode)
    '("\\.dec$" . dtd-mode)
    '("\\.dtd$" . dtd-mode)
    '("\\.ele$" . dtd-mode)
    '("\\.ent$" . dtd-mode)
    '("\\.mod$" . dtd-mode))
    auto-mode-alist))
    
    ;; the regexp for NTEmacs etags
    (setq dtd-etags-regex-option
    "--regex=\'/<!\\(ELEMENT\\|ENTITY[ \\t]+%\\|NOTATION\\|ATTLIST\\)[ \\t]+\\([^ \\t]+\\)/\\2/\'")