[Zope] DTML and ZPT editing in XEmacs

Aaron Straup Cope asc@vineyard.net
Thu, 27 Sep 2001 13:05:50 -0400 (EDT)


You can go even further and use psgml(x)-mode in combination with the HTML
DTDs and get context-sensitive, auto-completing tags :

(update yer paths as needed)

**** Where your .emacs files contains :

  ;; This is the startup info for psgmlx-mode
  ;; psgml-mode is a bit different
  (setq psgmlxpath "/usr/local/share/emacs/site-lisp/psgmlx")
  (load (concat psgmlxpath "/init"))

  ;; I don't think psgml-mode reconginizes html files, so...
  (setq auto-mode-alist (cons '("\\.html$" . xml-mode) auto-mode-alist))

  ;; This is the important part. [P]sgml-mode won't look up
  ;; DTDs across the network, so we tell it to use a catalog
  ;; and it will look for DTDs locally.
  (setq sgml-catalog-files '("CATALOG" "/usr/local/sgml/CATALOG"))

**** Where /usr/local/sgml/CATALOG contains atleast :

CATALOG "/usr/local/share/sgml/CATALOG"
CATALOG "catalog/html"

**** Where /usr/local/sgml/CATALOG/catalog/html contains atleast :

-- http://www.docbook.org/tdg/html/ch02.html#S-PID-SID-CATALOGS --
-- http://www.lysator.liu.se/~lenst/about_psgml/psgml.html#IDX15 --

OVERRIDE YES

SGMLDECL "/usr/local/share/xml/dtd/xhtml/xhtml1.dcl"

DOCTYPE html "/usr/local/share/xml/dtd/xhtml/xhtml1-transitional.dtd"

PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

SYSTEM "/usr/local/share/xml/dtd/xhtml/xhtml1-transitional.dtd"


Cheers,

On Thu, 27 Sep 2001, Shane Hathaway wrote:

> After much tinkering (since I'm no LISP guru), I finally figured out how
> to get XEmacs to automatically go to html-mode whenever you open a .dtml
> or .zpt file.  Maybe this will be useful for others.
>
> In your .emacs file (normally in your home directory), just add the
> following two lines to the end:
>
> (add-to-list 'auto-mode-alist '("\\.zpt$" . html-mode))
> (add-to-list 'auto-mode-alist '("\\.dtml$" . html-mode))
>
> Shane
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>