[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
onsgmls for C-c C-v instead of nsgmls
From: |
Christian Koch |
Subject: |
onsgmls for C-c C-v instead of nsgmls |
Date: |
Sun, 06 Jul 2003 16:53:43 +0200 |
User-agent: |
KNode/0.7.2 |
Hi,
I am about to configure emacs for xml coding. I installed the sgml addon.
Everything is fine but one thing. I want to use the OpenSP validating
parser instead of the builtin. The only thing that does not work is C-c C-v
for the command "onsgmls -wxml -s %s %s". I always get the default sgml
command "nsgmls -wxml -s %s %s". I tried to set the command in .emacs, but
maybe I made some mistake. here is my .emacs:
-------------------------------------------------------------------------------
;; added by K 2003-05-20
;; for XML
(require 'psgml-startup)
;; for ruby
(load "ruby-mode")
(setq auto-mode-alist (cons '("\\.rb" . ruby-mode) auto-mode-alist))
; Display the time in the Emacs status area (an easy way to test that
; we are picking up our Emacs customizations).
;(display-time)
; I want the name of the file I'm editing to be displayed in the
; title-bar.
(setq frame-title-format "%b")
; Add PSGML to load-path so Emacs can find it.
; Note the forward slashes in the path... this is platform-independant so I
; would suggest using them over back-slahes. If you use back-slashes, they
; MUST BE doubled, as Emacs treats backslash as an escape character.
;(setq load-path (append (list nil "d:/Emacs/site-lisp/psgml-1.2.2")
load-path))
; Use PSGML for sgml and xml major modes.
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t)
;;; Set up file-extension/mode associations.
; Note that I use xml-mode for html... that's because i'm writing
; XHTML and I want my html to conform to XML.
(setq auto-mode-alist
(append '(
("\\.sgml" . sgml-mode)
("\\.idd" . sgml-mode)
("\\.ide" . sgml-mode)
("\\.htm" . xml-mode)
("\\.html" . xml-mode)
("\\.xml" . xml-mode)
("\\.xsl" . xml-mode)
("\\.fo" . xml-mode)
("\\.xsd" . xml-mode)
)
auto-mode-alist
)
)
;;; Set up and enable syntax coloring.
; Create faces to assign markup categories.
(make-face 'sgml-doctype-face)
(make-face 'sgml-pi-face)
(make-face 'sgml-comment-face)
(make-face 'sgml-sgml-face)
(make-face 'sgml-start-tag-face)
(make-face 'sgml-end-tag-face)
(make-face 'sgml-entity-face)
; Assign attributes to faces. Background of white assumed.
(set-face-foreground 'sgml-doctype-face "blue1")
(set-face-foreground 'sgml-sgml-face "cyan1")
(set-face-foreground 'sgml-pi-face "magenta")
(set-face-foreground 'sgml-comment-face "purple")
(set-face-foreground 'sgml-start-tag-face "Red")
(set-face-foreground 'sgml-end-tag-face "Red")
(set-face-foreground 'sgml-entity-face "Blue")
; Assign faces to markup categories.
(setq sgml-markup-faces
'((doctype . sgml-doctype-face)
(pi . sgml-pi-face)
(comment . sgml-comment-face)
(sgml . sgml-sgml-face)
(comment . sgml-comment-face)
(start-tag . sgml-start-tag-face)
(end-tag . sgml-end-tag-face)
(entity . sgml-entity-face)))
; PSGML - enable face settings
(setq sgml-set-face t)
; Auto-activate parsing the DTD when a document is loaded.
; If this isn't enabled, syntax coloring won't take affect until
; you manually invoke "DTD->Parse DTD"
(setq sgml-auto-activate-dtd t)
;;; Set up my "DTD->Insert DTD" menu.
(setq sgml-custom-dtd '
(
( "DITA concept"
"<?xml version=\"1.0\"?>\n<!DOCTYPE concept SYSTEM
\"concept.dtd\">" )
( "DITA task"
"<?xml version=\"1.0\"?>\n<!DOCTYPE task SYSTEM \"task.dtd\">" )
( "DITA reftopic"
"<?xml version=\"1.0\"?>\n<!DOCTYPE reftopic SYSTEM
\"reftopic.dtd\">"
)
( "DITA APIdesc"
"<?xml version=\"1.0\"?>\n<!DOCTYPE APIdesc SYSTEM
\"apidesc.dtd\">" )
( "DITA topic"
"<?xml version=\"1.0\"?>\n<!DOCTYPE topic SYSTEM \"ditabase.dtd\">"
)
( "HOD Script"
"<?xml version=\"1.0\"?>\n<!DOCTYPE HASCRIPT SYSTEM
\"HAScript.dtd\">"
)
( "XHTML 1.0 Strict"
"<?xml version=\"1.0\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
1.0
Strict//EN\" \"xhtml1-strict.dtd\">" )
( "XHTML 1.0 Transitional"
"<?xml version=\"1.0\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
1.0
Transitional//EN\" \"xhtml1-transitional.dtd\">" )
( "XHTML 1.0 Frameset"
"<?xml version=\"1.0\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML
1.0
Frameset//EN\" \"xhtml1-frameset.dtd\">" )
( "HTML 4.01 Transitional"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
)
( "HTML 4.01 Strict"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">" )
( "HTML 4.01 Frameset"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">" )
( "IBMIDDoc"
"<!DOCTYPE ibmiddoc PUBLIC \"+//ISBN 0-933186::IBM//DTD
IBMIDDoc//EN\"
[\n]>")
( "DOCBOOK XML 4.1.2"
"<?xml version=\"1.0\"?>\n<!DOCTYPE book PUBLIC \"-//OASIS//DTD
DocBook
XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd\"
[\n
]>")
)
)
; From Lennart Staflin - re-enabling launch of browser (from original HTML
mode)
(defun my-psgml-hook ()
(local-set-key "\C-c\C-b" 'browse-url-of-buffer)
)
(add-hook 'sgml-mode-hook 'my-psgml-hook)
;;; Set up Validation support
; First, for sgml-mode, if you always use the same declaration, uncomment
; the following line and set the path to your declaration. If you use
; more than one SGML declaration, leave it unset and use OpenSP as your
; validator and include DTDDECL entries in your catalog files.
; (setq sgml-declaration "<path to your SGML declaration>")
(setq sgml-validate-command "onsgmls -wxml -s %s %s")
; For xml-mode, override the default validate command by providing a
; mode-hook and setting the SGML declaration to the one
; provided with either SP or OpenSP.
(defun my-psgml-xml-hook ()
; (setq sgml-validate-command "onsgmls -s %s %s")
; (setq sgml-declaration "d:/SP/pubtext/xml.dcl")
(setq sgml-declaration "/usr/local/share/sgml/openjade/OpenSP/xml.dcl")
)
(add-hook 'xml-mode-hook 'my-psgml-xml-hook)
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(case-fold-search t)
'(current-language-environment "Latin-9")
'(default-input-method "latin-9-prefix")
'(global-font-lock-mode t nil (font-lock))
'(show-paren-mode t nil (paren))
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))
'(transient-mark-mode t)
'(uniquify-buffer-name-style (quote forward) nil (uniquify)))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
-------------------------------------------------------------------------------
thanks for your help!
Christian
--
"Quot paria coniculorum in uno anno ex uno pario germinatur?"
- onsgmls for C-c C-v instead of nsgmls,
Christian Koch <=