all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Adam Hardy <emacs@cyberspaceroad.com>
Subject: Re: xml sgml & psgml
Date: Wed, 05 Feb 2003 14:39:31 +0100	[thread overview]
Message-ID: <3E411413.4070208@cyberspaceroad.com> (raw)

Kai Großjohann wrote:
 > Adam Hardy <emacs@cyberspaceroad.com> writes:
 >
 >
 >>I'm editing some xml files and I am having a few problems. I installed
 >>the latest version of psgml from sourceforge and put some config code
 >>in my .emacs but I am unable to get indentation to work.
 >
 >
 > Often, it helps to (setq sgml-indent-data t), but you don't give
 > enough information to see whether it will help.

I don't have that in my .emacs - but adding it makes it work.  I don't 
suppose it's got electric support?

How did you find out about that? I found what I found through searching 
with google.  Reading the lisp code was too difficult at my level of 
understanding to serve as documentation.

To answer another of my original questions, would the following .emacs 
config enable psgml? And can I do anything to test whether this psgml is 
enabled?



;;; Set up PSGML
; Add PSGML to load-path so Emacs can find it.
; Note the forward slashes in the path... this is platform-independent so I
; would suggest using them over back slashes. If you use back slashes, they
; MUST BE doubled, as Emacs treats backslash as an escape character.
(setq load-path (append (list nil 
"/usr/share/emacs/21.2/lisp/psgml-1.3.1") 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)
                 )
               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 '
;      (
;       ( "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\">" )
; I use XHTML now!
;       ( "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\">" )
;       )
;)

; 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)

             reply	other threads:[~2003-02-05 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-05 13:39 Adam Hardy [this message]
     [not found] <mailman.1447.1044452744.21513.help-gnu-emacs@gnu.org>
2003-02-05 15:19 ` xml sgml & psgml Kai Großjohann
2003-02-05 16:09   ` Adam Hardy
     [not found]   ` <mailman.1473.1044463439.21513.help-gnu-emacs@gnu.org>
2003-02-06 13:37     ` Kai Großjohann
     [not found]       ` <3E42D6C8.5000806@cyberspaceroad.com>
2003-02-07 14:47         ` Kai Großjohann
     [not found] <mailman.1437.1044444190.21513.help-gnu-emacs@gnu.org>
2003-02-05 12:54 ` Kai Großjohann
  -- strict thread matches above, loose matches on Subject: below --
2003-02-05 11:19 Adam Hardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E411413.4070208@cyberspaceroad.com \
    --to=emacs@cyberspaceroad.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.