diff options
Diffstat (limited to 'lisp/nxml')
-rw-r--r-- | lisp/nxml/TODO | 468 | ||||
-rw-r--r-- | lisp/nxml/nxml-maint.el | 3 | ||||
-rw-r--r-- | lisp/nxml/nxml-mode.el | 112 | ||||
-rw-r--r-- | lisp/nxml/nxml-outln.el | 7 | ||||
-rw-r--r-- | lisp/nxml/rng-loc.el | 3 | ||||
-rw-r--r-- | lisp/nxml/rng-nxml.el | 5 | ||||
-rw-r--r-- | lisp/nxml/rng-valid.el | 12 |
7 files changed, 87 insertions, 523 deletions
diff --git a/lisp/nxml/TODO b/lisp/nxml/TODO deleted file mode 100644 index a5ac542f942..00000000000 --- a/lisp/nxml/TODO +++ /dev/null @@ -1,468 +0,0 @@ -* High priority - -** Command to insert an element template, including all required -attributes and child elements. When there's a choice of elements -possible, we could insert a comment, and put an overlay on that -comment that makes it behave like a button with a pop-up menu to -select the appropriate choice. - -** Command to tag a region. With a schema should complete using legal -tags, but should work without a schema as well. - -** Provide a way to conveniently rename an element. With a schema should -complete using legal tags, but should work without a schema as well. - -* Outlining - -** Implement C-c C-o C-q. - -** Install pre/post command hook for moving out of invisible section. - -** Put a modify hook on invisible sections that expands them. - -** Integrate dumb folding somehow. - -** An element should be able to be its own heading. - -** Optimize to avoid complete buffer scan on each command. - -** Make it work with HTML-style headings (i.e. level indicated by -name of heading element rather than depth of section nesting). - -** Recognize root element as a section provided it has a title, even -if it doesn't match section-element-name-regex. - -** Support for incremental search automatically making hidden text -visible. - -** Allow title to be an attribute. - -** Command that says to recognize the tag at point as a section/heading. - -** Explore better ways to determine when an element is a section -or a heading. - -** rng-next-error needs to either ignore invisible portion or reveal it -(maybe use isearch oriented text properties). - -** Errors within hidden section should be highlighted by underlining the -ellipsis. - -** Make indirect buffers work. - -** How should nxml-refresh outline recover from non well-formed tags? - -** Hide tags in title elements? - -** Use overlays instead of text properties for holding outline state? -Necessary for indirect buffers to work? - -** Allow an outline to go in the speedbar. - -** Split up outlining manual section into subsections. - -** More detail in the manual about each outlining command. - -** More menu entries for hiding/showing? - -** Indication of many lines have been hidden? - -* Locating schemas - -** Should rng-validate-mode give the user an opportunity to specify a -schema if there is currently none? Or should it at least give a hint -to the user how to specify a non-vacuous schema? - -** Support for adding new schemas to schema-locating files. Add -documentElement and namespace elements. - -** C-c C-w should be able to report current type id. - -** Implement doctypePublicId. - -** Implement typeIdBase. - -** Implement typeIdProcessingInstruction. - -** Support xml:base. - -** Implement group. - -** Find preferred prefix from schema-locating files. Get rid of -rng-preferred-prefix-alist. - -** Inserting document element with vacuous schema should complete using -document elements declared in schema locating files, and set schema -appropriately. - -** Add a ruleType attribute to the <include> element? - -** Allow processing instruction in prolog to contain the compact syntax -schema directly. - -** Use RDDL to locate a schema based on the namespace URI. - -** Should not prompt to add redundant association to schema locating -file. - -** Command to reload current schema. - -* Schema-sensitive features - -** Should filter dynamic markup possibilities using schema validity, by -adding hook to nxml-mode. - -** Dynamic markup word should (at least optionally) be able to look in -other buffers that are using nxml-mode. - -** Should clicking on Invalid move to next error if already on an error? - -** Take advantage of a:documentation. Needs change to schema format. - -** Provide feasible validation (as in Jing) toggle. - -** Save the validation state as a property on the error overlay to enable -more detailed diagnosis. - -** Provide an Error Summary buffer showing all the validation errors. - -** Pop-up menu. What is useful? Tag a region (should be greyed out if -the region is not balanced). Suggestions based on error messages. - -** Have configurable list of namespace URIs so that we can provide -namespace URI completion on extension elements or with schema-less -documents. - -** Allow validation to handle XInclude. - -** ID/IDREF support. - -* Completion - -** Make it work with icomplete. Only use a function to complete when -some of the possible names have undeclared namespaces. - -** How should C-return in mixed text work? - -** When there's a vacuous schema, C-return after < will insert the -end-tag. Is this a bug or a feature? - -** After completing start-tag, ensure we don't get unhelpful message -from validation - -** Syntax table for completion. - -** Should complete start-tag name with a space if namespace attributes -are required. - -** When completing start-tag name with no prefix and it doesn't match -should try to infer namespace from local name. - -** Should completion pay attention to characters after point? If so, -how? - -** When completing start-tag name, add required atts if only one required -attribute. - -** When completing attribute name, add attribute value if only one value -is possible. - -** After attribute-value completion, insert space after close delimiter -if more attributes are required. - -** Complete on enumerated data values in elements. - -** When in context that allows only elements, should get tag -completion without having to type < first. - -** When immediately after start-tag name, and name is valid and not -prefix of any other name, should C-return complete on attribute names? - -** When completing attributes, more consistent to ignore all attributes -after point. - -** Inserting attribute value completions needs to be sensitive to what -delimiter is used so that it quotes the correct character. - -** Complete on encoding-names in XML decl. - -** Complete namespace declarations by searching for all namespaces -mentioned in the schema. - -* Well-formed XML support - -** Deal better with Mule-UCS - -** Deal with UTF-8 BOM when reading. - -** Complete entity names. - -** Provide some support for entity names for MathML. - -** Command to repeat the last tag. - -** Support for changing between character references and characters. -Need to check that context is one in which character references are -allowed. xmltok prolog parsing will need to distinguish parameter -literals from other kinds of literal. - -** Provide a comment command to bind to M-; that works better than the -normal one. - -** Make indenting in a multi-line comment work. - -** Structure view. Separate buffer displaying element tree. Be able to -navigate from structure view to document and vice-versa. - -** Flash matching >. - -** Smart selection command that selects increasingly large syntactically -coherent chunks of XML. If point is in an attribute value, first -select complete value; then if command is repeated, select value plus -delimiters, then select attribute name as well, then complete -start-tag, then complete element, then enclosing element, etc. - -** ispell integration. - -** Block-level items in mixed content should be indented, e.g: - <para>This is list: - <ul> - <li>item</li> - -** Provide option to indent like this: - -** <para>This is a paragraph - occupying multiple lines.</para> - -** Option to add make a / that closes a start-tag electrically insert a -space for the XHTML guys. - -** C-M-q should work. - -* Datatypes - -** Figure out workaround for CJK characters with regexps. - -** Does category C contain Cn? - -** Do ENTITY datatype properly. - -* XML Parsing Library - -** Parameter entity parsing option, nil (never), t (always), -unless-standalone (unless standalone="yes" in XML declaration). - -** When a file is currently being edited, there should be an option to -use its buffer instead of the on-disk copy. - -* Handling all XML features - -** Provide better support for editing external general parsed entities. -Perhaps provide a way to force ignoring undefined entities; maybe turn -this on automatically with <?xml encoding=""?> (with no version -pseudo-att). - -** Handle internal general entity declarations containing elements. - -** Handle external general entity declarations. - -** Handle default attribute declarations in internal subset. - -** Handle parameter entities (including DTD). - -* RELAX NG - -** Do complete schema checking, at least optionally. - -** Detect include/external loops during schema parse. - -** Coding system detection for schemas. Should use utf-8/utf-16 per the -spec. But also need to allow encodings other than UTF-8/16 to support -CJK charsets that Emacs cannot represent in Unicode. - -* Catching XML errors - -** Check public identifiers. - -** Check default attribute values. - -* Performance - -** Explore whether overlay-recenter can cure overlays performance -problems. - -** Cache schemas. Need to have list of files and mtimes. - -** Make it possible to reduce rng-validate-chunk-size significantly, -perhaps to 500 bytes, without bad performance impact: don't do -redisplay on every chunk; pass continue functions on other uses of -rng-do-some-validation. - -** Cache after first tag. - -** Introduce a new name class that is a choice between names (so that -we can use member) - -** intern-choice should simplify after patterns with same 1st/2nd args - -** Large numbers of overlays slow things down dramatically. Represent -errors using text properties. This implies we cannot incrementally -keep track of the number of errors, in order to determine validity. -Instead, when validation completes, scan for any characters with an -error text property; this seems to be fast enough even with large -buffers. Problem with error at end of buffer, where there's no -character; need special variable for this. Need to merge face from -font-lock with the error face: use :inherit attribute with list of two -faces. How do we avoid making rng-valid depend on nxml-mode? - -* Error recovery - -** Don't stop at newline in looking for close of start-tag. - -** Use indentation to guide recovery from mismatched end-tags - -** Don't keep parsing when currently not well-formed but previously -well-formed - -** Try to recover from a bad start-tag by popping an open element if -there was a mismatched end-tag unaccounted for. - -** Try to recover from a bad start-tag open on the hypothesis that there -was an error in the namespace URI. - -** Better recovery from ill-formed XML declarations. - -* Useability improvements - -** Should print a "Parsing..." message during long movements. - -** Provide better position for reference to undefined pattern error. - -** Put Well-formed in the mode-line when validating against any-content. - -** Trim marking of illegal data for leading and trailing whitespace. - -** Show Invalid status as soon as we are sure it's invalid, rather than -waiting for everything to be completely up to date. - -** When narrowed, Valid or Invalid status should probably consider only -validity of narrowed region. - -* Bug fixes - -** Need to give an error for a document like: <foo/><![CDATA[ ]]> - -** Make nxml-forward-balanced-item work better for the prolog. - -** Make filling and indenting comments work in the prolog. - -** Should delete RNC Input buffers. - -** Figure out what regex use for NCName and use it consistently, - -** Should have not-well-formed tokens in ref. - -** Require version in XML declaration? Probably not because prevents -use for external parsed entities. At least forbid standalone -without version. - -** Reject schema that compiles to rng-not-allowed-ipattern. - -** Move point backwards on schema parse error so that it's on the right token. - -* Internal - -** Use rng-quote-string consistently. - -** Use parsing library for XML to texinfo conversion. - -** Rename xmltok.el to nxml-token.el. Use nxml-t- prefix instead of -xmltok-. Change nxml-t-type to nxml-t-token-type, nxml-t-start to -nxml-t-token-start. - -** Can we set fill-prefix to nil and rely on indenting? - -** xmltok should make available replacement text of entities containing -elements - -** In rng-valid, instead of using modification-hooks and -insert-behind-hooks on dependent overlays, use same technique as -nxml-mode. - -** Port to XEmacs. Issues include: Unicode (XEmacs seems to be based on -Mule-UCS); overlays/text properties vs extents; absence of -fontification-functions hook. - -* Fontification - -** Allow face to depend on element qname, attribute qname, attribute -value. Use list with pairs of (R . F), where R specifies regexps and -F specifies faces. How can this list be made to depend on the -document type? - -* Other - -** Support RELAX NG XML syntax (use XML parsing library). - -** Support W3C XML Schema (use XML parsing library). - -** Command to infer schema from current document (like trang). - -* Schemas - -** XSLT schema should take advantage of RELAX NG to express cooccurrence -constraints on attributes (e.g. xsl:template). - -* Documentation - -** Move material from README to manual. - -** Document encodings. - -* Notes - -** How can we allow an error to be displayed on a different token from -where it is detected? In particular, for a missing closing ">" we -will need to display it at the beginning of the following token. At -the moment, when we parse the following token the error overlay will -get cleared. - -** How should rng-goto-next-error deal with narrowing? - -** Perhaps should merge errors having same start position even if they -have different ends. - -** How to handle surrogates? One possibility is to be compatible with -utf8.e: represent as sequence of 4 chars. But utf-16 is incompatible -with this. - -** Should we distinguish well-formedness errors from invalidity errors? -(I think not: we may want to recover from a bad start-tag by implying -an end-tag.) - -** Seems to be a bug with Emacs, where a mouse movement that causes -help-echo text to appear counts as pending input but does not cause -idle timer to be restarted. - -** Use XML to represent this file. - -** I had a TODO which said simply "split-string". What did I mean? - -** Investigate performance on large files all on one line. - -* Issues for Emacs versions >= 22 - -** Take advantage of UTF-8 CJK support. - -** Supply a next-error-function. - -** Investigate this NEWS item "Emacs now tries to set up buffer coding -systems for HTML/XML files automatically." - -** Take advantage of the pointer text property. - -** Leverage char-displayable-p. - -Local variables: -mode: outline -end: diff --git a/lisp/nxml/nxml-maint.el b/lisp/nxml/nxml-maint.el index 20a3b09d3fa..ae828cf335b 100644 --- a/lisp/nxml/nxml-maint.el +++ b/lisp/nxml/nxml-maint.el @@ -78,7 +78,7 @@ (goto-char (point-min)) (while (re-search-forward "^ *\\([a-FA-F0-9]\\{2\\}\\)[ \t]+" nil t) (let ((row (match-string 1)) - (eol (save-excursion (end-of-line) (point)))) + (eol (line-end-position))) (while (re-search-forward "\\([a-FA-F0-9]\\{2\\}\\)-\\([a-FA-F0-9]\\{2\\}\\)\\|\\([a-FA-F0-9]\\{2\\}\\)" eol t) (setq lst (cons (if (match-beginning 3) @@ -102,5 +102,4 @@ (provide 'nxml-maint) -;; arch-tag: 2cff6b55-12af-47db-90da-a91f782f435a ;;; nxml-maint.el ends here diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 9f23b4c6617..17561eb7e7d 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -37,54 +37,49 @@ (require 'nxml-util) (require 'nxml-rap) (require 'nxml-outln) - -(declare-function rng-nxml-mode-init "rng-nxml") -(declare-function nxml-enable-unicode-char-name-sets "nxml-uchnm") +;; nxml-mode calls rng-nxml-mode-init, which is autoloaded from rng-nxml. +;; So we might as well just require it and silence the compiler. +(provide 'nxml-mode) ; avoid recursive require +(require 'rng-nxml) ;;; Customization (defgroup nxml nil "New XML editing mode." - :group 'languages - :group 'wp) + :group 'languages) (defgroup nxml-faces nil "Faces for XML syntax highlighting." :group 'nxml) (defcustom nxml-char-ref-display-glyph-flag t - "*Non-nil means display glyph following character reference. + "Non-nil means display glyph following character reference. The glyph is displayed in face `nxml-glyph'. The hook `nxml-glyph-set-hook' can be used to customize for which characters glyphs are displayed." :group 'nxml :type 'boolean) -(defcustom nxml-mode-hook nil - "Hook run by command `nxml-mode'." - :group 'nxml - :type 'hook) - (defcustom nxml-sexp-element-flag nil - "*Non-nil means sexp commands treat an element as a single expression." + "Non-nil means sexp commands treat an element as a single expression." :group 'nxml :type 'boolean) (defcustom nxml-slash-auto-complete-flag nil - "*Non-nil means typing a slash automatically completes the end-tag. + "Non-nil means typing a slash automatically completes the end-tag. This is used by `nxml-electric-slash'." :group 'nxml :type 'boolean) (defcustom nxml-child-indent 2 - "*Indentation for the children of an element relative to the start-tag. + "Indentation for the children of an element relative to the start-tag. This only applies when the line or lines containing the start-tag contains nothing else other than that start-tag." :group 'nxml :type 'integer) (defcustom nxml-attribute-indent 4 - "*Indentation for the attributes of an element relative to the start-tag. + "Indentation for the attributes of an element relative to the start-tag. This only applies when the first attribute of a tag starts a line. In other cases, the first attribute on one line is indented the same as the first attribute on the previous line." @@ -92,7 +87,7 @@ as the first attribute on the previous line." :type 'integer) (defcustom nxml-bind-meta-tab-to-complete-flag (not window-system) - "*Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'. + "Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'. C-return will be bound to `nxml-complete' in any case. M-TAB gets swallowed by many window systems/managers, and `documentation' will show M-TAB rather than C-return as the @@ -106,7 +101,7 @@ to bind M-TAB only when it will work." :type 'boolean) (defcustom nxml-prefer-utf-16-to-utf-8-flag nil - "*Non-nil means prefer UTF-16 to UTF-8 when saving a buffer. + "Non-nil means prefer UTF-16 to UTF-8 when saving a buffer. This is used only when a buffer does not contain an encoding declaration and when its current `buffer-file-coding-system' specifies neither UTF-16 nor UTF-8." @@ -115,7 +110,7 @@ nor UTF-8." (defcustom nxml-prefer-utf-16-little-to-big-endian-flag (eq system-type 'windows-nt) - "*Non-nil means prefer little-endian to big-endian byte-order for UTF-16. + "Non-nil means prefer little-endian to big-endian byte-order for UTF-16. This is used only for saving a buffer; when reading the byte-order is auto-detected. It may be relevant both when there is no encoding declaration and when the encoding declaration specifies `UTF-16'." @@ -123,14 +118,14 @@ and when the encoding declaration specifies `UTF-16'." :type 'boolean) (defcustom nxml-default-buffer-file-coding-system nil - "*Default value for `buffer-file-coding-system' for a buffer for a new file. + "Default value for `buffer-file-coding-system' for a buffer for a new file. A value of nil means use the default value of `buffer-file-coding-system' as normal. A buffer's `buffer-file-coding-system' affects what \\[nxml-insert-xml-declaration] inserts." :group 'nxml :type 'coding-system) (defcustom nxml-auto-insert-xml-declaration-flag nil - "*Non-nil means automatically insert an XML declaration in a new file. + "Non-nil means automatically insert an XML declaration in a new file. The XML declaration is inserted using `nxml-insert-xml-declaration'." :group 'nxml :type 'boolean) @@ -355,6 +350,12 @@ The delimiters are <! and >." ;;; Global variables +(defvar nxml-parent-document nil + "The parent document for a part of a modular document. +Use `nxml-parent-document-set' to set it.") +(make-variable-buffer-local 'nxml-parent-document) +(put 'nxml-parent-document 'safe-local-variable 'stringp) + (defvar nxml-prolog-regions nil "List of regions in the prolog to be fontified. See the function `xmltok-forward-prolog' for more information.") @@ -405,6 +406,8 @@ reference.") (define-key map "\M-}" 'nxml-forward-paragraph) (define-key map "\M-h" 'nxml-mark-paragraph) (define-key map "\C-c\C-f" 'nxml-finish-element) + (define-key map "\C-c]" 'nxml-finish-element) + (define-key map "\C-c/" 'nxml-finish-element) (define-key map "\C-c\C-m" 'nxml-split-element) (define-key map "\C-c\C-b" 'nxml-balanced-close-start-tag-block) (define-key map "\C-c\C-i" 'nxml-balanced-close-start-tag-inline) @@ -429,8 +432,40 @@ reference.") (when (and face (< start end)) (font-lock-append-text-property start end 'face face))) +(defun nxml-parent-document-set (parent-document) + "Set `nxml-parent-document' and inherit the DTD &c." + ;; FIXME: this does not work. + ;; the idea is that by inheriting some variables from the parent, + ;; `rng-validate-mode' will validate entities declared in the parent. + ;; alas, the most interesting variables (`rng-compile-table' et al) + ;; are circular and cannot be printed even with `print-circle'. + (interactive "fParent document") + (let (dtd current-schema current-schema-file-name compile-table + ipattern-table last-ipattern-index) + (when (string= (file-truename parent-document) + (file-truename buffer-file-name)) + (error "Parent document cannot be the same as the document")) + (with-current-buffer (find-file-noselect parent-document) + (setq dtd rng-dtd + current-schema rng-current-schema + current-schema-file-name rng-current-schema-file-name + compile-table rng-compile-table + ipattern-table rng-ipattern-table + last-ipattern-index rng-last-ipattern-index + parent-document buffer-file-name)) + (setq rng-dtd dtd + rng-current-schema current-schema + rng-current-schema-file-name current-schema-file-name + rng-compile-table compile-table + rng-ipattern-table ipattern-table + rng-last-ipattern-index last-ipattern-index + nxml-parent-document parent-document) + (message "Set parent document to %s" parent-document) + (when rng-validate-mode + (rng-validate-while-idle (current-buffer))))) + ;;;###autoload -(defun nxml-mode () +(define-derived-mode nxml-mode text-mode "nXML" ;; We use C-c C-i instead of \\[nxml-balanced-close-start-tag-inline] ;; because Emacs turns C-c C-i into C-c TAB which is hard to type and ;; not mnemonic. @@ -484,10 +519,7 @@ be treated as a single markup item, set the variable Many aspects this mode can be customized using \\[customize-group] nxml RET." - (interactive) - (kill-all-local-variables) - (setq major-mode 'nxml-mode) - (setq mode-name "nXML") + ;; (kill-all-local-variables) (set (make-local-variable 'mode-line-process) '((nxml-degraded "/degraded"))) ;; We'll determine the fill prefix ourselves (make-local-variable 'adaptive-fill-mode) @@ -551,8 +583,7 @@ Many aspects this mode can be customized using (font-lock-unfontify-region-function . nxml-unfontify-region))) (rng-nxml-mode-init) - (nxml-enable-unicode-char-name-sets) - (run-mode-hooks 'nxml-mode-hook)) + (nxml-enable-unicode-char-name-sets)) (defun nxml-cleanup () "Clean up after nxml-mode." @@ -1370,17 +1401,21 @@ of the inserted start-tag or nil if none was inserted." (defun nxml-indent-line () "Indent current line as XML." - (let ((indent (nxml-compute-indent)) - (from-end (- (point-max) (point)))) - (when (and indent - (/= indent (current-indentation))) - (beginning-of-line) - (let ((bol (point))) - (skip-chars-forward " \t") - (delete-region bol (point))) - (indent-to indent) - (when (> (- (point-max) from-end) (point)) - (goto-char (- (point-max) from-end)))))) + (let* ((savep (point)) + (indent (condition-case nil + (save-excursion + (forward-line 0) + (skip-chars-forward " \t") + (if (>= (point) savep) (setq savep nil)) + (or (nxml-compute-indent) 0)) + (error 0)))) + (if (not (numberp indent)) + ;; If something funny is used (e.g. `noindent'), return it. + indent + (if (< indent 0) (setq indent 0)) ;Just in case. + (if savep + (save-excursion (indent-line-to indent)) + (indent-line-to indent))))) (defun nxml-compute-indent () "Return the indent for the line containing point." @@ -2659,5 +2694,4 @@ With a prefix argument, inserts the character directly." (provide 'nxml-mode) -;; arch-tag: 8603bc5f-1ef9-4021-b223-322fb2ca708e ;;; nxml-mode.el ends here diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el index 2293a386769..8416d698e16 100644 --- a/lisp/nxml/nxml-outln.el +++ b/lisp/nxml/nxml-outln.el @@ -82,7 +82,7 @@ (defcustom nxml-section-element-name-regexp "article\\|\\(sub\\)*section\\|chapter\\|div\\|appendix\\|part\\|preface\\|reference\\|simplesect\\|bibliography\\|bibliodiv\\|glossary\\|glossdiv" - "*Regular expression matching the name of elements used as sections. + "Regular expression matching the name of elements used as sections. An XML element is treated as a section if: - its local name (that is, the name without the prefix) matches @@ -97,7 +97,7 @@ element has a local name matching the variable :type 'regexp) (defcustom nxml-heading-element-name-regexp "title\\|head" - "*Regular expression matching the name of elements used as headings. + "Regular expression matching the name of elements used as headings. An XML element is only recognized as a heading if it occurs as or within the first child of an element that is recognized as a section. See the variable `nxml-section-element-name-regexp' for more details." @@ -105,7 +105,7 @@ See the variable `nxml-section-element-name-regexp' for more details." :type 'regexp) (defcustom nxml-outline-child-indent 2 - "*Indentation in an outline for child element relative to parent element." + "Indentation in an outline for child element relative to parent element." :group 'nxml :type 'integer) @@ -1037,5 +1037,4 @@ immediately after the section's start-tag." (provide 'nxml-outln) -;; arch-tag: 1f1b7454-e573-4cd7-a505-d9dc64eef828 ;;; nxml-outln.el ends here diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index 9688178b22f..c568b86a250 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el @@ -48,7 +48,7 @@ It is nil if using a vacuous schema.") "Schema for schema locating files or nil if not yet loaded.") (defcustom rng-schema-locating-files rng-schema-locating-files-default - "*List of schema locating files." + "List of schema locating files." :type '(repeat file) :group 'relax-ng) @@ -546,5 +546,4 @@ saved to the first writable file in `rng-schema-locating-files'." (provide 'rng-loc) -;; arch-tag: 725cf968-37a2-418b-b47b-d5209871a9ab ;;; rng-loc.el ends here diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index e69ecdbcfa3..07aac010886 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -35,7 +35,7 @@ (require 'rng-loc) (defcustom rng-nxml-auto-validate-flag t - "*Non-nil means automatically turn on validation with nxml-mode." + "Non-nil means automatically turn on validation with nxml-mode." :type 'boolean :group 'relax-ng) @@ -47,7 +47,7 @@ ("http://www.w3.org/2001/XMLSchema-instance" . "xsi") ("http://purl.org/dc/elements/1.1/" . "dc") ("http://purl.org/dc/terms/" . "dcterms")) - "*Alist of namespaces vs preferred prefixes." + "Alist of namespaces vs preferred prefixes." :type '(repeat (cons :tag "With" (string :tag "this namespace URI") (string :tag "use this prefix"))) @@ -591,5 +591,4 @@ set `xmltok-dtd'. Returns the position of the end of the token." (provide 'rng-nxml) -;; arch-tag: bec0d6ed-6be1-4540-9c2c-6f56e8e55d8b ;;; rng-nxml.el ends here diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el index 992de5c7ab4..96ab5b6c95e 100644 --- a/lisp/nxml/rng-valid.el +++ b/lisp/nxml/rng-valid.el @@ -110,12 +110,12 @@ :group 'relax-ng) (defcustom rng-state-cache-distance 2000 - "*Distance in characters between each parsing and validation state cache." + "Distance in characters between each parsing and validation state cache." :type 'integer :group 'relax-ng) (defcustom rng-validate-chunk-size 8000 - "*Number of characters in a RELAX NG validation chunk. + "Number of characters in a RELAX NG validation chunk. A validation chunk will be the smallest chunk that is at least this size and ends with a tag. After validating a chunk, validation will continue only if Emacs is still idle." @@ -123,14 +123,14 @@ continue only if Emacs is still idle." :group 'relax-ng) (defcustom rng-validate-delay 1.5 - "*Time in seconds that Emacs must be idle before starting a full validation. + "Time in seconds that Emacs must be idle before starting a full validation. A full validation continues until either validation is up to date or Emacs is no longer idle." :type 'number :group 'relax-ng) (defcustom rng-validate-quick-delay 0.3 - "*Time in seconds that Emacs must be idle before starting a quick validation. + "Time in seconds that Emacs must be idle before starting a quick validation. A quick validation validates at most one chunk." :type 'number :group 'relax-ng) @@ -518,6 +518,9 @@ Return t if there is work to do, nil otherwise." (goto-char pos)) (t (rng-set-initial-state)))))))))) +(defun rng-dtd-trivial-p (dtd) + "Check whether the current dtd is different from the trivial default." + (or (null dtd) (eq dtd xmltok-predefined-entity-alist))) (defun rng-do-some-validation-1 (&optional continue-p-function) (let ((limit (+ rng-validate-up-to-date-end @@ -1461,5 +1464,4 @@ string between START and END." (provide 'rng-valid) -;; arch-tag: 7dd846d3-519d-4a6d-8107-4ff0024a60ef ;;; rng-valid.el ends here |