annotate lisp/psgml/psgml.el @ 120:cca96a509cfe r20-1b12

Import from CVS: tag r20-1b12
author cvs
date Mon, 13 Aug 2007 09:25:29 +0200
parents 360340f9fd5f
children 3d6bfa290dbd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; psgml.el --- SGML-editing mode with parsing support
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
2 ;; $Id: psgml.el,v 1.7 1997/04/10 05:55:50 steve Exp $
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4 ;; Copyright (C) 1993, 1994, 1995, 1996 Lennart Staflin
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Copyright (C) 1992 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Author: Lennart Staflin <lenst@lysator.liu.se>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; James Clark <jjc@clark.com>
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
9 ;; Maintainer: Lennart Staflin <lenst@lysator.liu.se>
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
10 ;; Keywords: languages
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; This program is free software; you can redistribute it and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; modify it under the terms of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; as published by the Free Software Foundation; either version 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; of the License, or (at your option) any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; Major mode for editing the SGML document-markup language.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; Send bugs to lenst@lysator.liu.se
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; WHAT IT CAN DO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; - Identify structural errors (but it is not a validator)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; - Menus for inserting tags with only the contextually valid tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; - Edit attribute values in separate window with information about types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; and defaults
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; - Hide attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; - Fold elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; - Indent according to element nesting depth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; - Show context
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; - Structure editing: move and kill by element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; - Find next data context
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; LIMITATIONS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; - only accepts the referece concrete syntax, though it does allow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; unlimited lengths on names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
55 (defconst psgml-version "1.0.1"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "Version of psgml package.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defconst psgml-maintainer-address "lenst@lysator.liu.se")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (require 'cl)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61 (require 'easymenu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defvar sgml-debug nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (defmacro sgml-debug (&rest x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (list 'if 'sgml-debug (cons 'sgml-log-message x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;;;; Variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (defvar sgml-mode-abbrev-table nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 "Abbrev table in use in sgml-mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (define-abbrev-table 'sgml-mode-abbrev-table ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defvar sgml-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (not (not (string-match "Lucid\\|XEmacs" emacs-version))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;;; User settable options:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
80 (defgroup sgml nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
81 "Standard Generalized Markup Language"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
82 :group 'languages)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
83
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
84 (defgroup psgml nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
85 "SGML-editing mode with parsing support"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
86 :prefix "sgml-"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
87 :group 'sgml)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
88
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
89 (defgroup psgml-insert nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
90 "Inserting features of psgml"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
91 :prefix "sgml-"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
92 :group 'psgml)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
93
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
94 (defgroup psgml-dtd nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
95 "DTD, CATALOG and DOCTYPE customizations in psgml"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
96 :prefix "sgml-"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
97 :group 'psgml)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
98
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
99
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
100 (defcustom sgml-insert-missing-element-comment t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 "*If true, and sgml-auto-insert-required-elements also true,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 `sgml-insert-element' will insert a comment if there is an element required
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
103 but there is more than one to choose from."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
104 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
105 :group 'psgml-insert)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
107 (defcustom sgml-insert-end-tag-on-new-line nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 "*If true, `sgml-insert-element' will put the end-tag on a new line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 after the start-tag. Useful on slow terminals if you find the end-tag after
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
110 the cursor irritating."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
111 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
112 :group 'psgml-insert)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defvar sgml-doctype nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "*If set, this should be the name of a file that contains the doctype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 declaration to use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (put 'sgml-doctype 'sgml-type 'string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (make-variable-buffer-local 'sgml-doctype)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
121 (defcustom sgml-system-identifiers-are-preferred nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 "*If nil, PSGML will look up external entities by searching the catalogs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 in `sgml-local-catalogs' and `sgml-catalog-files' and only if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 entity is not found in the catalogs will a given system identifer be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 used. If the variable is non-nil and a system identifer is given, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 system identifier will be used for the entity. If no system identifier
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
127 is given the catalogs will searched."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
128 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
129 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
131 (defcustom sgml-range-indicator-max-length 9
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 "*Maximum number of characters used from the first and last entry
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
133 of a submenu to indicate the range of that menu."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
134 :type 'integer
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
135 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
137 (defcustom sgml-default-doctype-name nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
138 "*Document type name to use if no document type declaration is present."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
139 :type '(choice string (const nil))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
140 :group 'psgml-dtd)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
141
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (put 'sgml-default-doctype-name 'sgml-type 'string-or-nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
144 (defcustom sgml-markup-faces '((start-tag . bold)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (end-tag . bold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (comment . italic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (pi . bold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (sgml . bold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (doctype . bold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (entity . bold-italic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (shortref . bold))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "*List of markup to face mappings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 Element are of the form (MARKUP-TYPE . FACE).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 Possible values for MARKUP-TYPE is:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 comment - comment declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 doctype - doctype declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ignored - ignored marked section
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ms-end - marked section start, if not ignored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ms-start- marked section end, if not ignored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 pi - processing instruction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 sgml - SGML declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 entity - general entity reference
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
165 shortref- short reference"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
166 :type '(repeat (cons symbol face))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
167 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defvar sgml-buggy-subst-char-in-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (or (not (boundp 'emacs-minor-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (not (natnump emacs-minor-version))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (< emacs-minor-version 23))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 "*If non-nil, work around a bug in subst-char-in-region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 The bug sets the buffer modified. If this is set, folding commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 will be slower.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
177 (defcustom sgml-set-face nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
178 "*If non-nil, psgml will set the face of parsed markup."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
179 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
180 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (put 'sgml-set-face 'sgml-desc "Set face of parsed markup")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
183 (defcustom sgml-live-element-indicator nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
184 "*If non-nil, indicate current element in mode line."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
185 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
186 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
188 (defcustom sgml-auto-activate-dtd nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 "*If non-nil, loading a sgml-file will automatically try to activate its DTD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 Activation means either to parse the document type declaration or to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 load a previously saved parsed DTD. The name of the activated DTD
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
192 will be shown in the mode line."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
193 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
194 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (put 'sgml-auto-activate-dtd 'sgml-desc "Auto Activate DTD")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
197 (defcustom sgml-offer-save t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
198 "*If non-nil, ask about saving modified buffers before \\[sgml-validate] is run."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
199 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
200 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defvar sgml-parent-document nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "* Used when the current file is part of a bigger document.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 The variable describes how the current file's content fit into the element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 hierarchy. The variable should have the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (PARENT-FILE CONTEXT-ELEMENT* TOP-ELEMENT (HAS-SEEN-ELEMENT*)?)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 PARENT-FILE is a string, the name of the file contatining the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 document entity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 CONTEXT-ELEMENT is a string, that is the name of an element type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 It can occur 0 or more times and is used to set up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 exceptions and short reference map. Good candidates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 for these elements are the elements open when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 entity pointing to the current file is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 TOP-ELEMENT is a string that is the name of the element type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 of the top level element in the current file. The file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 should contain one instance of this element, unless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 the last \(lisp) element of sgml-parent-document is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 list. If it is a list, the top level of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 should follow the content model of top-element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 HAS-SEEN-ELEMENT is a string that is the name of an element type. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 element is satisfied in the content model of top-element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (make-variable-buffer-local 'sgml-parent-document)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (put 'sgml-parent-document 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
230 (defcustom sgml-tag-region-if-active t ;; wing change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 "*If non-nil, the Tags menu will tag a region if the region is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 considered active by Emacs. If nil, region must be active and
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
233 transient-mark-mode/zmacs-regions must be on for the region to be tagged."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
234 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
235 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (defvar sgml-normalize-trims t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 "*If non-nil, sgml-normalize will trim off white space from end of element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 when adding end tag.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (defvar sgml-omittag t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 "*Set to non-nil, if you use OMITTAG YES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (make-variable-buffer-local 'sgml-omittag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (put 'sgml-omittag 'sgml-desc "OMITTAG")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (defvar sgml-shorttag t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "*Set to non-nil, if you use SHORTTAG YES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (make-variable-buffer-local 'sgml-shorttag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (put 'sgml-shorttag 'sgml-desc "SHORTTAG")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (defvar sgml-minimize-attributes nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 "*Determines minimization of attributes inserted by edit-attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 Actually two things are done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 1. If non-nil, omit attribute name, if attribute value is from a token group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 2. If 'max, omit attributes with default value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (make-variable-buffer-local 'sgml-minimize-attributes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (put 'sgml-minimize-attributes 'sgml-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 '(("No" . nil) ("Yes" . t) ("Max" . max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (defvar sgml-always-quote-attributes t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 "*If non-nil, quote all attribute values inserted after finishing edit attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (make-variable-buffer-local 'sgml-always-quote-attributes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
275 (defcustom sgml-auto-insert-required-elements t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 "*If non-nil, automatically insert required elements in the content
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
277 of an inserted element."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
278 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
279 :group 'psgml-insert)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
281 (defcustom sgml-balanced-tag-edit t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
282 "*If non-nil, always insert start-end tag pairs."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
283 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
284 :group 'psgml-insert)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
286 (defcustom sgml-omittag-transparent (not sgml-balanced-tag-edit) ;; wing change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 "*If non-nil, will show legal tags inside elements with omittable start tags
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
288 and legal tags beyond omittable end tags."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
289 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
290 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
292 (defcustom sgml-leave-point-after-insert nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 "*If non-nil, the point will remain after inserted tag(s).
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
294 If nil, the point will be placed before the inserted tag(s)."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
295 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
296 :group 'psgml-insert)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
298 (defcustom sgml-warn-about-undefined-elements t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
299 "*If non-nil, print a warning when a tag for an undefined element is found."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
300 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
301 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
303 (defcustom sgml-warn-about-undefined-entities t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
304 "*If non-nil, print a warning when an undefined entity is found."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
305 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
306 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
308 (defcustom sgml-ignore-undefined-elements nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 "*If non-nil, recover from an undefined element by ignoring the tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 If nil, recover from an undefined element by assuming it can occur any
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
311 where and has content model ANY."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
312 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
313 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
315 (defcustom sgml-recompile-out-of-date-cdtd 'ask
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 "*If non-nil, out of date compiled DTDs will be automatically recompiled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 If the value is `ask', PSGML will ask before recompiling. A `nil'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 value will cause PSGML to silently load an out of date compiled DTD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 A DTD that referes to undefined external entities is always out of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 date, thus in such case it can be useful to set this variable to
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
321 `nil'."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
322 :type 'symbol
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
323 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (put 'sgml-recompile-out-of-date-cdtd 'sgml-type '(("No" . nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 ("Yes" . t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 ("Ask" . ask)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
328 (defcustom sgml-trace-entity-lookup nil
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
329 "*If non-nil, log messages about catalog files used to look for
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
330 external entities."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
331 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
332 :group 'psgml-dtd)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
333
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (defvar sgml-indent-step 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 "*How much to increment indent for every element level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 If nil, no indentation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (make-variable-buffer-local 'sgml-indent-step)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (put 'sgml-indent-step 'sgml-type '(("None" . nil) 0 1 2 3 4 5 6 7 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (defvar sgml-indent-data nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 "*If non-nil, indent in data/mixed context also.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 Setting this variable automatically makes it local to the current buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (make-variable-buffer-local 'sgml-indent-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
346 ;;; Wing addition
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
347 (defcustom sgml-inhibit-indent-tags nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 "*List of tags within which indentation is inhibited.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
349 The tags should be given as strings."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
350 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
351 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
353 (defcustom sgml-data-directory (expand-file-name "sgml" data-directory)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 "*Directory for pre-supplied data files (DTD's and such).
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
355 Set this before loading psgml."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
356 :type 'directory
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
357 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
359 (defcustom sgml-system-path nil
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
360 ;; wing addition
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 "*List of directories used to look for system identifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 The directory listed in `sgml-data-directory' is always searched in
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
363 addition to the directories listed here."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
364 :type '(repeat directory)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
365 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (put 'sgml-system-path 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (defun sgml-parse-colon-path (cd-path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 "Explode a colon-separated list of paths into a string list."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
370 (let (cd-list (cd-start 0) cd-colon)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (setq cd-path (concat cd-path ":"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (while (setq cd-colon (string-match ":" cd-path cd-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (setq cd-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (nconc cd-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (list (if (= cd-start cd-colon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (substitute-in-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (substring cd-path cd-start cd-colon))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (setq cd-start (+ cd-colon 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 cd-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
382 (defcustom sgml-public-map (sgml-parse-colon-path
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
383 (or (getenv "SGML_PATH")
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
384 ;; Wing change
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
385 (concat "%S:" (directory-file-name
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
386 sgml-data-directory)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
387 "%o/%c/%d")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 "*Mapping from public identifiers to file names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 This is a list of possible file names. To find the file for a public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 identifier the elements of the list are used one at the time from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 beginning. If the element is a string a file name is constructed from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 the string by substitution of the whole public identifier for %P,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 owner for %O, public text class for %C, and public text description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 for %D. The text class will be converted to lower case and the owner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 and description will be transliterated according to the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 sgml-public-transliterations. If the file exists it will be the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 used for the public identifier. An element can also be a dotted pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (regexp . filename), the filename is a string treated as above, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 only if the regular expression, regexp, matches the public
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
401 identifier."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
402 :type '(repeat file)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
403 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (put 'sgml-public-map 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
406 (defcustom sgml-local-catalogs nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 "*A list of SGML entity catalogs to be searched first when parsing the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 This is used in addtion to `sgml-catalog-files', and `sgml-public-map'.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
409 This variable is automatically local to the buffer."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
410 :type '(repeat file)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
411 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (make-variable-buffer-local 'sgml-local-catalogs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (put 'sgml-local-catalogs 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
415 (defcustom sgml-catalog-files (sgml-parse-colon-path
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (or (getenv "SGML_CATALOG_FILES")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
417 ;; Wing addition
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (concat "CATALOG:"
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
419 (expand-file-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
420 "CATALOG"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
421 sgml-data-directory))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 "*List of catalog entry files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 The files are in the format defined in the SGML Open Draft Technical
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
424 Resolution on Entity Management."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
425 :type '(repeat file)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
426 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (put 'sgml-catalog-files 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
429 ;;; Wing addition
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
430 (defcustom sgml-ecat-files (list
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 "ECAT"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 "~/sgml/ECAT"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (expand-file-name "ECAT" sgml-data-directory))
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
434 "*List of catalog files for PSGML."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
435 :type '(repeat file)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
436 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (put 'sgml-ecat-files 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
439 (defcustom sgml-local-ecat-files nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 "*List of local catalog files for PSGML.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
441 Automatically becomes buffer local if set."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
442 :type '(repeat file)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
443 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (make-variable-buffer-local 'sgml-local-ecat-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (put 'sgml-local-ecat-files 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (defvar sgml-public-transliterations '((? . ?_) (?/ . ?%))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 "*Transliteration for characters that should be avoided in file names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 This is a list of dotted pairs (FROM . TO); where FROM is the the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 character to be translated to TO. This is used when parts of a public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 identifier are used to construct a file name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (defvar sgml-default-dtd-file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 "*This is the default file name for saved DTD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 This is set by sgml-mode from the buffer file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 Can be changed in the Local variables section of the file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (put 'sgml-default-dtd-file 'sgml-type 'string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (put 'sgml-default-dtd-file 'sgml-desc "Default (saved) DTD File")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (defvar sgml-exposed-tags '()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 "*The list of tag names that remain visible, despite \\[sgml-hide-tags].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 Each name is a lowercase string, and start-tags and end-tags must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 listed individually.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 `sgml-exposed-tags' is local to each buffer in which it has been set;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 use `setq-default' to set it to a value that is shared among buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (make-variable-buffer-local 'sgml-exposed-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (put 'sgml-exposed-tags 'sgml-type 'list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (defvar sgml-custom-markup nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 "*Menu entries to be added to the Markup menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 The value should be a list of lists of two strings. The first is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 string is the menu line and the second string is the text inserted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 when the menu item is chosen. The second string can contain a \\r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 where the cursor should be left. Also if a selection is made
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 according the same rules as for the Tags menu, the selection is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 replaced with the second string and \\r is replaced with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 Example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 ((\"Version1\" \"<![%Version1[\\r]]>\")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (\"New page\" \"<?NewPage>\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
487 (defcustom sgml-custom-dtd nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 "Menu entries to be added to the DTD menu.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 86
diff changeset
489 The value should be a list of entries to be added to the DTD menu.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 Every entry should be a list. The first element of the entry is a string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 used as the menu entry. The second element is a string containing a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 doctype declaration (this can be nil if no doctype). The rest of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 list should be a list of variables and values. For backward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 compatibility a singel string instead of a variable is assigned to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 sgml-default-dtd-file. All variables are made buffer local and are also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 added to the buffers local variables list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 Example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ((\"HTML\" nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 sgml-default-dtd-file \"~/sgml/html.ced\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 sgml-omittag nil sgml-shorttag nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (\"HTML+\" \"<!doctype htmlplus system 'htmlplus.dtd'>\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 \"~/sgml/htmlplus.ced\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 sgml-omittag t sgml-shorttag nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (\"DOCBOOK\" \"<!doctype docbook system 'docbook.dtd'>\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 \"~/sgml/docbook.ced\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 sgml-omittag nil sgml-shorttag t)))
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
508 "
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
509 :type '(repeat (list (string :tag "Menu Entry")
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
510 (choice (const :tag "No doctype")
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
511 (string :tag "Declaration"))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
512 (repeat :inline t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
513 (list :inline t
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
514 (symbol :tag "Variable")
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
515 (sexp :tag "Value")))))
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
516 :group 'psgml-dtd)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
517
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 ;;; Faces used in edit attribute buffer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (put 'sgml-default 'face 'underline) ; Face for #DEFAULT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (put 'sgml-fixed 'face 'underline) ; Face of #FIXED "..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ;;; sgmls is a free SGML parser available from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 ;;; ftp.uu.net:pub/text-processing/sgml
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ;;; Its error messages can be parsed by next-error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 ;;; The -s option suppresses output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
530 (defcustom sgml-validate-command (concat "nsgmls -s -m "
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
531 sgml-data-directory
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
532 "/CATALOG %s %s")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 "*The shell command to validate an SGML document.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 This is a `format' control string that by default should contain two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 `%s' conversion specifications: the first will be replaced by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 value of `sgml-declaration' \(or the empty string, if nil\); the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 second will be replaced by the current buffer's file name \(or the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 empty string, if nil\).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 If `sgml-validate-files' is non-nil, the format string should contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 one `%s' conversion specification for each element of its result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 If sgml-validate-command is a list, then every element should be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 string. The strings will be tried in order and %-sequences in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 string will be replaced according to the list below, if the string contains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 %-sequences with no replacement value the next string will be tried.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 %b means the visited file of the current buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 %s means the SGML declaration specified in the sgml-declaration variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 %d means the file containing the DOCTYPE declaration, if not in the buffer
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
552 "
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
553 :type 'string
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
554 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (defvar sgml-validate-files nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 "If non-nil, a function of no arguments that returns a list of file names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 These file names will serve as the arguments to the `sgml-validate-command'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 format control string instead of the defaults.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (defvar sgml-validate-error-regexps
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
562 '((":\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[EX]: " 1 2 3)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
563 ("\\(error\\|warning\\) at \\([^,]+\\), line \\([0-9]+\\)" 2 3)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
564 ("\n[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
565 \\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 "Alist of regexps to recognize error messages from `sgml-validate'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 See `compilation-error-regexp-alist'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
569 (defcustom sgml-declaration nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
570 "*If non-nil, this is the name of the SGML declaration file."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
571 :type 'hook
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
572 :group 'psgml-dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (put 'sgml-declaration 'sgml-type 'string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
575 (defcustom sgml-mode-hook nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
576 "A hook or list of hooks to be run when entering sgml-mode"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
577 :type 'hook
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 108
diff changeset
578 :group 'psgml)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (defconst sgml-file-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 sgml-omittag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 sgml-shorttag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 sgml-minimize-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 sgml-always-quote-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 sgml-indent-step
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 sgml-indent-data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 sgml-doctype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 sgml-parent-document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 sgml-default-dtd-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 sgml-exposed-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 sgml-local-catalogs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 sgml-local-ecat-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 "Options for the current file, can be saved or set from menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (defconst sgml-user-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 sgml-set-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 sgml-live-element-indicator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 sgml-auto-activate-dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 sgml-offer-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 sgml-tag-region-if-active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 sgml-normalize-trims
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 sgml-auto-insert-required-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 sgml-balanced-tag-edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 sgml-omittag-transparent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 sgml-leave-point-after-insert
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
610 sgml-insert-missing-element-comment
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
611 sgml-insert-end-tag-on-new-line
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 sgml-warn-about-undefined-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 sgml-warn-about-undefined-entities
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 sgml-ignore-undefined-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 sgml-recompile-out-of-date-cdtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 sgml-default-doctype-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 sgml-declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 sgml-validate-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 sgml-markup-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 sgml-system-identifiers-are-preferred
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
621 sgml-trace-entity-lookup
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 sgml-system-path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 sgml-public-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 sgml-catalog-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 sgml-ecat-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 "User options that can be saved or set from menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 ;;; Internal variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (defvar sgml-validate-command-history nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 "The minibuffer history list for `sgml-validate''s COMMAND argument.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (defvar sgml-mode-map nil "Keymap for SGML mode")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (defvar sgml-active-dtd-indicator nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 "Displayed in the mode line")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 ;;;; User options handling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (defun sgml-variable-description (var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (or (get var 'sgml-desc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (let ((desc (symbol-name var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (if (string= "sgml-" (substring desc 0 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (setq desc (substring desc 5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (loop for c across-ref desc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 do (if (eq c ?-) (setf c ? )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (capitalize desc))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (defun sgml-variable-type (var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (or (get var 'sgml-type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (if (memq (symbol-value var) '(t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 'toggle)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (defun sgml-set-local-variable (var val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 "Set the value of variable VAR to VAL in buffer and local variables list."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (set (make-local-variable var) val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (let ((prefix "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (suffix "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (case-fold-search t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (goto-char (max (point-min) (- (point-max) 3000)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (cond ((search-forward "Local Variables:" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (setq suffix (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (save-excursion (end-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (setq prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (buffer-substring (save-excursion (beginning-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (match-beginning 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (unless (bolp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (insert ?\n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 "<!-- Keep this comment at the end of the file\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 "Local variables:\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 "mode: sgml\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 "End:\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 "-->\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (forward-line -3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (let* ((endpos (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (search-forward (format "\n%send:" prefix))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (varpos (search-forward (format "\n%s%s:" prefix var) endpos t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (cond (varpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (delete-region (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 (save-excursion (end-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (insert (format "%S" val) suffix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (goto-char endpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (beginning-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (insert prefix (format "%s:%S" var val) suffix ?\n)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (defun sgml-valid-option (var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (let ((type (sgml-variable-type var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (val (symbol-value var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (cond ((eq 'string type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (stringp val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 ((eq 'list-or-string type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (or (stringp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (consp val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (defun sgml-save-options ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 "Save user options for sgml-mode that have buffer local values."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
711 (loop for var in sgml-file-options do
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
712 (when (sgml-valid-option var)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
713 (sgml-set-local-variable var (symbol-value var)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 ;;;; Run hook with args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (unless (fboundp 'run-hook-with-args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (defun run-hook-with-args (hook &rest args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 "Run HOOK with the specified arguments ARGS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 HOOK should be a symbol, a hook variable. If HOOK has a non-nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 value, that value may be a function or a list of functions to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 called to run the hook. If the value is a function, it is called with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 the given arguments and its return value is returned. If it is a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 of functions, those functions are called, in order,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 with the given arguments ARGS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 It is best not to depend on the value return by `run-hook-with-args',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 as that may change."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (and (boundp hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (symbol-value hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (let ((value (symbol-value hook)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (if (and (listp value) (not (eq (car value) 'lambda)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (mapcar '(lambda (foo) (apply foo args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (apply value args))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 ;;;; SGML mode: template functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (defun sgml-markup (entry text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (cons entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (` (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (sgml-insert-markup (, text))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (defun sgml-insert-markup (text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (let ((end (sgml-mouse-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 before after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 old-text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (when end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (setq old-text (buffer-substring (point) end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (delete-region (point) end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (setq before (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (if (stringp text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (insert text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (eval text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (setq after (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (goto-char before)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 (when (search-forward "\r" after t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (delete-char -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (when old-text (insert old-text))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (defun sgml-mouse-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (let (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (sgml-running-xemacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 ((null (mark-marker)) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (t (setq start (region-beginning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 end (region-end)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 ((and transient-mark-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 mark-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (setq start (region-beginning)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 ((and mouse-secondary-overlay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (eq (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (overlay-buffer mouse-secondary-overlay)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (setq start (overlay-start mouse-secondary-overlay)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 end (overlay-end mouse-secondary-overlay))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (delete-overlay mouse-secondary-overlay)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (when start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (goto-char start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 ;;;; SGML mode: indentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (defun sgml-indent-or-tab ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 "Indent line in proper way for current major mode."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (if (null sgml-indent-step)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (insert-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (funcall indent-line-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 ;;;; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (autoload 'reporter-submit-bug-report "reporter"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (defun sgml-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 "Submit via mail a bug report on PSGML."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (and (y-or-n-p "Do you really want to submit a report on PSGML? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 psgml-maintainer-address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (concat "psgml.el " psgml-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 'sgml-always-quote-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 'sgml-auto-activate-dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 'sgml-auto-insert-required-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 'sgml-balanced-tag-edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 'sgml-catalog-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 'sgml-declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 'sgml-doctype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 'sgml-ecat-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 'sgml-indent-data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 'sgml-indent-step
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 'sgml-leave-point-after-insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 'sgml-live-element-indicator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 'sgml-local-catalogs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 'sgml-local-ecat-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 'sgml-markup-faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 'sgml-minimize-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 'sgml-normalize-trims
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 'sgml-omittag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 'sgml-omittag-transparent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 'sgml-parent-document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 'sgml-public-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 'sgml-set-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 'sgml-shorttag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 'sgml-tag-region-if-active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 ;;;; SGML mode: keys and menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (if sgml-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (setq sgml-mode-map (make-sparse-keymap)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 ;;; Key commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (define-key sgml-mode-map "\t" 'sgml-indent-or-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 ;(define-key sgml-mode-map "<" 'sgml-insert-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (define-key sgml-mode-map ">" 'sgml-close-angle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (define-key sgml-mode-map "/" 'sgml-slash)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (define-key sgml-mode-map "\C-c#" 'sgml-make-character-reference)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (define-key sgml-mode-map "\C-c-" 'sgml-untag-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (define-key sgml-mode-map "\C-c+" 'sgml-insert-attribute)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (define-key sgml-mode-map "\C-c/" 'sgml-insert-end-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (define-key sgml-mode-map "\C-c<" 'sgml-insert-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (define-key sgml-mode-map "\C-c=" 'sgml-change-element-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 (define-key sgml-mode-map "\C-c\C-a" 'sgml-edit-attributes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (define-key sgml-mode-map "\C-c\C-c" 'sgml-show-context)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (define-key sgml-mode-map "\C-c\C-d" 'sgml-next-data-field)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (define-key sgml-mode-map "\C-c\C-e" 'sgml-insert-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (define-key sgml-mode-map "\C-c\C-k" 'sgml-kill-markup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (define-key sgml-mode-map "\C-c\C-l" 'sgml-show-or-clear-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (define-key sgml-mode-map "\C-c\C-n" 'sgml-up-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (define-key sgml-mode-map "\C-c\C-o" 'sgml-next-trouble-spot)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (define-key sgml-mode-map "\C-c\C-p" 'sgml-parse-prolog)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (define-key sgml-mode-map "\C-c\C-q" 'sgml-fill-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (define-key sgml-mode-map "\C-c\C-r" 'sgml-tag-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (define-key sgml-mode-map "\C-c\C-s" 'sgml-unfold-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (define-key sgml-mode-map "\C-c\C-t" 'sgml-list-valid-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (define-key sgml-mode-map "\C-c\C-v" 'sgml-validate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (define-key sgml-mode-map "\C-c\C-w" 'sgml-what-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (define-key sgml-mode-map "\C-c\C-z" 'sgml-trim-and-leave-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (define-key sgml-mode-map "\C-c\C-f\C-e" 'sgml-fold-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (define-key sgml-mode-map "\C-c\C-f\C-r" 'sgml-fold-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (define-key sgml-mode-map "\C-c\C-f\C-s" 'sgml-fold-subelement)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (define-key sgml-mode-map "\C-c\C-f\C-x" 'sgml-expand-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (define-key sgml-mode-map "\C-c\r" 'sgml-split-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (define-key sgml-mode-map "\C-c\C-u\C-e" 'sgml-unfold-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (define-key sgml-mode-map "\C-c\C-u\C-a" 'sgml-unfold-all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (define-key sgml-mode-map "\C-c\C-u\C-l" 'sgml-unfold-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (define-key sgml-mode-map "\C-c\C-u\C-d" 'sgml-custom-dtd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (define-key sgml-mode-map "\C-c\C-u\C-m" 'sgml-custom-markup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 (define-key sgml-mode-map "\e\C-a" 'sgml-beginning-of-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (define-key sgml-mode-map "\e\C-e" 'sgml-end-of-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (define-key sgml-mode-map "\e\C-f" 'sgml-forward-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (define-key sgml-mode-map "\e\C-b" 'sgml-backward-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (define-key sgml-mode-map "\e\C-d" 'sgml-down-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (define-key sgml-mode-map "\e\C-u" 'sgml-backward-up-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (define-key sgml-mode-map "\e\C-k" 'sgml-kill-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (define-key sgml-mode-map "\e\C-@" 'sgml-mark-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 ;;(define-key sgml-mode-map [?\M-\C-\ ] 'sgml-mark-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (define-key sgml-mode-map "\e\C-h" 'sgml-mark-current-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (define-key sgml-mode-map "\e\C-t" 'sgml-transpose-element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (define-key sgml-mode-map "\M-\t" 'sgml-complete)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
895 ;;;; Menu bar
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
896
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
897 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
898 sgml-dtd-menu sgml-mode-map "DTD menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
899 '("DTD"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
900
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
901 (defconst sgml-dtd-root-menu
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
902 '("DTD"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
903 ["Parse DTD" sgml-parse-prolog t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
904 ("Info"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
905 ["General DTD info" sgml-general-dtd-info t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
906 ["Describe element type" sgml-describe-element-type t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
907 ["Describe entity" sgml-describe-entity t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
908 ["List elements" sgml-list-elements t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
909 ["List attributes" sgml-list-attributes t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
910 ["List terminals" sgml-list-terminals t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
911 ["List content elements" sgml-list-content-elements t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
912 ["List occur in elements" sgml-list-occur-in-elements t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
913 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
914 "--"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
915 ["Load Parsed DTD" sgml-load-dtd t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
916 ["Save Parsed DTD" sgml-save-dtd t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
917 ))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
918
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
919 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
920 sgml-view-menu sgml-mode-map "View menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
921 '("View"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
922 ["Fold Element" sgml-fold-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
923 ["Fold Subelement" sgml-fold-subelement t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
924 ["Unfold Line" sgml-unfold-line t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
925 ["Unfold Element" sgml-unfold-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
926 ["Expand" sgml-expand-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
927 ["Fold Region" sgml-fold-region t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
928 ["Unfold All" sgml-unfold-all t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
929 ["Hide Tags" sgml-hide-tags t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
930 ["Hide Attributes" sgml-hide-attributes t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
931 ["Show All Tags" sgml-show-tags t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
932 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
933 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
934
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
935
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
936 (defconst sgml-markup-root-menu
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
937 '("Markup"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
938 ["Insert Element" sgml-element-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
939 ["Insert Start-Tag" sgml-start-tag-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
940 ["Insert End-Tag" sgml-end-tag-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
941 ["Tag Region" sgml-tag-region-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
942 ["Insert Attribute" sgml-attrib-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
943 ["Insert Entity" sgml-entities-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
944 ))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
945
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
946 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
947 sgml-markup-menu sgml-mode-map "Markup menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
948 sgml-markup-root-menu)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
950 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
951 sgml-move-menu sgml-mode-map "Menu of move commands"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
952 '("Move"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
953 ["Next trouble spot" sgml-next-trouble-spot t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
954 ["Next data field" sgml-next-data-field t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
955 ["Forward element" sgml-forward-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
956 ["Backward element" sgml-backward-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
957 ["Up element" sgml-up-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
958 ["Down element" sgml-down-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
959 ["Backward up element" sgml-backward-up-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
960 ["Beginning of element" sgml-beginning-of-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
961 ["End of element" sgml-end-of-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
962 ))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
963
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
964 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
965 sgml-modify-menu sgml-mode-map "Menu of modification commands"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
966 '("Modify"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
967 ["Normalize" sgml-normalize t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
968 ["Expand All Short References" sgml-expand-all-shortrefs t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
969 ["Expand Entity Reference" sgml-expand-entity-reference t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
970 ["Normalize Element" sgml-normalize-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
971 ["Make Character Reference" sgml-make-character-reference t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
972 ["Unmake Character Reference" (sgml-make-character-reference t) t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
973 ["Fill Element" sgml-fill-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
974 ["Change Element Name..." sgml-change-element-name t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
975 ["Edit Attributes..." sgml-edit-attributes t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
976 ["Kill Markup" sgml-kill-markup t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
977 ["Kill Element" sgml-kill-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
978 ["Untag Element" sgml-untag-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
979 ["Trim and leave element" sgml-trim-and-leave-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
980 ["Decode Character Entities" sgml-charent-to-display-char t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
981 ["Encode Characters" sgml-display-char-to-charent t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
982 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
983 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
985 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
986 sgml-main-menu sgml-mode-map "Main menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
987 '("SGML"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
988 ["Reset Buffer" normal-mode t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
989 ["End Element" sgml-insert-end-tag t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
990 ["Show Context" sgml-show-context t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
991 ["What Element" sgml-what-element t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
992 ["List Valid Tags" sgml-list-valid-tags t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
993 ["Show/Hide Warning Log" sgml-show-or-clear-log t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
994 ["Validate" sgml-validate t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
995 ["File Options >" sgml-file-options-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
996 ["User Options >" sgml-user-options-menu t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
997 ["Save File Options" sgml-save-options t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
998 ["Submit Bug Report" sgml-submit-bug-report t]
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
999 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1000 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1001
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1002
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1003 (defun sgml-build-custom-menus ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1004 "Build custom parts of Markup and DTD menus."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1005 (let ((button3 (lookup-key (current-local-map) [button3])))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1006 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1007 sgml-markup-menu sgml-mode-map "Markup menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1008 (append sgml-markup-root-menu
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1009 (list "----")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1010 (loop for e in sgml-custom-markup collect
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1011 (vector (first e)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1012 (` (sgml-insert-markup (, (cadr e))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1013 t))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1014 (easy-menu-define
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1015 sgml-dtd-menu sgml-mode-map "DTD menu"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1016 (append sgml-dtd-root-menu
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1017 (list "----")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1018 (loop for e in sgml-custom-dtd collect
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1019 (vector (first e)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1020 (` (sgml-doctype-insert (, (cadr e))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1021 '(, (cddr e))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1022 t))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1023 (unless (or (null button3)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1024 (numberp button3))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1025 (local-set-key [button3] button3))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1026
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 ;;;; Post command hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (defvar sgml-auto-activate-dtd-tried nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (make-variable-buffer-local 'sgml-auto-activate-dtd-tried)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (defvar sgml-buffer-parse-state nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 "If the buffers DTD has been activated this contains the parser state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 The parser state has been created with `sgml-make-pstate' and contains
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 the information about the DTD and the parse tree. This parse state is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 actually only the state that persists between commands.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (make-variable-buffer-local 'sgml-buffer-parse-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (eval-and-compile ; Interface to psgml-parse
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1041 (loop for fun in '(sgml-need-dtd sgml-update-display
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1042 sgml-fontify-buffer
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1043 sgml-subst-expand
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 sgml-declaration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 do (autoload fun "psgml-parse")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 (defun sgml-command-post ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (when (eq major-mode 'sgml-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 (when (and (null sgml-buffer-parse-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 sgml-auto-activate-dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (null sgml-auto-activate-dtd-tried)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (not (zerop (buffer-size)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (looking-at ".*<"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (setq sgml-auto-activate-dtd-tried t)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1056 (sgml-need-dtd)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1057 (sgml-fontify-buffer 0))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (when sgml-buffer-parse-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (sgml-update-display))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 ;;;; SGML mode: major mode definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 ;;; This section is mostly from sgml-mode by James Clark.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (defun sgml-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 "Major mode for editing SGML.\\<sgml-mode-map>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 Makes > display the matching <. Makes / display matching /.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 Use \\[sgml-validate] to validate your document with an SGML parser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 You can find information with:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 \\[sgml-show-context] Show the nesting of elements at cursor position.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 \\[sgml-list-valid-tags] Show the tags valid at cursor position.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 Insert tags with completion of contextually valid tags with \\[sgml-insert-tag].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 End the current element with \\[sgml-insert-end-tag]. Insert an element (i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 both start and end tag) with \\[sgml-insert-element]. Or tag a region with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 \\[sgml-tag-region].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 To tag a region with the mouse, use transient mark mode or secondary selection.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 Structure editing:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 \\[sgml-backward-element] Moves backwards over the previous element.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 86
diff changeset
1085 \\[sgml-forward-element] Moves forward over the next element.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 \\[sgml-down-element] Move forward and down one level in the element structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 \\[sgml-backward-up-element] Move backward out of this element level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 \\[sgml-beginning-of-element] Move to after the start tag of the current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 \\[sgml-end-of-element] Move to before the end tag of the current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 \\[sgml-kill-element] Kill the element following the cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 Finding interesting positions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 \\[sgml-next-data-field] Move forward to next point where data is allowed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 \\[sgml-next-trouble-spot] Move forward to next point where something is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 amiss with the structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 Folding and unfolding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 \\[sgml-fold-element] Fold the lines comprising the current element, leaving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 the first line visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 \\[sgml-fold-subelement] Fold the elements in the content of the current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 Leaving the first line of every element visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 \\[sgml-unfold-line] Show hidden lines in current line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 User options:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 sgml-omittag Set this to reflect OMITTAG in the SGML declaration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 sgml-shortag Set this to reflect SHORTTAG in the SGML declaration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 sgml-auto-insert-required-elements If non-nil, automatically insert required
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 elements in the content of an inserted element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 sgml-balanced-tag-edit If non-nil, always insert start-end tag pairs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 sgml-omittag-transparent If non-nil, will show legal tags inside elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 with omitable start tags and legal tags beyond omitable end tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 sgml-leave-point-after-insert If non-nil, the point will remain after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 inserted tag(s).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 sgml-warn-about-undefined-elements If non-nil, print a warning when a tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 for a undefined element is found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 sgml-max-menu-size Max number of entries in Tags and Entities menus before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 they are split into several panes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 sgml-always-quote-attributes If non-nil, quote all attribute values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 inserted after finishing edit attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 sgml-minimize-attributes Determines minimization of attributes inserted by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 edit-attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 sgml-normalize-trims If non-nil, sgml-normalize will trim off white space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 from end of element when adding end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 sgml-indent-step How much to increament indent for every element level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 sgml-indent-data If non-nil, indent in data/mixed context also.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 sgml-set-face If non-nil, psgml will set the face of parsed markup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 sgml-markup-faces The faces used when the above variable is non-nil.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 86
diff changeset
1129 sgml-system-path List of directories used to look for system identifiers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 sgml-public-map Mapping from public identifiers to file names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 sgml-offer-save If non-nil, ask about saving modified buffers before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 \\[sgml-validate] is run.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 All bindings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 \\{sgml-mode-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 (setq local-abbrev-table sgml-mode-abbrev-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 (use-local-map sgml-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (setq mode-name "SGML")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (setq major-mode 'sgml-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 ;; A start or end tag by itself on a line separates a paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 ;; This is desirable because SGML discards a newline that appears
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 ;; immediately after a start tag or immediately before an end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (set (make-local-variable 'paragraph-separate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 "^[ \t\n]*$\\|\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 ^[ \t]*</?\\([A-Za-z]\\([-.A-Za-z0-9= \t\n]\\|\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 \"[^\"]*\"\\|'[^']*'\\)*\\)?>$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 (set (make-local-variable 'paragraph-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 paragraph-separate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 (set-syntax-table text-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (make-local-variable 'comment-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (setq comment-start "<!-- ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (make-local-variable 'comment-end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (setq comment-end " -->")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (make-local-variable 'comment-indent-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (setq comment-indent-function 'sgml-comment-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (make-local-variable 'comment-start-skip)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 ;; This will allow existing comments within declarations to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 ;; recognized. [Does not work well with auto-fill, Lst/940205]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 ;;(setq comment-start-skip "--[ \t]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 (setq comment-start-skip "<!--[ \t]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 ;; Added for psgml:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (make-local-variable 'indent-line-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 (setq indent-line-function 'sgml-indent-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (make-local-variable 'mode-line-format)
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
1171 ;; Modify mode-line-format with susbt (sugested by wing)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (setq mode-line-format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (subst '("" mode-name sgml-active-dtd-indicator) 'mode-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 mode-line-format))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (make-local-variable 'sgml-default-dtd-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (when (setq sgml-default-dtd-file (sgml-default-dtd-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (unless (file-exists-p sgml-default-dtd-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (setq sgml-default-dtd-file nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (add-hook 'post-command-hook 'sgml-command-post 'append)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (run-hooks 'text-mode-hook 'sgml-mode-hook)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1181 (sgml-build-custom-menus)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1182 (easy-menu-add sgml-main-menu)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1183 (easy-menu-add sgml-modify-menu)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1184 (easy-menu-add sgml-move-menu)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1185 (easy-menu-add sgml-markup-menu)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1186 (easy-menu-add sgml-view-menu)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1187 (easy-menu-add sgml-dtd-menu))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (defun sgml-default-dtd-file ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 (and (buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (let ((base (file-name-nondirectory (buffer-file-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (cond ((string-match "\\.[^.]+$" base)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (substring base 0 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 base))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 ".ced"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (defun sgml-comment-indent ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (if (and (looking-at "--")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (not (and (eq (char-after (1- (point))) ?!)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (eq (char-after (- (point) 2)) ?<))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (skip-chars-backward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (max comment-column (1+ (current-column))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (defconst sgml-start-tag-regex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 "<[A-Za-z]\\([-.A-Za-z0-9= \n\t]\\|\"[^\"]*\"\\|'[^']*'\\)*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 "Regular expression that matches a non-empty start tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 Any terminating > or / is not matched.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 (defvar sgml-mode-markup-syntax-table nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 "Syntax table used for scanning SGML markup.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 (if sgml-mode-markup-syntax-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (setq sgml-mode-markup-syntax-table (make-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 (modify-syntax-entry ?< "(>" sgml-mode-markup-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 (modify-syntax-entry ?> ")<" sgml-mode-markup-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (modify-syntax-entry ?- "_ 1234" sgml-mode-markup-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (modify-syntax-entry ?\' "\"" sgml-mode-markup-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 (defconst sgml-angle-distance 4000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 "*If non-nil, is the maximum distance to search for matching <.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 (defun sgml-close-angle (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 "Insert > and display matching <."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 (insert-char ?> arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (if (> arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 (let ((oldpos (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (blinkpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (if sgml-angle-distance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 (narrow-to-region (max (point-min)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (- (point) sgml-angle-distance))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 oldpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 ;; See if it's the end of a marked section.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 (and (> (- (point) (point-min)) 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (eq (char-after (- (point) 2)) ?\])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (eq (char-after (- (point) 3)) ?\])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 (re-search-backward "<!\\[\\(-?[A-Za-z0-9. \t\n&;]\\|\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 --\\([^-]\\|-[^-]\\)*--\\)*\\["
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (point-min)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 (let ((msspos (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (if (and (search-forward "]]>" oldpos t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 (eq (point) oldpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 (setq blinkpos msspos))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 ;; This handles cases where the > ends one of the following:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 ;; markup declaration starting with <! (possibly including a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 ;; declaration subset); start tag; end tag; SGML declaration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 (if blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 (goto-char oldpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (let ((oldtable (syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (parse-sexp-ignore-comments t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (set-syntax-table sgml-mode-markup-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 (setq blinkpos (scan-sexps oldpos -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 (set-syntax-table oldtable)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 (and blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 (goto-char blinkpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 ;; Check that it's a valid delimiter in context.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (not (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 "<\\(\\?\\|/?[A-Za-z>]\\|!\\([[A-Za-z]\\|--\\)\\)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 ;; Check that it's not a net-enabling start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 ;; nor an unclosed start-tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (looking-at (concat sgml-start-tag-regex "[/<]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 ;; Nor an unclosed end-tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 (looking-at "</[A-Za-z][-.A-Za-z0-9]*[ \t]*<"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (setq blinkpos nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (if blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 ;; See if it's the end of a processing instruction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 (goto-char oldpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 (if (search-backward "<?" (point-min) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (let ((pipos (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (if (and (search-forward ">" oldpos t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (eq (point) oldpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 (setq blinkpos pipos))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 (if blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 (goto-char blinkpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 (if (pos-visible-in-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (sit-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 (message "Matches %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 (buffer-substring blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (progn (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (point)))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 ;;; I doubt that null end tags are used much for large elements,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 ;;; so use a small distance here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (defconst sgml-slash-distance 1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 "*If non-nil, is the maximum distance to search for matching /.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (defun sgml-slash (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 "Insert / and display any previous matching /.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 Two /s are treated as matching if the first / ends a net-enabling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 start tag, and the second / is the corresponding null end tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (insert-char ?/ arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (if (> arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (let ((oldpos (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (blinkpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (level 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (if sgml-slash-distance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (narrow-to-region (max (point-min)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 (- (point) sgml-slash-distance))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 oldpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (if (and (re-search-backward sgml-start-tag-regex (point-min) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 (eq (match-end 0) (1- oldpos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (goto-char (1- oldpos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (while (and (not blinkpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 (search-backward "/" (point-min) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 (let ((tagend (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 (if (re-search-backward sgml-start-tag-regex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 (point-min) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (if (eq tagend (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 (if (eq level 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (setq blinkpos (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 (setq level (1- level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (setq level (1+ level)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 (if blinkpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 (goto-char blinkpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (if (pos-visible-in-window-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (sit-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 (message "Matches %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (buffer-substring (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 (1+ blinkpos))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 (autoload 'compile-internal "compile" ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (defun sgml-default-validate-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 ((consp sgml-validate-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 (let ((validate-subst
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 (cons ?b (and (buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 (file-name-nondirectory (buffer-file-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 (cons ?s (sgml-declaration))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (cons ?v sgml-declaration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (cons ?d sgml-doctype))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 (loop for template in sgml-validate-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 thereis
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (sgml-subst-expand template validate-subst))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (apply 'format sgml-validate-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (if sgml-validate-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (funcall sgml-validate-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (list (or sgml-declaration "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (let ((name (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 (if name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (file-name-nondirectory name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 ""))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (defun sgml-validate (command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 "Validate an SGML document.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 Runs COMMAND, a shell command, in a separate process asynchronously
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 with output going to the buffer *compilation*.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 You can then use the command \\[next-error] to find the next error message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 and move to the line in the SGML document that caused it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (list (read-from-minibuffer "Validate command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (sgml-default-validate-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 nil nil 'sgml-validate-command-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (if sgml-offer-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (save-some-buffers nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (compile-internal command "No more errors" "SGML validation"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 sgml-validate-error-regexps))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 ;;;; Autoloads and hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (autoload 'sgml-doctype-insert "psgml-edit"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (autoload 'sgml-indent-line "psgml-edit" nil)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1396 (autoload 'sgml-element-endable-p "psgml-edit" nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 ;;; Generated by sgml-build-autoloads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 (autoload 'sgml-load-dtd "psgml-parse" "Load a saved DTD from FILE." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (autoload 'sgml-show-or-clear-log "psgml-parse" "Show the *SGML LOG* buffer if it is not showing, or clear and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 remove it if it is showing." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (autoload 'sgml-parse-prolog "psgml-parse" "Parse the document prolog to learn the DTD." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (autoload 'sgml-beginning-of-element "psgml-edit" "Move to after the start-tag of the current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 If the start-tag is implied, move to the start of the element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (autoload 'sgml-end-of-element "psgml-edit" "Move to before the end-tag of the current element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 (autoload 'sgml-backward-up-element "psgml-edit" "Move backward out of this element level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 That is move to before the start-tag or where a start-tag is implied." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (autoload 'sgml-up-element "psgml-edit" "Move forward out of this element level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 That is move to after the end-tag or where an end-tag is implied." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (autoload 'sgml-forward-element "psgml-edit" "Move forward over next element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 (autoload 'sgml-backward-element "psgml-edit" "Move backward over previous element at this level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 With implied tags this is ambigous." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (autoload 'sgml-down-element "psgml-edit" "Move forward and down one level in the element structure." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 (autoload 'sgml-kill-element "psgml-edit" "Kill the element following the cursor." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 (autoload 'sgml-transpose-element "psgml-edit" "Interchange element before point with element after point, leave point after." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (autoload 'sgml-mark-element "psgml-edit" "Set mark after next element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (autoload 'sgml-mark-current-element "psgml-edit" "Set mark at end of current element, and leave point before current element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (autoload 'sgml-change-element-name "psgml-edit" "Replace the name of the current element with a new name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 Eventual attributes of the current element will be translated if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 possible." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (autoload 'sgml-untag-element "psgml-edit" "Remove tags from current element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (autoload 'sgml-kill-markup "psgml-edit" "Kill next tag, markup declaration or process instruction." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (autoload 'sgml-fold-region "psgml-edit" "Hide (or if prefixarg unhide) region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 If called from a program first two arguments are start and end of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 region. And optional third argument true unhides." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (autoload 'sgml-fold-element "psgml-edit" "Fold the lines comprising the current element, leaving the first line visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 This uses the selective display feature." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 (autoload 'sgml-fold-subelement "psgml-edit" "Fold all elements current elements content, leaving the first lines visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 This uses the selective display feature." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 (autoload 'sgml-unfold-line "psgml-edit" "Show hidden lines in current line." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (autoload 'sgml-unfold-element "psgml-edit" "Show all hidden lines in current element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (autoload 'sgml-expand-element "psgml-edit" "As sgml-fold-subelement, but unfold first." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 (autoload 'sgml-unfold-all "psgml-edit" "Show all hidden lines in buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 (autoload 'sgml-next-data-field "psgml-edit" "Move forward to next point where data is allowed." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 (autoload 'sgml-next-trouble-spot "psgml-edit" "Move forward to next point where something is amiss with the structure." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 (autoload 'sgml-list-valid-tags "psgml-edit" "Display a list of the contextually valid tags." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 (autoload 'sgml-show-context "psgml-edit" "Display where the cursor is in the element hierarchy." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (autoload 'sgml-what-element "psgml-edit" "Display what element is under the cursor." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 (autoload 'sgml-insert-tag "psgml-edit" "Insert a tag, reading tag name in minibuffer with completion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 If the variable sgml-balanced-tag-edit is t, also inserts the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 corresponding end tag. If sgml-leave-point-after-insert is t, the point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 is left after the inserted tag(s), unless the element has som required
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 content. If sgml-leave-point-after-insert is nil the point is left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 after the first tag inserted." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (autoload 'sgml-insert-element "psgml-edit" "Reads element name from minibuffer and inserts start and end tags." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 (autoload 'sgml-tag-region "psgml-edit" "Reads element name from minibuffer and inserts start and end tags." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 (autoload 'sgml-insert-end-tag "psgml-edit" "Insert end-tag for the current open element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 (autoload 'sgml-insert-attribute "psgml-edit" "Read attribute name and value from minibuffer and insert attribute spec." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 (autoload 'sgml-split-element "psgml-edit" "Split the current element at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 If repeated, the containing element will be split before the beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 of then current element." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (autoload 'sgml-custom-dtd "psgml-edit" "Insert a DTD declaration from the sgml-custom-dtd alist." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 (autoload 'sgml-custom-markup "psgml-edit" "Insert markup from the sgml-custom-markup alist." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (autoload 'sgml-tags-menu "psgml-edit" "Pop up a menu with valid tags and insert the choosen tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 If the variable sgml-balanced-tag-edit is t, also inserts the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 corresponding end tag. If sgml-leave-point-after-insert is t, the point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 is left after the inserted tag(s), unless the element has som required
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 content. If sgml-leave-point-after-insert is nil the point is left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 after the first tag inserted." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (autoload 'sgml-element-menu "psgml-edit" "Pop up a menu with valid elements and insert choice.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 If sgml-leave-point-after-insert is nil the point is left after the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 tag inserted." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 (autoload 'sgml-start-tag-menu "psgml-edit" "Pop up a menu with valid start-tags and insert choice." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 (autoload 'sgml-end-tag-menu "psgml-edit" "Pop up a menu with valid end-tags and insert choice." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 (autoload 'sgml-tag-region-menu "psgml-edit" "Pop up a menu with valid elements and tag current region with the choice." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 (autoload 'sgml-entities-menu "psgml-edit" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 (autoload 'sgml-attrib-menu "psgml-edit" "Pop up a menu of the attributes of the current element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 \(or the element whith start-tag before point)." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (autoload 'sgml-fill-element "psgml-edit" "Fill bigest enclosing element with mixed content.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 If current element has pure element content, recursively fill the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 subelements." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 (autoload 'sgml-edit-attributes "psgml-edit" "Edit attributes of current element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 Editing is done in a separate window." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 (autoload 'sgml-edit-attrib-finish "psgml-edit" "Finish editing and insert attribute values in original buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (autoload 'sgml-edit-attrib-default "psgml-edit" "Set current attribute value to default." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (autoload 'sgml-edit-attrib-clear "psgml-edit" "Kill the value of current attribute." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (autoload 'sgml-edit-attrib-field-start "psgml-edit" "Go to the start of the attribute value field." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (autoload 'sgml-edit-attrib-field-end "psgml-edit" "Go to the end of the attribute value field." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 (autoload 'sgml-edit-attrib-next "psgml-edit" "Move to next attribute value." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 (autoload 'sgml-hide-tags "psgml-edit" "Hide all tags in buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (autoload 'sgml-show-tags "psgml-edit" "Show hidden tags in buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 (autoload 'sgml-hide-attributes "psgml-edit" "Hide all attribute specifications in the buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 (autoload 'sgml-show-attributes "psgml-edit" "Show all attribute specifications in the buffer." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 (autoload 'sgml-expand-all-shortrefs "psgml-edit" "Expand all short references in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 Short references to text entities are expanded to the replacement text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 of the entity other short references are expanded into general entity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 references. If argument, TO-ENTITY, is non-nil, or if called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 interactive with numeric prefix argument, all short references are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 replaced by generaly entity references." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (autoload 'sgml-normalize "psgml-edit" "Normalize buffer by filling in omitted tags and expanding empty tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 Argument TO-ENTITY controls how short references are expanded as with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 `sgml-expand-all-shortrefs'. An optional argument ELEMENT can be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 element to normalize insted of the whole buffer, if used no short
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 references will be expanded." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (autoload 'sgml-normalize-element "psgml-edit" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (autoload 'sgml-make-character-reference "psgml-edit" "Convert character after point into a character reference.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 If called with a numeric argument, convert a character reference back
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 to a normal character. If called from a program, set optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 argument INVERT to non-nil." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 (autoload 'sgml-expand-entity-reference "psgml-edit" "Insert the text of the entity referenced at point." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (autoload 'sgml-complete "psgml-edit" "Complete the word/tag/entity before point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 If it is a tag (starts with < or </) complete with valid tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 If it is an entity (starts with &) complete with declared entities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 If it is a markup declaration (starts with <!) complete with markup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 declaration names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 If it is something else complete with ispell-complete-word." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 (autoload 'sgml-file-options-menu "psgml-edit" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (autoload 'sgml-user-options-menu "psgml-edit" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (autoload 'sgml-save-dtd "psgml-dtd" "Save the parsed dtd on FILE." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (autoload 'sgml-list-elements "psgml-info" "List the elements and their attributes in the current DTD." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 (autoload 'sgml-list-attributes "psgml-info" "List the attributes and in which elements they occur." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 (autoload 'sgml-list-terminals "psgml-info" "List the elements that can have data in their content." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (autoload 'sgml-list-content-elements "psgml-info" "List all element types and the element types that can occur in its content." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (autoload 'sgml-list-occur-in-elements "psgml-info" "List all element types and where it can occur." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (autoload 'sgml-describe-entity "psgml-info" "Describe the properties of an entity as declared in the current DTD." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 (autoload 'sgml-describe-element-type "psgml-info" "Describe the properties of an element type as declared in the current DTD." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (autoload 'sgml-general-dtd-info "psgml-info" "Display information about the current DTD." t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (autoload 'sgml-charent-to-display-char "psgml-charent" "Replace character entities with their display character equivalents" t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 (autoload 'sgml-display-char-to-charent "psgml-charent" "Replace displayable characters with their character entity equivalents" t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 ;;;; Last provisions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (provide 'psgml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 (provide 'sgml-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 (sgml-running-xemacs
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1529 (require 'psgml-xemacs))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (require 'psgml-other)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
1533 ;;; psgml.el ends here