SHA256
1
0
forked from pool/psgml
OBS User unknown 2007-01-15 23:33:30 +00:00 committed by Git OBS Bridge
commit 4f3c96faa1
22 changed files with 2246 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

144
ke-docbook.el Normal file
View File

@ -0,0 +1,144 @@
;; <!-- Keep this comment at the end of the file
;; Local variables:
;; mode: ke-docbook
;; sgml-omittag:nil
;; sgml-shorttag:t
;; sgml-namecase-general:t
;; sgml-general-insert-case:lower
;; sgml-minimize-attributes:nil
;; sgml-always-quote-attributes:nil
;; sgml-indent-step:1
;; sgml-indent-data:nil
;; sgml-parent-document:nil
;; sgml-default-dtd-file:"main.ced"
;; sgml-exposed-tags:nil
;; sgml-local-catalogs:nil
;; sgml-local-ecat-files:nil
;; End:
;; -->
(load "xxml")
(require 'tempo)
(add-hook 'ke-docbook-mode-hook
'(lambda ()
(setq xxml-highlight-tag-alist
'(("chapter" . ke-docbook-chapter-face)
("section" . ke-docbook-section-face)
("sect1" . ke-docbook-section-face)
("sect2" . ke-docbook-sect2-face))
xxml-highlight-recursive-alist
'(("title" . xxml-header-1-face)
("subtitle" . xxml-header-3-face))
xxml-highlight-initial-alist
'(("firstterm" . xxml-emph-1-face)
("emphasis" . italic)
("keycap" . bold)
;; ("filename" . font-lock-constant-face)
("ulink" . xxml-interaction-face)
("link" . xxml-interaction-face)))))
(define-skeleton ke-dbk-varlistentry-skel
"Insert <varlistentry>."
nil
>
"<varlistentry>" \n >
" <term>" _ "</term>" \n >
" <listitem>" \n >
" <para>" \n >
@ "</para>" \n >
" </listitem>" \n >
"</varlistentry>")
(tempo-define-template "varlistentry"
'(& > "\
<varlistentry>" n>
"<term>" r "</term>" n>
"<listitem>" n>
"<para>" n
r n
"</para>" n>
"</listitem>" n>
"</varlistentry>" % >))
(require 'tempo)
(global-set-key [C-tab] 'tempo-forward-mark)
(global-set-key [S-C-tab] 'tempo-backward-mark)
;; for now, these are needed:
(global-set-key [S-iso-lefttab] 'tempo-backward-mark)
(global-set-key [C-S-iso-lefttab] 'tempo-backward-mark)
(tempo-define-template "emphasis"
'("<emphasis>" r "</emphasis>" p))
(tempo-define-template "filename"
'("<filename>" r "</filename>" p))
(tempo-define-template "function"
'((if (y-or-n-p "Emacs Lisp? ")
"<function role=\"elisp\">"
"<function>") r "</function>"
p))
(tempo-define-template "wordasword"
'("<wordasword>" r "</wordasword>" p))
(tempo-define-template "para"
'(& "<para>" > n r n "</para>" > p))
(tempo-define-template "programlisting"
'(& "\
<programlisting format=\"linespecific\">
<![ CDATA [" n p n
"]]>
</programlisting>" n))
(tempo-define-template "step"
'(& "<step>" > n "<para>" > r "</para>" > n "</step>" > p))
(define-derived-mode ke-docbook-mode sgml-mode "DocBk"
"Major mode for editing DocBook files.
Run `ke-docbook-mode-hook'.\n
\\{ke-spec-mode-map}"
;; (set (make-local-variable 'font-lock-defaults)
;; '(ke-spec-font-lock-keywords nil nil))
;; (set (make-local-variable 'ke-spec-pkg)
;; (ke-spec-pkg-name))
;; (set (make-local-variable 'sh-shell-file)
;; "/bin/sh") ; rpm default
;; (easy-menu-add ke-spec-menu)
;; (if ke-spec-build-new-buffer
;; (ke-spec-insert-new-buffer-strings))
(run-hooks 'ke-docbook-mode-hook))
(define-key ke-docbook-mode-map "\C-cp" 'tempo-template-para)
(define-key ke-docbook-mode-map "\C-c\C-ce" 'tempo-template-emphasis)
(define-key ke-docbook-mode-map "\C-c\C-cf" 'tempo-template-filename)
(define-key ke-docbook-mode-map "\C-c\C-cp" 'tempo-template-programlisting)
(define-key ke-docbook-mode-map "\C-c\C-cs" 'tempo-template-step)
(easy-menu-define ke-docbook-menu ke-docbook-mode-map "DocBook Menu"
'("DocBk"
["Emphasis" tempo-template-emphasis t]
["Filename" tempo-template-filename t]
["Function" tempo-template-function t]
["WordAsWord" tempo-template-wordasword t]
"---"
["Para" tempo-template-para t]
["ProgramListing" tempo-template-programlisting t]
["Step" tempo-template-step t]
))
(defvar ke-docbook-chapter-face nil
"Face used for chapter tag.")
(copy-face 'xxml-rug-face 'ke-docbook-chapter-face)
(defvar ke-docbook-section-face nil
"Face used for section and sect1 tag.")
(copy-face 'xxml-sparkle-face 'ke-docbook-section-face)
(defvar ke-docbook-sect2-face nil
"Face used for sect2 tag.")
(copy-face 'xxml-sparkle-face 'ke-docbook-sect2-face)
(set-face-background 'ke-docbook-sect2-face "orange")
(provide 'ke-docbook)
;; eof

13
psgml-1.2.5-key.diff Normal file
View File

@ -0,0 +1,13 @@
--- psgml-1.2.5/psgml.el.~1~ 2002-04-19 20:37:46.000000000 +0200
+++ psgml-1.2.5/psgml.el 2002-12-09 12:16:06.000000000 +0100
@@ -804,7 +804,7 @@
(define-key sgml-mode-map "\C-c<" 'sgml-insert-tag)
(define-key sgml-mode-map "\C-c=" 'sgml-change-element-name)
(define-key sgml-mode-map "\C-c\C-a" 'sgml-edit-attributes)
-(define-key sgml-mode-map "\C-c\C-c" 'sgml-show-context)
+;; (define-key sgml-mode-map "\C-c\C-x" 'sgml-show-context)
(define-key sgml-mode-map "\C-c\C-d" 'sgml-next-data-field)
(define-key sgml-mode-map "\C-c\C-e" 'sgml-insert-element)
(define-key sgml-mode-map "\C-c\C-f\C-e" 'sgml-fold-element)
Diff finished at Mon Dec 9 12:16:10

View File

@ -0,0 +1,37 @@
--- psgml-1.3.1/psgml.texi.~1~ 2002-12-13 19:57:50.000000000 +0100
+++ psgml-1.3.1/psgml.texi 2003-02-07 16:37:54.000000000 +0100
@@ -10,11 +10,10 @@
@c $Id: psgml.texi,v 1.5 2002/04/19 07:48:31 lenst Exp $
@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@dircategory Emacs
+@direntry
* PSGML: (psgml). PSGML, a major mode for SGML documents.
-END-INFO-DIR-ENTRY
-@end format
+@end direntry
@end ifinfo
@ifinfo
--- psgml-1.3.1/psgml-api.texi.~1~ 2002-12-13 19:57:50.000000000 +0100
+++ psgml-1.3.1/psgml-api.texi 2003-02-07 16:37:24.000000000 +0100
@@ -7,11 +7,10 @@
@c $Id: psgml-api.texi,v 1.2 1999/12/03 17:29:39 lenst Exp $
@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@dircategory Emacs
+@direntry
* PSGML-API: (psgml-api). PSGML, the API documentation.
-END-INFO-DIR-ENTRY
-@end format
+@end direntry
@end ifinfo
@ifinfo
Diff finished at Fri Feb 7 16:38:11

3
psgml-1.3.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a020bfe9ab75e325e738726dd850e2b17030b3a5a2c0a349070839865ff51905
size 252394

49
psgml-README.SuSE Normal file
View File

@ -0,0 +1,49 @@
Patches:
========
xxml-provide.diff
-----------------
This patch makes xxml.el provide itself.
2001-07-16 12:49:56 CEST -ke-
psgml-compile-addons.diff
-------------------------
To compile psgml-dsssl.el, psgml-ja.tgz and psgml-xpointer.el
2001-11-19 09:41:38 CET -ke-
------------------------------------------------------------------------
Configuration:
==============
Configuration is done /usr/share/emacs/site-lisp/suse-start-psgml.el;
The Emacs default installation on SuSE Linux make use of it
automatically. If you don't use
/usr/share/emacs/site-lisp/site-start.el coming with SuSE Linux add to
your ~/.emacs:
(load "suse-start-psgml")
or copy the contents of /usr/share/emacs/site-lisp/suse-start-psgml.el
to your ~/.emacs.
2001-07-16 12:48:21 CEST -ke-
Comments
--------
xxml.el: suse-start-psgml.el now loads xxml.el by default and psgml will
use it automatically. If you want to use ke-docbook.el for DocBook
files, add at the very end of your SGML file (or adjust the "mode:" line
of an alread existing file):
<!-- Keep this comment at the end of the file
Local variables:
mode: ke-docbook
End:
-->
2001-07-16 12:48:21 CEST -ke-

14
psgml-compile-addons.diff Normal file
View File

@ -0,0 +1,14 @@
--- psgml-1.3.2/psgml-maint.el.~1~ 2005-03-09 09:44:46.514473774 +0100
+++ psgml-1.3.2/psgml-maint.el 2005-03-09 09:47:51.759943309 +0100
@@ -39,7 +39,8 @@
(defconst psgml-common-files
'("psgml.el" "psgml-parse.el" "psgml-edit.el" "psgml-dtd.el"
- "psgml-info.el" "psgml-charent.el" "psgml-api.el" "psgml-sysdep.el"
+ "psgml-info.el" "psgml-charent.el" "psgml-api.el"
+ "psgml-jade.el" "psgml-dsssl.el" "psgml-xpointer.el"
"psgml-ids.el"))
(defconst psgml-emacs-files '("psgml-other.el"))
Diff finished. Wed Mar 9 09:48:00 2005

139
psgml-dsssl.el Normal file
View File

@ -0,0 +1,139 @@
;; psgml-dsssl.el --- create a skeleton DSSSL spec for an SGML document.
;; $Id: psgml-dsssl.el,v 1.2 1996/10/19 17:24:24 david Exp david $
;; Copyright (C) 1996 David Megginson. Free redistribution permitted.
;; USE AT YOUR OWN RISK!
;;
;; Author: David Megginson (dmeggins@microstar.com)
;;; Commentary:
;; Installation:
;;
;; This file requires Gnu Emacs 19.* or XEmacs, together with Lennart
;; Staflin's PSGML mode (tested with version 1a12).
;;
;; Install this file somewhere on your load path, byte-compile it, and
;; include the following in your .emacs or site-start.el file:
;;
;; (autoload 'sgml-dsssl-make-spec "psgml-dsssl" nil t)
;;
;; Now, whenever you are editing an SGML document with PSGML, you can
;; type
;;
;; M-x sgml-dsssl-make-spec
;;
;; to create a skeleton DSSSL style spec in a temporary buffer
;; "**DSSSL**" (overwriting any existing spec). You may save the
;; buffer to a file and edit it as you wish.
;;
;;
;; Operation:
;;
;; This package will generate an element construction rule for every
;; element type which could appear in the SGML document, whether it
;; actually appears or not -- it does so by starting with the element
;; type of the document's root element, then performing a depth-first
;; traversal of the DTD tree. Any element types which are not
;; reachable from the root will be excluded.
;;
;; The first instance of each element class in the DTD tree will
;; determine its context, and thus, its default flow-object class.
;; The contexts are as follow:
;;
;; 1) The root element of the document (default: simple-page-sequence).
;; 2) The element appears in mixed content or contains PCDATA content
;; (default: sequence).
;; 3) The element contains mixed content and appears in element content
;; (default: paragraph).
;; 4) The element contains only element content
;; (default: display-group).
;; 5) The element is EMPTY (default: sequence).
;;
;; These will work well with some DTDs, but the assumptions will fall
;; apart quickly for others, especially HTML (which allows mixed
;; content almost everywhere). You can change the default flow-object
;; classes for each of these using configuration variables, as you can
;; change the default document-type declaration at the top of the
;; specification.
;;
;;; Code:
(require 'psgml-parse)
(autoload 'sgml-map-element-types "psgml-info" nil t)
(autoload 'sgml-eltype-refrenced-elements "psgml-info" nil t)
;;
;; Global configuration variables -- change as appropriate.
;;
; Default to the style-sheet
; DTD from the jade distribution.
(defvar sgml-dsssl-prolog
"<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\">\n\n"
"Prolog for generated DSSSL scripts.")
(defvar sgml-dsssl-root-foc "simple-page-sequence"
"The default flow-object class for the root element type.")
(defvar sgml-dsssl-mixed-foc "paragraph"
"The default flow-object class for an element type with mixed content.")
(defvar sgml-dsssl-element-foc "display-group"
"The default flow-object class for an element type with element content.")
(defvar sgml-dsssl-data-foc "sequence"
"The default flow-object class for an element type with data content.")
(defvar sgml-dsssl-empty-foc "sequence"
"The default flow-object class for an element type with EMPTY content.")
;;;
;;; Generate a skeleton DSSSL spec.
;;;
(defun sgml-dsssl-make-spec ()
"Generate a skeleton DSSSL style spec for the SGML document in a buffer.
The output will always go into a buffer named \"**DSSSL**\"."
(interactive)
(sgml-need-dtd)
(let ((root (symbol-name (sgml-element-name (sgml-top-element))))
(max-lisp-eval-depth 10000)
(elements-seen ()))
(with-output-to-temp-buffer "**DSSSL**"
(princ sgml-dsssl-prolog)
(sgml-dsssl-make-rule (sgml-lookup-eltype root)))))
(defun sgml-dsssl-make-rule (eltype &optional parent-mixed)
"Generate an element-construction rule, then recurse to any children."
(let ((name (sgml-eltype-name eltype))
(foc
(cond ((equal elements-seen ())
sgml-dsssl-root-foc)
((or (equal (sgml-eltype-refrenced-elements eltype)
(list (intern "#PCDATA")))
parent-mixed)
sgml-dsssl-data-foc)
; ((sgml-eltype-mixed eltype)
; sgml-dsssl-mixed-foc)
((equal (sgml-eltype-refrenced-elements eltype) ())
sgml-dsssl-empty-foc)
(t sgml-dsssl-element-foc))))
(push name elements-seen)
; (princ ";; Contents: ")
; (mapc (function (lambda (child) (princ child) (princ " ")))
; (sgml-eltype-refrenced-elements eltype))
; (princ "\n")
(princ (format "(element %s\n (make %s\n (process-children)))\n\n"
(upcase name) foc)))
(mapcar (function
(lambda (el)
(if (and (not (memq (sgml-eltype-name el) elements-seen))
(not (string= (sgml-eltype-name el) "#PCDATA")))
(sgml-dsssl-make-rule el (sgml-eltype-mixed eltype)))))
(sgml-eltype-refrenced-elements eltype)))

985
psgml-html.el Normal file
View File

@ -0,0 +1,985 @@
;;; psgml-html.el --- HTML mode in conjunction with PSGML
;; Copyright (C) 1994 Nelson Minar.
;; Copyright (C) 1995 Nelson Minar and Ulrik Dickow.
;; Copyright (C) 1996 Ben Wing.
;; This file is part of XEmacs.
;; XEmacs is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; XEmacs is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with XEmacs; see the file COPYING. If not, write to the Free
;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
;;; Synched up with: FSF 19.30.
;;; Author: Ben Wing.
;;; Commentary:
; Parts were taken from html-helper-mode and from code by Alastair Burt.
; If you'd like to use the hm--html-minor-mode together with this
; mode, you have to put the following line to your ~/.emacs:
; (add-hook 'html-mode-hook 'hm--html-minor-mode)
;; Modified for Debian: use (string-match "XEmacs" emacs-version)
;; instead of running-xemacs
;;; Code:
(defvar html-auto-sgml-entity-conversion nil
"*Control automatic sgml entity to ISO-8859-1 conversion")
(provide 'psgml-html)
(require 'psgml)
(require 'derived)
(when html-auto-sgml-entity-conversion
(require 'iso-sgml))
(require 'tempo) ;essential part of html-helper-mode
(eval-when-compile
(require 'browse-url)
(require 'font-lock)
(require 'imenu))
;;{{{ user variables
(defgroup html nil
"HyperText Markup Language"
:group 'sgml)
(defgroup psgml-html nil
"HTML mode in conjunction with PSGML"
:tag "Psgml Html"
:prefix "psgml-html-"
:group 'html
:group 'psgml)
;;;; Modified for Debian: now accomodates Emacs as well
;; Set this to be whatever signature you want on the bottom of your pages.
(defcustom psgml-html-address-string
(cond
((string-match "XEmacs" emacs-version) ; XEmacs/Lucid
(concat "<a href=\"mailto:" (user-mail-address) "\">"
(user-full-name) "</a>"))
(t
(concat "<a href=\"mailto:" user-mail-address "\">"
user-full-name "</a>")))
"*The default author string of each file."
:type 'string
:group 'psgml-html)
(defcustom psgml-html-htmldtd-version "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
"*Version of HTML DTD you're using."
:type 'string
:group 'psgml-html)
(defcustom psgml-html-do-write-file-hooks t
"*If not nil, then modify `local-write-file-hooks' to do timestamps."
:type 'boolean
:group 'psgml-html)
(defcustom psgml-html-build-new-buffer t
"*If not nil, then insert `psgml-html-new-buffer-strings' for new buffers."
:type 'boolean
:group 'psgml-html)
(defcustom psgml-html-timestamp-hook 'psgml-html-default-insert-timestamp
"*Hook called for timestamp insertion.
Override this for your own timestamp styles."
:type 'hook
:group 'psgml-html)
;; strings you might want to change
(defcustom psgml-html-new-buffer-template
'(psgml-html-htmldtd-version
"<html>\n"
" <head>\n"
" <title>" (p "Document Title: " title) "</title>\n"
" </head>\n"
"\n"
" <body>\n"
" <h1>" (s title) "</h1>\n\n"
p
"\n\n <hr>\n"
" <address>" psgml-html-address-string "</address>\n"
(psgml-html-return-created-string)
psgml-html-timestamp-start
psgml-html-timestamp-end
"\n </body>\n</html>\n")
"*Template for new buffers.
Inserted by `psgml-html-insert-new-buffer-strings' if
`psgml-html-build-new-buffer' is set to t"
:type 'sexp
:group 'psgml-html)
(defcustom psgml-html-timestamp-start "<!-- hhmts start -->\n"
"*Start delimiter for timestamps.
Everything between `psgml-html-timestamp-start' and
`psgml-html-timestamp-end' will be deleted and replaced with the output
of the functions `psgml-html-timestamp-hook' if
`psgml-html-do-write-file-hooks' is t"
:type 'string
:group 'psgml-html)
(defcustom psgml-html-timestamp-end "<!-- hhmts end -->"
"*End delimiter for timestamps.
Everything between `psgml-html-timestamp-start' and
`psgml-html-timestamp-end' will be deleted and replaced with the output
of the function `psgml-html-insert-timestamp' if
`psgml-html-do-write-file-hooks' is t"
:type 'string
:group 'psgml-html)
;; control over what types of tags to load. By default, we load all the
;; ones we know of.
(defcustom psgml-html-types-to-install
'(anchor header logical phys list textel entity image head form table
special)
"*List of tag types to install when psgml-html-mode is first loaded.
If you want to not install some type of tag, override this variable.
Order is significant: menus go in this order."
:type '(repeat symbol)
:group 'psgml-html)
(defcustom psgml-html-use-expert-menu nil
"*If not nil, then use the full HTML menu."
:type 'boolean
:group 'psgml-html)
(defcustom psgml-html-user-menu nil
"*Extra items to put in the HTML expert menu.
The value of this symbol is appended to the beginning of the expert
menu that is handed off to easymenu for definition. It should be a
list of vectors or lists which themselves are vectors (for submenus)."
:type 'sexp
:group 'psgml-html)
;;}}} end of user variables
;;{{{ type based keymap and menu variable and function setup
;; psgml-html-mode has a concept of "type" of tags. Each type is a
;; list of tags that all go together in one keymap and one menu.
;; Types can be added to the system after psgml-html has been loaded,
;; briefly by doing psgml-html-add-type-to-alist, then
;; psgml-html-install-type, then psgml-html-add-tag (for each tag)
;; then psgml-html-rebuild-menu. See the mode documentation for more detail.
(defconst psgml-html-type-alist nil
"Alist: type of tag -> keymap, keybinding, menu, menu string.
Add to this with `psgml-html-add-type-to-alist'.")
;;{{{ accessor functions for psgml-html-type-alist
(tempo-define-template "html-skeleton" psgml-html-new-buffer-template
nil
"Insert a skeleton for a HTML document")
(defun psgml-html-keymap-for (type)
"Accessor function for alist: for type, return keymap or nil"
(nth 0 (cdr-safe (assq type psgml-html-type-alist))))
(defun psgml-html-key-for (type)
"Accessor function for alist: for type, return keybinding or nil"
(nth 1 (cdr-safe (assq type psgml-html-type-alist))))
(defun psgml-html-menu-for (type)
"Accessor function for alist: for type, return menu or nil"
(nth 2 (cdr-safe (assq type psgml-html-type-alist))))
(defun psgml-html-menu-string-for (type)
"Accessor function for alist: for type, return menustring or nil"
(nth 3 (cdr-safe (assq type psgml-html-type-alist))))
(defun psgml-html-normalized-menu-for (type)
"Helper function for building menus from submenus: add on string to menu."
(cons (psgml-html-menu-string-for type)
(eval (psgml-html-menu-for type))))
;;}}}
(define-derived-mode html-mode sgml-mode "HTML"
"Major mode for editing HTML documents.
This is based on PSGML mode, and has a sophisticated SGML parser in it.
It knows how to properly indent HTML/SGML documents, and it can do
a form of document validation (use \\[sgml-next-trouble-spot] to find
the next error in your document).
Commands beginning with C-z insert various types of HTML tags
(prompting for the required information); to iconify or suspend,
use C-z C-z.
To literally insert special characters such as < and &, use C-c followed
by the character.
Use \\[sgml-insert-end-tag] to insert the proper closing tag.
Use \\[sgml-edit-attributes] to edit the attributes for a tag.
Use \\[sgml-show-context] to show the current HTML context.
More specifically:
\\{html-mode-map}
"
(make-local-variable 'sgml-declaration)
(make-local-variable 'sgml-default-doctype-name)
(if (or
(not (boundp 'sgml-custom-dtd))
(not sgml-custom-dtd))
(setq
sgml-custom-dtd
'(
( "HTML 4.01 Strict"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">" )
( "HTML 4.01 Transitional"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">")
( "HTML 4.01 Frameset"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">" )
)
))
(setq sgml-declaration (expand-file-name "html.decl"
sgml-data-directory)
sgml-default-doctype-name "HTML"
sgml-always-quote-attributes t
sgml-indent-step 2
sgml-indent-data t
sgml-inhibit-indent-tags '("pre")
sgml-minimize-attributes nil
sgml-omittag t
sgml-shorttag t)
;; Added for Debian
;; menus for creating new documents
;; font-lock setup for various emacsen: XEmacs, Emacs 19.29+, Emacs <19.29.
;; By Ulrik Dickow <dickow@nbi.dk>. (Last update: 05-Sep-1995).
(cond ((string-match "XEmacs" emacs-version) ; XEmacs/Lucid
(put major-mode 'font-lock-keywords-case-fold-search t))
;; XEmacs (19.13, at least) guesses the rest correctly.
;; If any older XEmacsen don't, then tell me.
;;
((string-lessp "19.28.89" emacs-version) ; Emacs 19.29 and later
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(html-font-lock-keywords t t)))
;;
(t ; Emacs 19.28 and older
(make-local-variable 'font-lock-keywords-case-fold-search)
(make-local-variable 'font-lock-keywords)
(make-local-variable 'font-lock-no-comments)
(setq font-lock-keywords-case-fold-search t)
(setq font-lock-keywords html-font-lock-keywords)
(setq font-lock-no-comments t)))
(if psgml-html-do-write-file-hooks
(add-hook 'local-write-file-hooks 'psgml-html-update-timestamp))
(if (and psgml-html-build-new-buffer (zerop (buffer-size)))
(psgml-html-insert-new-buffer-strings))
(set (make-local-variable 'sgml-custom-markup)
'(("<A>" "<A HREF=\"\">\r</a>")))
;; Set up the syntax table.
(modify-syntax-entry ?< "(>" html-mode-syntax-table)
(modify-syntax-entry ?> ")<" html-mode-syntax-table)
(modify-syntax-entry ?\" ". " html-mode-syntax-table)
(modify-syntax-entry ?\\ ". " html-mode-syntax-table)
(modify-syntax-entry ?' "w " html-mode-syntax-table)
(tempo-use-tag-list 'psgml-html-tempo-tags psgml-html-completion-finder)
(setq imenu-create-index-function 'psgml-html-imenu-index)
(setq imenu-sort-function nil) ; sorting the menu defeats the purpose
; sigh ... need to call this now to get things working.
(sgml-build-custom-menus)
;; (add-submenu nil sgml-html-menu "SGML")
(setq sgml-menu-name "HTML")
(easy-menu-add sgml-html-menu)
(psgml-html-rebuild-menu)
(if (string-match "XEmacs" emacs-version)
(unless (featurep 'infodock)
(delete-menu-item '("SGML")))))
(defvar psgml-html-imenu-regexp
"\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)"
"*A regular expression matching a head line to be added to the menu.
The first `match-string' should be a number from 1-9.
The second `match-string' matches extra tags and is ignored.
The third `match-string' will be the used in the menu.")
;; Make an index for imenu
(defun psgml-html-imenu-index ()
"Return an table of contents for an html buffer for use with Imenu."
(let ((space ?\ ) ; a char
(toc-index '())
toc-str)
(save-excursion
(goto-char (point-min))
(while (re-search-forward psgml-html-imenu-regexp nil t)
(setq toc-str
(concat
(make-string
(* 2 (- (string-to-number (match-string 1)) 1))
space)
(match-string 3)))
(beginning-of-line)
(setq toc-index (cons (cons toc-str (point)) toc-index))
(end-of-line)))
(nreverse toc-index)))
(defun psgml-html-add-type-to-alist (type)
"Add a type specification to the alist.
The spec goes (type . (keymap-symbol keyprefix menu-symbol menu-string)).
See code for an example."
(setq psgml-html-type-alist (cons type psgml-html-type-alist)))
;; Here are the types provided by psgml-html-mode.
(mapcar 'psgml-html-add-type-to-alist
'((entity . (nil nil psgml-html-entity-menu "Insert Character Entities"))
(textel . (nil nil psgml-html-textel-menu "Insert Text Elements"))
(head . (psgml-html-head-map "\C-zw" psgml-html-head-menu "Insert Structural Elements"))
(header . (psgml-html-base-map "\C-z" psgml-html-header-menu "Insert Headers"))
(anchor . (psgml-html-base-map "\C-z" psgml-html-anchor-menu "Insert Hyperlinks"))
(logical . (psgml-html-base-map "\C-z" psgml-html-logical-menu "Insert Logical Styles"))
(phys . (psgml-html-base-map "\C-z" psgml-html-phys-menu "Insert Physical Styles"))
(list . (psgml-html-list-map "\C-zl" psgml-html-list-menu "Insert List Elements"))
(form . (psgml-html-form-map "\C-zf" psgml-html-form-menu "Insert Form Elements"))
(table . (psgml-html-table-map "\C-zt" psgml-html-table-menu "Insert Table Elements"))
(image . (psgml-html-image-map "\C-zm" psgml-html-image-menu "Insert Inlined Images"))
(special . (psgml-html-base-map "\C-z" psgml-html-special-menu "Insert Specials"))))
;; Once psgml-html-mode is aware of a type, it can then install the
;; type: arrange for keybindings, menus, etc.
(defconst psgml-html-installed-types nil
"The types that have been installed (used when building menus).
There is no support for removing a type once it has been installed.")
(defun psgml-html-install-type (type)
"Install a new tag type: add it to the keymap, menu structures, etc.
For this to work, the type must first have been added to the list of types
with psgml-html-add-type-to-alist."
(setq psgml-html-installed-types (cons type psgml-html-installed-types))
(let ((keymap (psgml-html-keymap-for type))
(key (psgml-html-key-for type))
(menu (psgml-html-menu-for type))
(menu-string (psgml-html-menu-string-for type)))
(and key
(progn
(set keymap nil)
(define-prefix-command keymap)
(define-key html-mode-map key keymap)))
(and menu
(progn
(set menu nil)))))
;; install the default types.
(mapcar 'psgml-html-install-type psgml-html-types-to-install)
;;}}}
;;{{{ psgml-html-add-tag function for building basic tags
(defvar psgml-html-tempo-tags nil
"List of tags used in completion.")
;; this while loop is awfully Cish
;; isn't there an emacs lisp function to do this?
(defun psgml-html-string-to-symbol (input-string)
"Given a string, downcase it and replace spaces with -.
We use this to turn menu entries into good symbols for functions.
It's not entirely successful, but fortunately emacs lisp is forgiving."
(let* ((s (downcase input-string))
(l (1- (length s))))
(while (>= l 0)
(if (char-equal (aref s l) ?\ )
(aset s l ?\-))
(setq l (1- l)))
(concat "html-" s)))
(defun psgml-html-add-tag (l)
"Add a new tag to psgml-html-mode.
Builds a tempo-template for the tag and puts it into the
appropriate keymap if a key is requested. Format:
`(psgml-html-add-tag '(type keybinding completion-tag menu-name template doc)'"
(let* ((type (car l))
(keymap (psgml-html-keymap-for type))
(menu (psgml-html-menu-for type))
(key (nth 1 l))
(completer (nth 2 l))
(name (nth 3 l))
(tag (nth 4 l))
(doc (nth 5 l))
(command (tempo-define-template (psgml-html-string-to-symbol name)
tag completer doc
'psgml-html-tempo-tags)))
(if (null (memq type psgml-html-installed-types)) ;type loaded?
t ;no, do nothing.
(if (stringp key) ;bind key somewhere?
(if keymap ;special keymap?
(define-key (eval keymap) key command) ;t: bind to prefix
(define-key html-mode-map key command)) ;nil: bind to global
t)
(if menu ;is there a menu?
(set menu ;good, cons it in
(cons (vector name command t) (eval menu))))
)))
;;}}}
;;{{{ most of the HTML tags
;; These tags are an attempt to be HTML 3.2 compliant
;; For reference see <URL:http://www.w3.org/TR/REC-html32.html>
;; order here is significant: within a tag type, menus and mode help
;; go in the reverse order of what you see here. Sorry about that, it's
;; not easy to fix.
(mapcar
'psgml-html-add-tag
'(
;;entities
(entity "\C-c#" "&#" "Ascii Code" ("&#" (r "Ascii: ") ";"))
(entity "\C-c\"" "&quot;" "Quotation mark" ("&quot;"))
(entity "\C-c$" "&reg;" "Registered" ("&reg;"))
(entity "\C-c@" "&copy;" "Copyright" ("&copy;"))
(entity "\C-c-" "&shy;" "Soft Hyphen" ("&shy;"))
(entity "\C-c " "&nbsp;" "Nonbreaking Space" ("&nbsp;"))
(entity "\C-c&" "&amp;" "Ampersand" ("&amp;"))
(entity "\C-c>" "&gt;" "Greater Than" ("&gt;"))
(entity "\C-c<" "&lt;" "Less Than" ("&lt;"))
;; logical styles
(logical "v" "<div" "Text Division" ("<div align=\"" (r "Alignment: ") "\">" (r "Text: ") "</div>"))
(logical "n" "<center>" "Center" ("<center>" (r "Text: ") "</center>"))
(logical "q" "<blockquote>" "Blockquote" ("<blockquote>" (r "Quote: ") "</blockquote>"))
(logical "c" "<code>" "Code" ("<code>" (r "Code: ") "</code>"))
(logical "x" "<samp>" "Sample" ("<samp>" (r "Sample code") "</samp>"))
(logical "r" "<cite>" "Citation" ("<cite>" (r "Citation: ") "</cite>"))
(logical "k" "<kbd>" "Keyboard Input" ("<kbd>" (r "Keyboard: ") "</kbd>"))
(logical "v" "<var>" "Variable" ("<var>" (r "Variable: ") "</var>"))
(logical "d" "<dfn>" "Definition" ("<dfn>" (r "Definition: ") "</dfn>"))
(logical "a" "<address>" "Address" ("<address>" r "</address>"))
(logical "e" "<em>" "Emphasized" ("<em>" (r "Text: ") "</em>"))
(logical "s" "<strong>" "Strong" ("<strong>" (r "Text: ") "</strong>"))
(logical "p" "<pre>" "Preformatted" ("<pre>" (r "Text: ") "</pre>"))
;;physical styles
(phys "p" "<sup>" "Superscript" ("<sup>" (r "Text: ") "</sup>"))
(phys "u" "<sub>" "Subscript" ("<sub>" (r "Text: ") "</sub>"))
(phys "s" "<small>" "Small" ("<small>" (r "Text: ") "</small>"))
(phys "g" "<big>" "Big" ("<big>" (r "Text: ") "</big>"))
(phys "-" "<strike>" "Strikethru" ("<strike>" (r "Text: ") "</strike>"))
(phys "u" "<u>" "Underline" ("<u>" (r "Text: ") "</u>"))
(phys "o" "<i>" "Italic" ("<i>" (r "Text: ") "</i>"))
(phys "b" "<b>" "Bold" ("<b>" (r "Text: ") "</b>"))
(phys "t" "<tt>" "Fixed" ("<tt>" (r "Text: ") "</tt>"))
;;headers
(header "6" "<h6>" "Header 6" ("<h6>" (r "Header: ") "</h6>"))
(header "5" "<h5>" "Header 5" ("<h5>" (r "Header: ") "</h5>"))
(header "4" "<h4>" "Header 4" ("<h4>" (r "Header: ") "</h4>"))
(header "3" "<h3>" "Header 3" ("<h3>" (r "Header: ") "</h3>"))
(header "2" "<h2>" "Header 2" ("<h2>" (r "Header: ") "</h2>"))
(header "1" "<h1>" "Header 1" ("<h1>" (r "Header: ") "</h1>"))
;; forms
(form "o" "<option>" "Option" (& "<option>" > ))
(form "v" "<option value" "Option with Value" (& "<option value=\"" (r "Value: ") "\">" >))
(form "s" "<select" "Selections" ("<select name=\"" (p "Name: ") "\">\n<option>" > "\n</select>")"<select")
(form "z" "<input" "Reset Form" ("<input type=\"RESET\" value=\"" (p "Reset button text: ") "\">"))
(form "b" "<input" "Submit Form" ("<input type=\"SUBMIT\" value=\"" (p "Submit button text: ") "\">"))
(form "i" "<input" "Image Field" ("<input type=\"IMAGE\" name=\"" (p "Name: ") "\" src=\"" (p "Image URL: ") "\">"))
(form "h" "<input" "Hidden Field" ("<input type=\"HIDDEN\" name=\"" (p "Name: ") "\" value=\"" (p "Value: ") "\">"))
(form "p" "<textarea" "Text Area" ("<textarea name=\"" (p "Name: ") "\" rows=\"" (p "Rows: ") "\" cols=\"" (p "Columns: ") "\">" r "</textarea>"))
(form "c" "<input" "Checkbox" ("<input type=\"CHECKBOX\" name=\"" (p "Name: ") "\">"))
(form "r" "<input" "Radiobutton" ("<input type=\"RADIO\" name=\"" (p "Name: ") "\">"))
(form "t" "<input" "Text Field" ("<input type=\"TEXT\" name=\"" (p "Name: ") "\" size=\"" (p "Size: ") "\">"))
(form "f" "<form" "Form" ("<form action=\"" (p "Action: ") "\" method=\"" (p "Method: ") "\">\n</form>\n"))
;;tables
(table "d" "<td>" "Data cell" ("<td>"))
(table "h" "<th>" "Header" ("<th>"))
(table "r" "<tr>" "Row" ("<tr>"))
(table "t" "<table>" "Table" ("<table>\n<tr>\n</table>\n"))
;;lists
(list "t" "<dt>" "Definition Item" (& "<dt>" > (p "Term: ") "\n<dd>" > (r "Definition: ")))
(list "l" "<li>" "List Item" (& "<li>" > (r "Item: ")))
(list "r" "<dir>" "DirectoryList" (& "<dir>" > "\n<li>" > (r "Item: ") "\n</dir>" >))
(list "m" "<menu>" "Menu List" (& "<menu>" > "\n<li>" > (r "Item: ") "\n</menu>" >))
(list "o" "<ol>" "Ordered List" (& "<ol>" > "\n<li>" > (r "Item: ") "\n</ol>" >))
(list "d" "<dl>" "Definition List" (& "<dl>" > "\n<dt>" > (p "Term: ") "\n<dd>" > (r "Definition: ") "\n</dl>" >))
(list "u" "<ul>" "Unordered List" (& "<ul>" > "\n<li>" > (r "Item: ") "\n</ul>" >))
;;anchors
(anchor "n" "<a name=" "Link Target" ("<a name=\"" (p "Anchor name: ") "\">" (r "Anchor text: ") "</a>"))
(anchor "h" "<a href=" "Hyperlink" ("<a href=\"" (p "URL: ") "\">" (r "Anchor text: ") "</a>"))
;;graphics
(image "m" "<map name=" "Image map" ("<map name=\"" (r "Map name: ") "\">"))
(image "a" nil "Aligned Image" ("<img align=\"" (r "Alignment: ") "\" src=\"" (r "Image URL: ") "\">"))
(image "i" "<img src=" "Image" ("<img src=\"" (r "Image URL: ") "\">"))
(image "e" "<img align=" "Aligned Image With Alt. Text" ("<img align=\"" (r "Alignment: ") "\" src=\"" (r "Image URL: ") "\" alt=\"" (r "Text URL: ") "\">"))
(image "t" "<img alt=" "Image With Alternate Text" ("<img alt=\"" (r "Text URL: ") "\" src=\"" (r "Image URL: ") "\">"))
;;specials
(special "a" "<applet code=" "Applet" ("<applet code=\"" (r "Applet class: ") "\" width=" (r "Applet width: ") " height=" (r "Applet height: ") ">"))
(special "b" "<basefont size=" "Base font size" ("<basefont size=" (r "Font size: ") ">"))
(special "c" "<font color=" "Font color" ("<font color=\"" (r "Color: ") "\">" (r "Text: ") "</font>"))
(special "s" "<font size=" "Font size" ("<font size=" (r "Font size: ") ">" (r "Text: ") "</font>"))
;;text elements
(textel "\C-c=" nil "Horizontal Line" (& "<hr>\n"))
(textel "\C-c\C-m" nil "Line Break" ("<br>\n"))
(textel "\e\C-m" nil "Paragraph" ("<p>" (progn (sgml-indent-line) nil) "\n"))
;;head elements
(head "H" "<head>" "Head" ("<head>\n" "</head>\n"))
(head "B" "<body>" "Body" ("<body>\n" "</body>\n"))
(head "i" "<isindex>" "Isindex" ("<isindex>\n"))
(head "n" "<nextid>" "Nextid" ("<nextid>\n"))
(head "h" "<meta http-equiv=" "HTTP Equivalent" ("<meta http-equiv=\"" (p "Equivalent: ") "\" content=\"" (r "Content: ") "\">\n"))
(head "m" "<meta name=" "Meta Name" ("<meta name=\"" (p "Name: ") "\" content=\"" (r "Content: ") "\">\n"))
(head "l" "<link" "Link" ("<link href=\"" p "\">"))
(head "s" "<script>" "Script" ("<script>"))
(head "y" "<style>" "Style" ("<style>"))
(head "b" "<base" "Base" ("<base href=\"" r "\">"))
(head "t" "<title>" "Title" ("<title>" (r "Document title: ") "</title>"))
))
;;}}}
;;{{{ psgml-html-smart-insert-item
;; there are two different kinds of items in HTML - those in regular
;; lists <li> and those in dictionaries <dt>..<dd>
;; This command will insert the appropriate one depending on context.
(defun psgml-html-smart-insert-item (&optional arg)
"Insert a new item, either in a regular list or a dictionary."
(interactive "*P")
(let ((case-fold-search t))
(if
(save-excursion
(re-search-backward "<li>\\|<dt>\\|<ul>\\|<ol>\\|<dd>\\|<menu>\\|<dir>\\|<dl>" nil t)
(looking-at "<dt>\\|<dl>\\|<dd>"))
(tempo-template-html-definition-item arg)
(tempo-template-html-list-item arg))))
;; special keybindings in the prefix maps (not in the list of tags)
(and (boundp 'psgml-html-base-map)
(define-key psgml-html-base-map "i" 'psgml-html-smart-insert-item))
(if (eq window-system 'x)
(define-key html-mode-map "\C-z\C-z" 'iconify-or-deiconify-frame)
(define-key html-mode-map "\C-z\C-z" 'suspend-emacs))
;;(define-key html-mode-map "\C-zg" 'html-insert-mailto-reference-from-click)
;; and, special menu bindings
(and (boundp 'psgml-html-list-menu)
(setq psgml-html-list-menu
(cons '["List Item" psgml-html-smart-insert-item t] psgml-html-list-menu)))
;;}}}
;;{{{ menu support
;; menus are built for easymenu. psgml-html-add-tag builds
;; submenus based on tag type, the expert menu code lumps them
;; together into one list and calls easy-menu-define
(defun psgml-html-rebuild-menu nil
"Rebuild and install the HTML menu (using `easy-menu-define').
If `psgml-html-use-expert-menu' is nil, then just use a novice menu."
(let ((menu (psgml-html-expert-menu)))
(easy-menu-remove menu)
(easy-menu-add menu html-mode-map)))
(defun psgml-html-toggle-expert-menu (&optional arg)
"Toggle full HTML menus. Optional arg acts like minor-mode args."
(interactive "P")
(setq psgml-html-use-expert-menu
(if (null arg) (not psgml-html-use-expert-menu)
(> (prefix-numeric-value arg) 0)))
(psgml-html-rebuild-menu))
;; Expert menus: consed up out of psgml-html-installed-types
(defun psgml-html-expert-menu ()
"This menu is based on the current value of `psgml-html-installed-types'.
This function can be called again, it redoes the entire menu."
;; Start with the user-provided menu stuff
(let ((psgml-html-mode-menu psgml-html-user-menu))
;; Now cons in the browse-url functions
(if (fboundp 'browse-url-of-file)
(setq psgml-html-mode-menu
(cons '["Load this Buffer in Browser" browse-url-of-file t]
psgml-html-mode-menu)))
(if (and (boundp 'browse-url-browser-function)
(fboundp 'browse-url-browser-function))
(setq psgml-html-mode-menu
(cons (vector "Browse URL at point"
browse-url-browser-function t)
psgml-html-mode-menu)))
;; cons in the timestamp delimiters
(setq psgml-html-mode-menu
(cons '["Insert Timestamp Delimiter"
psgml-html-insert-timestamp-delimiter-at-point t]
psgml-html-mode-menu))
;; now cons up the main menu out of the submenus
(mapcar
(function (lambda (type)
(setq psgml-html-mode-menu
(cons (psgml-html-normalized-menu-for type)
psgml-html-mode-menu))))
psgml-html-installed-types)
;; now tack on our name
(setq psgml-html-mode-menu (cons "Insert" psgml-html-mode-menu))
;; special mode keys
(define-key html-mode-map (kbd "<M-iso-left-tab>") 'tempo-complete-tag)
;;("\M-\C-f" tempo-forward-mark)
;;("\M-\C-b" tempo-backward-mark)
psgml-html-mode-menu))
;;}}}
;;{{{ patterns for font-lock
; Old patterns from html-mode.el
;(defvar html-font-lock-keywords
; (list
; '("\\(<[^>]*>\\)+" . font-lock-comment-face)
; '("[Hh][Rr][Ee][Ff]=\"\\([^\"]*\\)\"" 1 font-lock-string-face t)
; '("[Ss][Rr][Cc]=\"\\([^\"]*\\)\"" 1 font-lock-string-face t))
; "Patterns to highlight in HTML buffers.")
;; By Ulrik Dickow <dickow@nbi.dk>.
;;
;; Originally aimed at Emacs 19.29. Later on disabled syntactic fontification
;; and reordered regexps completely, to be compatible with XEmacs (it doesn't
;; understand OVERRIDE=`keep').
;;
;; We make an effort on handling nested tags intelligently.
;; font-lock compatibility with XEmacs/Lucid and older Emacsen (<19.29).
;;
(if (string-match "XEmacs" emacs-version)
;; XEmacs/Lucid
;; Make needed faces if the user hasn't already done so.
;; Respect X resources (`make-face' uses them when they exist).
(let ((change-it
(function (lambda (face)
(or (if (fboundp 'facep)
(facep face)
(memq face (face-list)))
(make-face face))
(not (face-differs-from-default-p face))))))
(if (funcall change-it 'psgml-html-bold-face)
(copy-face 'bold 'psgml-html-bold-face))
(if (funcall change-it 'psgml-html-italic-face)
(copy-face 'italic 'psgml-html-italic-face))
(if (funcall change-it 'psgml-html-underline-face)
(set-face-underline-p 'psgml-html-underline-face t))
;; (if (funcall change-it 'font-lock-variable-name-face)
;; (set-face-foreground 'font-lock-variable-name-face "salmon"))
;; (if (funcall change-it 'font-lock-reference-face)
;; (set-face-foreground 'font-lock-reference-face "violet"))
)
;; Emacs (any version)
;;
;; Note that Emacs evaluates the face entries in `font-lock-keywords',
;; while XEmacs doesn't. So XEmacs doesn't use the following *variables*,
;; but instead the faces with the same names as the variables.
(defvar psgml-html-bold-face 'bold
"Face used as bold. Typically `bold'.")
(defvar psgml-html-italic-face 'italic
"Face used as italic. Typically `italic'.")
(defvar psgml-html-underline-face 'underline
"Face used as underline. Typically `underline'.")
;;
(if (string-lessp "19.28.89" emacs-version)
() ; Emacs 19.29 and later
;; Emacs 19.28 and older
;; Define face variables that don't exist until Emacs 19.29.
(defvar font-lock-variable-name-face 'font-lock-doc-string-face
"Face to use for variable names -- and some HTML keywords.")
(defvar font-lock-reference-face 'underline ; Ugly at line breaks
"Face to use for references -- including HTML hyperlink texts.")))
(defvar html-font-lock-keywords
(let (;; Titles and H1's, like function defs.
;; We allow for HTML 3.0 attributes, like `<h1 align=center>'.
(tword "\\(h1\\|title\\)\\([ \t\n]+[^>]+\\)?")
;; Names of tags to boldify.
(bword "\\(b\\|h[2-4]\\|strong\\)\\([ \t\n]+[^>]+\\)?")
;; Names of tags to italify.
(iword "\\(address\\|cite\\|em\\|i\\|var\\)\\([ \t\n]+[^>]+\\)?")
;; Regexp to match shortest sequence that surely isn't a bold end.
;; We simplify a bit by extending "</strong>" to "</str.*".
;; Do similarly for non-italic and non-title ends.
(not-bend (concat "\\([^<]\\|<\\([^/]\\|/\\([^bhs]\\|"
"b[^>]\\|"
"h\\([^2-4]\\|[2-4][^>]\\)\\|"
"s\\([^t]\\|t[^r]\\)\\)\\)\\)"))
(not-iend (concat "\\([^<]\\|<\\([^/]\\|/\\([^aceiv]\\|"
"a\\([^d]\\|d[^d]\\)\\|"
"c\\([^i]\\|i[^t]\\)\\|"
"e\\([^m]\\|m[^>]\\)\\|"
"i[^>]\\|"
"v\\([^a]\\|a[^r]\\)\\)\\)\\)"))
(not-tend (concat "\\([^<]\\|<\\([^/]\\|/\\([^ht]\\|"
"h[^1]\\|t\\([^i]\\|i[^t]\\)\\)\\)\\)")))
(list ; Avoid use of `keep', since XEmacs will treat it the same as `t'.
;; First fontify the text of a HREF anchor. It may be overridden later.
;; Anchors in headings will be made bold, for instance.
'("<a\\s-+href[^>]*>\\([^>]+\\)</a>"
1 font-lock-reference-face t)
;; Tag pairs like <b>...</b> etc.
;; Cunning repeated fontification to handle common cases of overlap.
;; Bold complex --- possibly with arbitrary other non-bold stuff inside.
(list (concat "<" bword ">\\(" not-bend "*\\)</\\1>")
3 'psgml-html-bold-face t)
;; Italic complex --- possibly with arbitrary non-italic kept inside.
(list (concat "<" iword ">\\(" not-iend "*\\)</\\1>")
3 'psgml-html-italic-face t)
;; Bold simple --- first fontify bold regions with no tags inside.
(list (concat "<" bword ">\\(" "[^<]" "*\\)</\\1>")
3 'psgml-html-bold-face t)
;; Any tag, general rule, just after bold/italic stuff.
'("\\(<[^>]*>\\)" 1 font-lock-type-face t)
;; Titles and level 1 headings (anchors do sometimes appear in h1's)
(list (concat "<" tword ">\\(" not-tend "*\\)</\\1>")
3 'font-lock-function-name-face t)
;; Underline is rarely used. Only handle it when no tags inside.
'("<u>\\([^<]*\\)</u>" 1 psgml-html-underline-face t)
;; Forms, anchors & images (also fontify strings inside)
'("\\(<\\(form\\|i\\(mg\\|nput\\)\\)\\>[^>]*>\\)"
1 font-lock-variable-name-face t)
'("</a>" 0 font-lock-keyword-face t)
'("\\(<a\\b[^>]*>\\)" 1 font-lock-keyword-face t)
'("=[ \t\n]*\\(\"[^\"]+\"\\)" 1 font-lock-string-face t)
;; Large-scale structure keywords (like "program" in Fortran).
;; "<html>" "</html>" "<body>" "</body>" "<head>" "</head>" "</form>"
'("</?\\(body\\|form\\|h\\(ead\\|tml\\)\\)>"
0 font-lock-variable-name-face t)
;; HTML special characters
'("&[^;\n]*;" 0 font-lock-string-face t)
;; SGML things like <!DOCTYPE ...> with possible <!ENTITY...> inside.
'("\\(<![a-z]+\\>[^<>]*\\(<[^>]*>[^<>]*\\)*>\\)"
1 font-lock-comment-face t)
;; Comments: <!-- ... -->. They traditionally override anything else.
;; It's complicated 'cause we won't allow "-->" inside a comment, and
;; font-lock colours the *longest* possible match of the regexp.
'("\\(<!--\\([^-]\\|-[^-]\\|--[^>]\\)*-->\\)"
1 font-lock-comment-face t)))
"Additional expressions to highlight in HTML mode.")
(put 'html-mode 'font-lock-defaults '(html-font-lock-keywords nil t))
;;}}}
;;{{{ patterns for hilit19
;; Define some useful highlighting patterns for the hilit19 package.
;; These will activate only if hilit19 has already been loaded.
;; Thanks to <dickow@nbi.dk> for some pattern suggestions
(if (featurep 'hilit19)
(hilit-set-mode-patterns
'psgml-html-mode
'(("<!--" "-->" comment)
("<![a-z]+\\>[^<>]*\\(<[^>]*>[^<>]*\\)*>" nil comment) ;<!DOCTYPE ...>
("<title>" "</title>" defun)
("<h[1-6]>" "</h[1-6]>" bold) ;only colour inside tag
("<a\\b" ">" define)
("</a>" nil define)
("<img\\b" ">" include)
("<option\\|</?select\\|<input\\|</?form\\|</?textarea" ">" include)
;; First <i> highlighting just handles unnested tags, then do nesting
("<i>[^<]*</i>" nil italic)
("<b>" "</b>" bold)
("<i>" "</i>" italic)
("<u>" "</u>" underline)
("&[^;\n]*;" nil string)
("<" ">" keyword))
nil 'case-insensitive)
nil)
;;}}}
;;{{{ completion finder for tempo
;; The regexp finds everything between the last < or & and point,
;; which is good enough to match the tags HTML might complete.
(defvar psgml-html-completion-finder "\\(\\(<\\|&\\).*\\)\\="
"Passed to tempo-use-tag-list, used to find tags to complete.")
;;}}}
;;{{{ timestamps
(defun psgml-html-update-timestamp ()
"Basic function for updating timestamps.
It finds the timestamp in the buffer by looking for
`psgml-html-timestamp-start', deletes all text up to
`psgml-html-timestamp-end', and runs `psgml-html-timestamp-hook' which
will should insert an appropriate timestamp in the buffer."
(save-excursion
(goto-char (point-max))
(if (not (search-backward psgml-html-timestamp-start nil t))
(message "timestamp delimiter start was not found")
(let ((ts-start (+ (point) (length psgml-html-timestamp-start)))
(ts-end (if (search-forward psgml-html-timestamp-end nil t)
(- (point) (length psgml-html-timestamp-end))
nil)))
(if (not ts-end)
(message "timestamp delimiter end was not found. Type C-c C-t to insert one.")
(delete-region ts-start ts-end)
(goto-char ts-start)
(run-hooks 'psgml-html-timestamp-hook)))))
nil)
(defun psgml-html-return-created-string ()
"Return a \"Created:\" string."
(let ((time (current-time-string)))
(concat "<!-- Created: "
(substring time 0 20)
(nth 1 (current-time-zone))
" "
(substring time -4)
" -->\n")))
(defun psgml-html-default-insert-timestamp ()
"Default timestamp insertion function."
(let ((time (current-time-string)))
(insert "Last modified: "
(substring time 0 20)
(nth 1 (current-time-zone))
" "
(substring time -4)
"\n")))
(defun psgml-html-insert-timestamp-delimiter-at-point ()
"Simple function that inserts timestamp delimiters at point.
Useful for adding timestamps to existing buffers."
(interactive)
(insert psgml-html-timestamp-start)
(insert psgml-html-timestamp-end))
;;}}}
(defun mail-address-at-point (pos &optional buffer)
"Return a list (NAME ADDRESS) of the address at POS in BUFFER."
(or buffer (setq buffer (current-buffer)))
(let (beg end)
(save-excursion
(set-buffer buffer)
(save-excursion
(goto-char pos)
(or (re-search-forward "[\n,]" nil t)
(error "Can't find address at position"))
(backward-char)
(setq end (point))
(or (re-search-backward "[\n,:]" nil t)
(error "Can't find address at position"))
(forward-char)
(re-search-forward "[ \t]*" nil t)
(setq beg (point))
(mail-extract-address-components (buffer-substring beg end))))))
(defun html-insert-mailto-reference-from-click ()
"Insert a mailto: reference for the clicked-on e-mail address."
(interactive)
(let (event)
(message "Click on a mail address:")
(save-excursion
(setq event (next-command-event))
(or (mouse-event-p event)
(error "Aborted.")))
(let ((lis (mail-address-at-point (event-closest-point event)
(event-buffer event))))
(insert "<a href=\"mailto:" (car (cdr lis)) "\">"
(or (car lis) (car (cdr lis))) "</a>"))))
;;;###autoload
(defun html-quote-region (begin end)
"\"Quote\" any characters in the region that have special HTML meanings.
This converts <'s, >'s, and &'s into the HTML commands necessary to
get those characters to appear literally in the output."
(interactive "r")
(save-excursion
(goto-char begin)
(while (search-forward "&" end t)
(forward-char -1)
(delete-char 1)
(insert "&amp;")
(setq end (+ 4 end)))
(goto-char begin)
(while (search-forward "<" end t)
(forward-char -1)
(delete-char 1)
(insert "&lt;")
(setq end (+ 3 end)))
(goto-char begin)
(while (search-forward ">" end t)
(forward-char -1)
(delete-char 1)
(insert "&gt;")
(setq end (+ 3 end)))))
;;{{{ psgml-html-insert-new-buffer-strings
(tempo-define-template "html-skeleton" psgml-html-new-buffer-template
nil
"Insert a skeleton for a HTML document")
(defun psgml-html-insert-new-buffer-strings ()
"Insert `psgml-html-new-buffer-strings'."
(set-mark (point-min))
(tempo-template-html-skeleton nil))
;;}}}
;;;###autoload
(autoload 'html-mode "psgml-html" "HTML mode." t)
(defvar sgml-html-menu
(cons "HTML"
(append '(["View in Browser" browse-url-of-buffer
(buffer-file-name
(current-buffer))]
["View in W3" w3-preview-this-buffer t]
"---"
["HTML-Quote Region" html-quote-region t]
"---")
(cdr sgml-main-menu))))
(defun sgml-html-netscape-file ()
"Preview the file for the current buffer in Netscape."
(interactive)
(highlight-headers-follow-url-netscape
(concat "file:" (buffer-file-name (current-buffer)))))
(defun sgml-html-kfm-file ()
"Preview the file for the current buffer in kfm."
(interactive)
(highlight-headers-follow-url-kfm
(concat "file:" (buffer-file-name (current-buffer)))))
;;; end of psgml-html.el

3
psgml-ja.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c0a20cc69db4f77fc3cb531b4ff8a91b6cb5cc57203414f302eae932da6b1d61
size 18567

83
psgml-xpointer.el Normal file
View File

@ -0,0 +1,83 @@
;; psgml-xpointer.el -- generate XPointers for element in XML and SGML docs.
;; Copyright (c) 1998 Megginson Technologies Ltd.
;; Author: David Megginson (david@megginson.com)
;; $Id: psgml-xpointer.el,v 1.1 1998/08/22 03:14:36 david Exp $
;;; Commentary:
;; This mode includes a single user-level command for generating an
;; XPointer to a single element in an XML or SGML document (by
;; default, the element containing point). You must be using Lennart
;; Staflin's PSGML mode (optionally with XML patches). To obtain an
;; XPointer for the current point in a document, issue the following
;; command (which may be bound to a key sequence for convenience):
;;
;; M-x sgml-xpointer
;;
;; The program will climb the element tree until it finds an element
;; with an ID attribute, then will use child() statements to locate
;; the closest element that contains point.
;;
;; Installation:
;;
;; Put the following in one of your startup files:
;;
;; (autoload 'sgml-xpointer "psgml-xpointer" nil t)
;;
;;; Code:
(require 'psgml-parse)
;;;###autoload
(defun sgml-xpointer (loc)
"Display an XPointer for the current point in an XML or SGML document.
The XPointer will appear in a temporary buffer."
(interactive "d")
(with-output-to-temp-buffer "*XPOINTER*"
(princ (sgml-xpointer-string (sgml-find-element-of loc)))))
(defun sgml-xpointer-string (el)
"Return a string containing an XPointer for the element containing point.
The XPointer will begin with the nearest ancestor that possesses an ID
attribute, or with the document root if no ancestor has an ID."
(cond ((= (sgml-element-level el) 0)
(error "XPointer Outside of document element!"))
((= (sgml-element-level el) 1)
"root")
((sgml-element-id el)
(format "id('%s')" (sgml-element-id el)))
(t
(concat
(sgml-xpointer-string (sgml-element-parent el))
(format ".child(%d,#element,'%s')"
(sgml-element-child-number el)
(sgml-element-gi el))))))
(defun sgml-element-id (el)
"Return the value of the ID attribute for this element, if any."
(let ((id (sgml-attribute-with-declared-value
(sgml-element-attlist el) 'id)))
(if id
(sgml-element-attval el (sgml-attspec-name id))
nil)))
(defun sgml-element-child-number (el)
"Return the child number of the current element.
The child number counts only elements with the same GI."
(let ((sibling (sgml-element-content (sgml-element-parent el)))
(gi (sgml-element-gi el))
(n 1))
(while (not (equal sibling el))
(if (equal gi (sgml-element-gi sibling))
(setq n (1+ n)))
(setq sibling (sgml-element-next sibling)))
n))
(provide 'psgml-xpointer)
;;; psgml-xpointer.el ends here.

13
psgml-xpointer.el.diff Normal file
View File

@ -0,0 +1,13 @@
--- psgml/psgml-xpointer.el.~1~ Sat Feb 27 00:00:00 1999
+++ psgml/psgml-xpointer.el Wed May 8 18:28:22 2002
@@ -33,6 +33,8 @@
(require 'psgml-parse)
+(eval-when-compile (require 'cl))
+
;;;###autoload
(defun sgml-xpointer (loc)
"Display an XPointer for the current point in an XML or SGML document.
Diff finished at Wed May 8 18:30:16

View File

@ -0,0 +1,18 @@
--- xxml/xxml.el.~1~ 2003-06-18 15:18:27.000000000 +0200
+++ xxml/xxml.el 2003-06-18 15:25:05.000000000 +0200
@@ -475,11 +475,11 @@
(1 xxml-sgml-delimiter-face)
(2 font-lock-keyword-face)
(3 xxml-sgml-delimiter-face))
- ("\\(<\\)\\([a-zA-Z0-9-_]+\\)"
+ ("\\(<\\)\\([a-zA-Z0-9-_:.]+\\)"
(1 xxml-sgml-delimiter-face)
(2 xxml-sgml-opening-tag-face))
(">" 0 xxml-sgml-delimiter-face)
- ("\\(<\\)\\(/[a-zA-Z0-9-_]+\\)\\(>\\)"
+ ("\\(<\\)\\(/[a-zA-Z0-9-_:.]+\\)\\(>\\)"
(1 xxml-sgml-delimiter-face)
(2 xxml-sgml-closing-tag-face)
(3 xxml-sgml-delimiter-face))
Diff finished at Wed Jun 18 15:28:41

269
psgml.changes Normal file
View File

@ -0,0 +1,269 @@
-------------------------------------------------------------------
Wed Jan 25 21:47:26 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Tue Jul 26 17:05:47 CEST 2005 - ke@suse.de
- Require 'emacs_program'.
-------------------------------------------------------------------
Wed Mar 9 09:50:05 CET 2005 - ke@suse.de
- Update to version 1.3.2:
* Bugfixes
* Better ID support.
* Move all menus to one SGML menu.
- psgml-id.dif: Remove it (obsolete).
-------------------------------------------------------------------
Mon Mar 7 11:27:47 CET 2005 - ke@suse.de
- Do not let xxml override sgml-indent-data; reported by Ulrich Windl
[# 71065].
-------------------------------------------------------------------
Thu Jul 1 13:28:13 CEST 2004 - ke@suse.de
- Fix reported typo in .changes.
-------------------------------------------------------------------
Mon Feb 9 14:28:01 CET 2004 - ke@suse.de
- tdtd-dtd-patch: Fix syntax of the DTD included in the tdtd manual;
reported by Jochen Hayek.
- Use norootforbuild.
-------------------------------------------------------------------
Wed Jun 18 17:16:23 CEST 2003 - ke@suse.de
- psgml-xxml-namespace-face.diff: Allow ';' and '.' in element name;
thus face lock can recognize namespace prefixes.
-------------------------------------------------------------------
Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de
- fix install_info --delete call and move from preun to postun
-------------------------------------------------------------------
Fri Feb 7 16:43:36 CET 2003 - ke@suse.de
- Use install_info macro [# 23451].
- psgml-1.3.1-texi-category.diff: Use proper Info categories.
-------------------------------------------------------------------
Tue Jan 7 11:40:45 CET 2003 - ke@suse.de
- Update to version 1.3.1:
* XML related enhancements (DTD-less editing),
* Mule related fixes.
* Default to font-lock if available.
-------------------------------------------------------------------
Wed Dec 11 13:48:33 CET 2002 - ke@suse.de
- psgml-1.2.5-key.diff: De-assign keybinding C-c C-c from the
command sgml-show-context to avoid clash with stock sgml-mode;
reported by Martin Vidner [# 18039].
- Add psgml-html.el but don't activate it for now.
- Try to use text properties instead of overlays.
- suse-start-psgml.el: Loading xxml.el depends on suse-psgml-use-xxml.
-------------------------------------------------------------------
Wed Dec 4 15:00:59 CET 2002 - ke@suse.de
- Replace sp/jade (jade_dsl) references with opensp/openjade.
- Supply setting for XML validation.
-------------------------------------------------------------------
Tue Dec 3 15:58:07 CET 2002 - ke@suse.de
- Update the add-on xxml.el; cf. documentation in README.xxml once
installed. The name of some faces changed; adjust your settings in
case of unexpected results.
-------------------------------------------------------------------
Mon Aug 12 09:42:40 CEST 2002 - ke@suse.de
- Update to version 1.2.5:
* Fix multibyte handling
* Improve XML support.
- Drop superfluous mule patch.
- Rearrange patches.
-------------------------------------------------------------------
Mon Jul 8 16:57:01 CEST 2002 - schwab@suse.de
- Remove global-font-lock-mode from startup file.
-------------------------------------------------------------------
Mon Nov 19 09:00:09 CET 2001 - ke@suse.de
- Update to version 1.2.3:
. Compatible with Emacs 21 (thus drop psgml-emacs-21.diff).
. Code cleanup.
- Cleanup spec file.
-------------------------------------------------------------------
Tue Nov 13 15:01:28 CET 2001 - ke@suse.de
- Use emacs-nox to build the package.
- Make the package 'noarch'.
-------------------------------------------------------------------
Thu Sep 13 10:58:07 CEST 2001 - ke@suse.de
- Fix issues reported by Pavel JANIK (thanks) [#10504]:
. Install tdtd-font-maker.elc.
. suse-start-psgml.el: Init tdtd as recommended within the tdtd
package.
. suse-start-psgml.el: Don't set sgml-validate-command to the same
value as done within psgml sources; add a comment how to use
'onsgmls'.
-------------------------------------------------------------------
Mon Aug 27 10:23:35 CEST 2001 - ke@suse.de
- Enhance sgml-public-map to make it recognize XML flavored ISO entity
files.
- Rename README.SuSE to psgml-README.SuSE.
-------------------------------------------------------------------
Mon Jul 16 11:09:51 CEST 2001 - ke@suse.de
- Update tdtd.zip (0.7.1).
- Apply 'xxml-provide.diff'.
- Add 'ke-docbook.el'; a start to fix [#9243].
- Instead of emacs.dot (was part of 'psgml-1.2.1.dif') use
'suse-start-psgml.el' as a source file.
- Update README.SuSE.
- Fix dangling symlinks [#9391].
-------------------------------------------------------------------
Mon May 28 12:43:00 CEST 2001 - ro@suse.de
- added README.SuSE as Source file.
-------------------------------------------------------------------
Fri May 25 17:03:11 CEST 2001 - ke@suse.de
- Apply patch from emacs-21.0.104/etc/PROBLEMS.
- Start README.SuSE.
-------------------------------------------------------------------
Tue Mar 13 17:36:16 CET 2001 - ro@suse.de
- added emacs-x11 to neededforbuild.
-------------------------------------------------------------------
Thu Mar 8 12:44:14 CET 2001 - uli@suse.de
- added xf86 to neededforbuild
-------------------------------------------------------------------
Tue Feb 27 16:25:16 CET 2001 - ke@suse.de
- Update to version 1.2.2.
-------------------------------------------------------------------
Mon Dec 18 09:43:16 CET 2000 - ke@suse.de
- Fix a bug (Mule related) to make psgml work with ECAT files again;
use a patch provided by ABE Yasushi
(cf. http://www.geocrawler.com/lists/3/SourceForge/7085/0/4772957/).
- Move ./configure -> %build.
-------------------------------------------------------------------
Fri Nov 17 09:16:28 CET 2000 - ro@suse.de
- ge_exec -> emacs
-------------------------------------------------------------------
Thu Oct 12 11:15:47 CEST 2000 - ke@suse.de
- Fix typo in psgml-1.2.1.dif; now it compiles psgml-xpointer.el, too.
-------------------------------------------------------------------
Fri Sep 29 13:26:15 CEST 2000 - ke@suse.de
- Add psgml-xpointer.el.
-------------------------------------------------------------------
Thu Jul 27 11:40:00 CEST 2000 - ke@suse.de
- Add xxml.el.
-------------------------------------------------------------------
Mon Feb 28 19:32:38 CET 2000 - kukuk@suse.de
- Move /usr/info -> /usr/share/info
-------------------------------------------------------------------
Mon Jan 10 15:46:27 CET 2000 - ke@suse.de
- Update: version 1.2.1.
- Install /usr/share/emacs/site-lisp/suse-start-psgml.el.
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Thu Sep 9 12:15:28 CEST 1999 - bs@suse.de
- fixed call of Check at the end of %install section
-------------------------------------------------------------------
Thu Apr 15 12:32:26 CEST 1999 - werner@suse.de
- Add export LC_CTYPE=ISO-8859-1 and export EMACS_UNIBYTE=1
to build *and* install section
-------------------------------------------------------------------
Tue Nov 24 18:18:26 MET 1998 - ke@suse.de
- Update: psgml-1.1.6 (alpha!).
-------------------------------------------------------------------
Fri Oct 16 13:36:27 MEST 1998 - ke@suse.de
- Update: psgml-1.1.4 (alpha!).
-------------------------------------------------------------------
Sun Aug 9 17:19:12 MEST 1998 - ke@suse.de
- Update: psgml-1.1.3 (alpha!).
-------------------------------------------------------------------
Thu Aug 6 16:16:40 MEST 1998 - ke@suse.de
- add the tdtd package.
-------------------------------------------------------------------
Mon Jul 27 13:00:13 MEST 1998 - bs@suse.de
- added export LC_CTYPE=ISO-8859-1 to build section - emacs needs it.
-------------------------------------------------------------------
Fri Jul 10 12:14:01 MEST 1998 - bs@suse.de
- added xaw3d to neededforbuild (ge_exec needs it)
-------------------------------------------------------------------
Sat Feb 28 16:01:19 MET 1998 - ke@suse.de
- update psgml-xml: psgmlxml-19980218.
-------------------------------------------------------------------
Mon Dec 15 11:19:56 MET 1997 - ke@suse.de
- add xml support: patch by David Megginson <dmeggins@sprynet.com>.
- add psgml-dsssl: extension by David Megginson <dmeggins@sprynet.com>.
- add psgml-jade: extension by Matthias Clasen
<mclasen@sun2.mathematik.uni-freiburg.de>.
Thu Jun 26 15:11:52 1997 - Karl Eichwalder <ke@suse.de>
* initial package: version 1.0.1

301
psgml.spec Normal file
View File

@ -0,0 +1,301 @@
#
# spec file for package psgml (Version 1.3.2)
#
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#
# norootforbuild
Name: psgml
BuildRequires: emacs-nox
%define tdtd tdtd.zip
License: distributable, Other License(s), see package
Group: Productivity/Editors/Emacs
Requires: emacs_program
Autoreqprov: on
Summary: Emacs Add-On to edit SGML/XML documents
Version: 1.3.2
Release: 2
# Source: http://belnet.dl.sourceforge.net/sourceforge/psgml/psgml-%{version}.tar.bz2
Source: ftp://ftp.lysator.liu.se/pub/sgml/ALPHA/psgml-%{version}.tar.gz
Source1: http://home.sprynet.com/sprynet/dmeggins/psgml-dsssl.el
Source2: http://logimac.mathematik.uni-freiburg.de/mixed/psgml-ja.tgz
Source3: http://www.menteith.com/tdtd/data/tdtd.zip
Source4: http://www.iro.umontreal.ca/~pinard/xxml/xxml.tar.gz
Source5: http://www.megginson.com/Software/psgml-xpointer.el
Source6: %{name}-README.SuSE
Source7: ke-docbook.el
Source8: suse-start-psgml.el
Source9: psgml-html.el
Patch: psgml-compile-addons.diff
Patch2: psgml-1.2.5-key.diff
Patch3: psgml-xpointer.el.diff
Patch4: psgml-1.3.1-texi-category.diff
Patch5: psgml-xxml-namespace-face.diff
Patch6: tdtd-dtd-patch
Patch7: xxml-indentation.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArchitectures: noarch
URL: http://sourceforge.net/projects/psgml/
PreReq: %install_info_prereq
%description
'psgml' supports you while editing SGML/XML documents. It respects the
context of the used DTD (Document Type Definition) and offers the valid
elements and attributes.
Included are several helper tools: tdtd, xxml, psgml-xpointer.
For more info see README.SuSE.
Compiled for GNU Emacs (XEmacs has its own version!).
Authors:
--------
James Clark <jjc@clark.com>
Lennart Staflin <lenst@lysator.liu.se>
David Megginson <dmeggins@sprynet.com>
Matthias Clasen <mclasen@sun2.mathematik.uni-freiburg.de>
François Pinard <pinard@iro.umontreal.ca>
%prep
%setup -q
%patch0 -p1
cp -p %{SOURCE1} .
# xxml
mkdir xxml
tar vxz -C xxml -f %{SOURCE4}
%patch -P 5 -p0
%patch7 -p1
cp xxml/xxml.el .
for f in README THANKS; do
cp xxml/$f $f.xxml
done
cp -p %{SOURCE5} .
%patch -P 2 -p1 -P 3 -p1 -P 4 -p1
%setup -q -T -D -a 2
mv psgml-jade/psgml-jade.el .
unzip -o -a %{SOURCE3}
cp -p %{SOURCE6} README.SuSE
cp -p %{SOURCE7} .
cp -p %{SOURCE8} .
cp -p %{S:9} .
%patch -p 1 -P 6
%build
./configure --prefix=%{_prefix} --infodir=%{_infodir}
make # emacs
echo "(add-to-list (quote load-path) (getenv \"PWD\"))" > load-psgml.el
emacs --batch --no-site -l load-psgml.el \
-l ./tdtd-font.el \
-f batch-byte-compile tdtd-font.el tdtd-font-maker.el tdtd.el
emacs --batch --no-site -l load-psgml.el -f batch-byte-compile xxml.el
emacs --batch --no-site -l load-psgml.el -l ./xxml.el \
-f batch-byte-compile ke-docbook.el
emacs --batch --no-site -l load-psgml.el -f batch-byte-compile psgml-xpointer.el
emacs --batch --no-site -l load-psgml.el -l tempo -f batch-byte-compile psgml-html.el
makeinfo psgml.texi
makeinfo psgml-api.texi
%install
[ -z $RPM_BUILD_ROOT ] || rm -fr $RPM_BUILD_ROOT
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml \
$RPM_BUILD_ROOT%{_infodir}
# to avoid timestamp problems, install .el files first.
install -p -m644 *.el $RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml
rm -f $RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/suse-start*
make install prefix="$RPM_BUILD_ROOT%{_prefix}" \
lispdir="$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml" \
infodir="$RPM_BUILD_ROOT%{_infodir}"
make install-info prefix="$RPM_BUILD_ROOT%{_prefix}" \
lispdir="$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml" \
infodir="$RPM_BUILD_ROOT%{_infodir}"
install -p -m644 suse-start-psgml.el \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/suse-start-psgml.el
install -p -m644 iso88591.map \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/iso88591.map
install -p -m644 tdtd-font.el tdtd-font.elc \
tdtd-font-maker.el tdtd-font-maker.elc \
tdtd.el tdtd.elc \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/
install -p -m644 xxml.el xxml.elc \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/
install -p -m644 ke-docbook.el ke-docbook.elc \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/
install -p -m644 psgml-xpointer.el psgml-xpointer.elc \
$RPM_BUILD_ROOT%{_prefix}/share/emacs/site-lisp/psgml/
pushd $RPM_BUILD_ROOT%{_infodir}/
gzip -9f psgml-api.info psgml.info
popd
ln -f tutorial.txt tdtd-tutorial.txt
ln -f readme.txt tdtd-readme.txt
ln -f dot_emacs tdtd.dot.emacs
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/psgml-api.info.gz
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/psgml-api.info.gz
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc INSTALL README.psgml README.SuSE
%doc README.xxml THANKS.xxml
%doc psgml-jade
%doc tdtd-readme.txt tdtd-tutorial.txt tdtd.dot.emacs
%config %{_prefix}/share/emacs/site-lisp/suse-start-psgml.el
%{_prefix}/share/emacs/site-lisp/psgml
%doc %{_infodir}/psgml-api.info*
%doc %{_infodir}/psgml.info*
%changelog -n psgml
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jul 26 2005 - ke@suse.de
- Require 'emacs_program'.
* Wed Mar 09 2005 - ke@suse.de
- Update to version 1.3.2:
* Bugfixes
* Better ID support.
* Move all menus to one SGML menu.
- psgml-id.dif: Remove it (obsolete).
* Mon Mar 07 2005 - ke@suse.de
- Do not let xxml override sgml-indent-data; reported by Ulrich Windl
[# 71065].
* Thu Jul 01 2004 - ke@suse.de
- Fix reported typo in .changes.
* Mon Feb 09 2004 - ke@suse.de
- tdtd-dtd-patch: Fix syntax of the DTD included in the tdtd manual;
reported by Jochen Hayek.
- Use norootforbuild.
* Wed Jun 18 2003 - ke@suse.de
- psgml-xxml-namespace-face.diff: Allow ';' and '.' in element name;
thus face lock can recognize namespace prefixes.
* Thu Apr 24 2003 - ro@suse.de
- fix install_info --delete call and move from preun to postun
* Fri Feb 07 2003 - ke@suse.de
- Use install_info macro [# 23451].
- psgml-1.3.1-texi-category.diff: Use proper Info categories.
* Tue Jan 07 2003 - ke@suse.de
- Update to version 1.3.1:
* XML related enhancements (DTD-less editing),
* Mule related fixes.
* Default to font-lock if available.
* Wed Dec 11 2002 - ke@suse.de
- psgml-1.2.5-key.diff: De-assign keybinding C-c C-c from the
command sgml-show-context to avoid clash with stock sgml-mode;
reported by Martin Vidner [# 18039].
- Add psgml-html.el but don't activate it for now.
- Try to use text properties instead of overlays.
- suse-start-psgml.el: Loading xxml.el depends on suse-psgml-use-xxml.
* Wed Dec 04 2002 - ke@suse.de
- Replace sp/jade (jade_dsl) references with opensp/openjade.
- Supply setting for XML validation.
* Tue Dec 03 2002 - ke@suse.de
- Update the add-on xxml.el; cf. documentation in README.xxml once
installed. The name of some faces changed; adjust your settings in
case of unexpected results.
* Mon Aug 12 2002 - ke@suse.de
- Update to version 1.2.5:
* Fix multibyte handling
* Improve XML support.
- Drop superfluous mule patch.
- Rearrange patches.
* Mon Jul 08 2002 - schwab@suse.de
- Remove global-font-lock-mode from startup file.
* Mon Nov 19 2001 - ke@suse.de
- Update to version 1.2.3:
. Compatible with Emacs 21 (thus drop psgml-emacs-21.diff).
. Code cleanup.
- Cleanup spec file.
* Tue Nov 13 2001 - ke@suse.de
- Use emacs-nox to build the package.
- Make the package 'noarch'.
* Thu Sep 13 2001 - ke@suse.de
- Fix issues reported by Pavel JANIK (thanks) [#10504]:
. Install tdtd-font-maker.elc.
. suse-start-psgml.el: Init tdtd as recommended within the tdtd
package.
. suse-start-psgml.el: Don't set sgml-validate-command to the same
value as done within psgml sources; add a comment how to use
'onsgmls'.
* Mon Aug 27 2001 - ke@suse.de
- Enhance sgml-public-map to make it recognize XML flavored ISO entity
files.
- Rename README.SuSE to psgml-README.SuSE.
* Mon Jul 16 2001 - ke@suse.de
- Update tdtd.zip (0.7.1).
- Apply 'xxml-provide.diff'.
- Add 'ke-docbook.el'; a start to fix [#9243].
- Instead of emacs.dot (was part of 'psgml-1.2.1.dif') use
'suse-start-psgml.el' as a source file.
- Update README.SuSE.
- Fix dangling symlinks [#9391].
* Mon May 28 2001 - ro@suse.de
- added README.SuSE as Source file.
* Fri May 25 2001 - ke@suse.de
- Apply patch from emacs-21.0.104/etc/PROBLEMS.
- Start README.SuSE.
* Tue Mar 13 2001 - ro@suse.de
- added emacs-x11 to neededforbuild.
* Thu Mar 08 2001 - uli@suse.de
- added xf86 to neededforbuild
* Tue Feb 27 2001 - ke@suse.de
- Update to version 1.2.2.
* Mon Dec 18 2000 - ke@suse.de
- Fix a bug (Mule related) to make psgml work with ECAT files again;
use a patch provided by ABE Yasushi
(cf. http://www.geocrawler.com/lists/3/SourceForge/7085/0/4772957/).
- Move ./configure -> %%build.
* Fri Nov 17 2000 - ro@suse.de
- ge_exec -> emacs
* Thu Oct 12 2000 - ke@suse.de
- Fix typo in psgml-1.2.1.dif; now it compiles psgml-xpointer.el, too.
* Fri Sep 29 2000 - ke@suse.de
- Add psgml-xpointer.el.
* Thu Jul 27 2000 - ke@suse.de
- Add xxml.el.
* Mon Feb 28 2000 - kukuk@suse.de
- Move /usr/info -> /usr/share/info
* Mon Jan 10 2000 - ke@suse.de
- Update: version 1.2.1.
- Install /usr/share/emacs/site-lisp/suse-start-psgml.el.
* Mon Sep 13 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Thu Sep 09 1999 - bs@suse.de
- fixed call of Check at the end of %%install section
* Thu Apr 15 1999 - werner@suse.de
- Add export LC_CTYPE=ISO-8859-1 and export EMACS_UNIBYTE=1
to build *and* install section
* Tue Nov 24 1998 - ke@suse.de
- Update: psgml-1.1.6 (alpha!).
* Fri Oct 16 1998 - ke@suse.de
- Update: psgml-1.1.4 (alpha!).
* Sun Aug 09 1998 - ke@suse.de
- Update: psgml-1.1.3 (alpha!).
* Thu Aug 06 1998 - ke@suse.de
- add the tdtd package.
* Mon Jul 27 1998 - bs@suse.de
- added export LC_CTYPE=ISO-8859-1 to build section - emacs needs it.
* Fri Jul 10 1998 - bs@suse.de
- added xaw3d to neededforbuild (ge_exec needs it)
* Sat Feb 28 1998 - ke@suse.de
- update psgml-xml: psgmlxml-19980218.
* Mon Dec 15 1997 - ke@suse.de
- add xml support: patch by David Megginson <dmeggins@sprynet.com>.
- add psgml-dsssl: extension by David Megginson <dmeggins@sprynet.com>.
- add psgml-jade: extension by Matthias Clasen
<mclasen@sun2.mathematik.uni-freiburg.de>.
* Thu Jun 26 1997 - Karl Eichwalder <ke@suse.de>
* initial package: version 1.0.1

0
ready Normal file
View File

117
suse-start-psgml.el Normal file
View File

@ -0,0 +1,117 @@
;; You can use this setup in your ~/.emacs resp. ~/.gnu-emacs file.
(eval-after-load "psgml-parse"
'(modify-syntax-entry ?_ "_" sgml-parser-syntax))
(add-to-list 'load-path "/usr/share/emacs/site-lisp/psgml")
(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t)
(autoload 'sgml-xpointer "psgml-xpointer" nil t)
;; (autoload 'html-mode "xxml" "Major mode to edit HTML files." t)
(defvar suse-psgml-use-xxml t
"*Use xxml for fontification of SGML/XML files.")
(autoload 'ke-docbook-mode "ke-docbook")
(add-hook 'sgml-mode-hook
#'(lambda ()
;; (local-unset-key "\C-c\C-c")
;; (local-unset-key "\C-c\C-t")
;; (define-key sgml-mode-map "\C-c\C-c\C-c" 'sgml-show-context)
;; (define-key sgml-mode-map "\C-c\C-x" 'sgml-show-context)
;; (define-key sgml-mode-map "\C-c\C-c\C-t" 'sgml-list-valid-tags)
;; (modify-face 'highlight "turquoise4" nil nil nil nil nil)
;; (modify-face 'italic "grey60" nil nil nil nil nil)
;; (modify-face 'bold-italic nil "grey80" nil nil nil nil)
(auto-fill-mode t)
(make-variable-buffer-local 'adaptive-fill-regexp)
(setq adaptive-fill-regexp nil)
(make-variable-buffer-local 'fill-column)
(setq fill-column 79)
;; (require 'psgml-jade)
(when suse-psgml-use-xxml
(autoload 'xxml-mode-routine "xxml")
(xxml-mode-routine))))
(add-to-list 'auto-mode-alist '("\\.xml\\'" . xml-mode))
(autoload 'xml-mode "psgml" nil t)
;; (defvar suse-psgml-use-psgml-html nil
;; "*Use psgml-html for editing HTML files.")
;; (when suse-psgml-use-psgml-html
;; (add-to-list 'auto-mode-alist '("\\.s?html?\\'" . html-mode))
;; (autoload 'html-mode "psgml-html" "HTML mode." t))
(setq sgml-xml-declaration "/usr/share/sgml/openjade/xml.dcl")
(setq sgml-xml-validate-command
"SP_CHARSET_FIXED=YES SP_ENCODING=XML onsgmls -wxml -s %s %s"
sgml-validate-command "onsgmls -s %s %s")
;; Lots of overlays in a buffer is bad news since they have to
;; be relocated on changes, with typically quadratic
;; behaviour.
(setq-default sgml-use-text-properties t)
(setq sgml-markup-faces
'((start-tag . font-lock-function-name-face) ;; was 7.2: italic
(end-tag . font-lock-function-name-face) ;; was 7.2: italic
(comment . font-lock-comment-face) ;; comment declaration
;; ignored - ignored marked section
(ms-end . font-lock-constant-face) ;; marked section start, if not ignored
(ms-start . font-lock-constant-face) ;; marked section end, if not ignored
(pi . bold) ;; processing instruction
(sgml . highlight) ;; SGML declaration
(doctype . font-lock-string-face) ;; doctype declaration
(entity . font-lock-reference-face) ;; general entity reference
(shortref . font-lock-builtin-face) ;; short reference; was 7.2:
;; font-lock-function-name-face
))
(setq sgml-set-face t)
(setq sgml-auto-activate-dtd t)
(setq sgml-system-path '("/usr/share/sgml"
;; "/usr/share/sgml/TEI/dtd"
"/usr/share/sgml/ISO_8879:1986")
sgml-public-map '("%S"
"/usr/share/sgml/%o/%c/%d_%v"
"/usr/share/sgml/%S"
"/usr/share/sgml/%o/%c/%d"))
(setq sgml-catalog-files '("CATALOG"
"~/sgml/CATALOG"
"/etc/sgml/catalog"
"/usr/share/sgml/CATALOG")
sgml-ecat-files '("ECAT" "~/sgml/ECAT" "/usr/share/sgml/ECAT"))
(setq sgml-display-char-list-filename
"/usr/share/emacs/site-lisp/psgml/iso88591.map")
;; Use onsgmls from opensp/openjade for validation
;; (setq sgml-validate-command "onsgmls -s %s %s")
;; Init tdtd (copied from the tdtd package and a little bit modified
(autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs." t)
(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))
;; To use resize-minibuffer-mode, uncomment this and include in your .emacs:
;;(resize-minibuffer-mode)
;; suse-start-psgml.el ends here

13
tdtd-dtd-patch Normal file
View File

@ -0,0 +1,13 @@
--- psgml-1.3.1/tutorial.txt.~1~ 1999-03-26 22:22:56.000000000 +0100
+++ psgml-1.3.1/tutorial.txt 2004-02-09 14:10:20.612478058 +0100
@@ -40,7 +40,7 @@
<!ELEMENT para (%paracon;)* >
<!-- List -->
-<!ELEMENT list item+ >
+<!ELEMENT list (item)+ >
<!-- type Specifies the formatting applied to the list
items
id Unique identifier -->
Diff finished at Mon Feb 9 14:16:12

3
tdtd.zip Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1e4a3b499187ef92b186d5cffa161f3377a9ee7bb44f3e9f5eafaa72cf862844
size 37673

15
xxml-indentation.diff Normal file
View File

@ -0,0 +1,15 @@
--- psgml-1.3.1/xxml/xxml.el.~1~ 2005-03-07 11:21:00.640993844 +0100
+++ psgml-1.3.1/xxml/xxml.el 2005-03-07 11:24:18.389474834 +0100
@@ -345,8 +345,8 @@
;; Let us highlight our own way.
(xxml-setq-local font-lock-defaults '(xxml-font-lock-keywords t))
(setq sgml-set-face nil)
- ;; Allow TAB to work everywhere. I'm not fully sure this is a good idea.
- (xxml-setq-local sgml-indent-data t)
+ ;; ;; Allow TAB to work everywhere. I'm not fully sure this is a good idea.
+ ;; (xxml-setq-local sgml-indent-data t)
;; Preset formatting options for no specific DTD.
(xxml-setq-local xxml-all-contents-are-literal t
xxml-all-tags-are-indentable-inside nil
Diff finished. Mon Mar 7 11:24:24 2005

3
xxml.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:73c6a79573ff47ce6373cf6974a313fa1823e2c126bfaccdebfded551bcedded
size 19800