mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
; Minor stylistic fixes found by checkdoc
This commit is contained in:
parent
36474a1e49
commit
63f419f133
326 changed files with 1158 additions and 1180 deletions
|
|
@ -106,9 +106,10 @@ 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.
|
||||
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'."
|
||||
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'."
|
||||
:group 'nxml
|
||||
:type 'boolean
|
||||
:safe #'booleanp)
|
||||
|
|
@ -392,11 +393,11 @@ reference.")
|
|||
(define-key map "/" 'nxml-electric-slash)
|
||||
(define-key map "\M-\t" 'completion-at-point)
|
||||
map)
|
||||
"Keymap for nxml-mode.")
|
||||
"Keymap for `nxml-mode'.")
|
||||
|
||||
(defvar nxml-font-lock-keywords
|
||||
'(nxml-fontify-matcher)
|
||||
"Default font lock keywords for nxml-mode.")
|
||||
"Default font lock keywords for `nxml-mode'.")
|
||||
|
||||
(defsubst nxml-set-face (start end face)
|
||||
(when (and face (< start end))
|
||||
|
|
@ -576,7 +577,7 @@ Many aspects this mode can be customized using
|
|||
string)
|
||||
|
||||
(defun nxml-cleanup ()
|
||||
"Clean up after nxml-mode."
|
||||
"Clean up after `nxml-mode'."
|
||||
;; Disable associated minor modes.
|
||||
(rng-validate-mode -1)
|
||||
;; Clean up fontification.
|
||||
|
|
@ -2269,7 +2270,7 @@ ENDP is t in the former case, nil in the latter."
|
|||
(defun nxml-dynamic-markup-word ()
|
||||
"Dynamically markup the word before point.
|
||||
This attempts to find a tag to put around the word before point based
|
||||
on the contents of the current buffer. The end-tag will be inserted at
|
||||
on the contents of the current buffer. The end-tag will be inserted at
|
||||
point. The start-tag will be inserted at or before the beginning of
|
||||
the word before point; the contents of the current buffer is used to
|
||||
decide where.
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ Return nil if there is no default namespace."
|
|||
(caar nxml-ns-state))
|
||||
|
||||
(defun nxml-ns-set-default (ns)
|
||||
"Changes the current default namespace.
|
||||
"Change the current default namespace.
|
||||
The change will be in effect until the end of the current element.
|
||||
NS is a symbol or nil."
|
||||
(setq nxml-ns-state
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
;; For state 3 it is t.
|
||||
;; The special display is achieved by using overlays. The overlays
|
||||
;; are computed from the nxml-outline-state property by
|
||||
;; `nxml-refresh-outline'. There overlays all have a category property
|
||||
;; `nxml-refresh-outline'. There overlays all have a category property
|
||||
;; with an nxml-outline-display property with value t.
|
||||
;;
|
||||
;; For a section to be recognized as such, the following conditions must
|
||||
|
|
@ -445,7 +445,7 @@ non-transparent child section."
|
|||
(cond ((not (nxml-section-tag-forward))
|
||||
(if (null tag-qnames)
|
||||
nil
|
||||
(nxml-outline-error "missing end-tag %s"
|
||||
(nxml-outline-error "Missing end-tag %s"
|
||||
(car tag-qnames))))
|
||||
;; section end-tag
|
||||
((nxml-token-end-tag-p)
|
||||
|
|
@ -455,9 +455,9 @@ non-transparent child section."
|
|||
xmltok-start))
|
||||
(let ((qname (xmltok-end-tag-qname)))
|
||||
(unless tag-qnames
|
||||
(nxml-outline-error "extra end-tag %s" qname))
|
||||
(nxml-outline-error "Extra end-tag %s" qname))
|
||||
(unless (string= (car tag-qnames) qname)
|
||||
(nxml-outline-error "mismatched end-tag; expected %s, got %s"
|
||||
(nxml-outline-error "Mismatched end-tag; expected %s, got %s"
|
||||
(car tag-qnames)
|
||||
qname)))
|
||||
(cond ((> transparent-depth 0)
|
||||
|
|
@ -938,7 +938,7 @@ If unbalanced section tags are found, signal an `nxml-outline-error'."
|
|||
(setq found t))
|
||||
(let ((qname (xmltok-start-tag-qname)))
|
||||
(unless (string= (car open-tags) qname)
|
||||
(nxml-outline-error "mismatched end-tag"))
|
||||
(nxml-outline-error "Mismatched end-tag"))
|
||||
(setq open-tags (cdr open-tags)))))
|
||||
(goto-char section-start-pos)
|
||||
(and (not found)
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
;;; Commentary:
|
||||
|
||||
;; This uses xmltok.el to do XML parsing. The fundamental problem is
|
||||
;; how to handle changes. We don't want to maintain a complete parse
|
||||
;; This uses xmltok.el to do XML parsing. The fundamental problem is
|
||||
;; how to handle changes. We don't want to maintain a complete parse
|
||||
;; tree. We also don't want to reparse from the start of the document
|
||||
;; on every keystroke. However, it is not possible in general to
|
||||
;; parse an XML document correctly starting at a random point in the
|
||||
;; middle. The main problems are comments, CDATA sections and
|
||||
;; processing instructions: these can all contain things that are
|
||||
;; indistinguishable from elements. Literals in the prolog are also a
|
||||
;; indistinguishable from elements. Literals in the prolog are also a
|
||||
;; problem. Attribute value literals are not a problem because
|
||||
;; attribute value literals cannot contain less-than signs.
|
||||
;;
|
||||
|
|
@ -47,14 +47,14 @@
|
|||
;; we have found.
|
||||
;;
|
||||
;; The prolog has to be parsed specially, so we also keep track of the
|
||||
;; end of the prolog in `nxml-prolog-end'. The prolog is reparsed on
|
||||
;; end of the prolog in `nxml-prolog-end'. The prolog is reparsed on
|
||||
;; every change to the prolog. This won't work well if people try to
|
||||
;; edit huge internal subsets. Hopefully that will be rare.
|
||||
;; edit huge internal subsets. Hopefully that will be rare.
|
||||
;;
|
||||
;; We rely on the `syntax-propertize-function' machinery to keep track
|
||||
;; of the changes in the buffer. Fontification also relies on correct
|
||||
;; `syntax-table' properties. This means that scanning for these
|
||||
;; constructs had better be quick. Fortunately it is. Firstly, the
|
||||
;; constructs had better be quick. Fortunately it is. Firstly, the
|
||||
;; typical proportion of comments, CDATA sections and processing
|
||||
;; instructions is small relative to other things. Secondly, to scan
|
||||
;; we just search for the regexp <[!?].
|
||||
|
|
@ -191,7 +191,7 @@ Leave point unmoved if it is not inside anything special."
|
|||
(defun nxml-scan-element-forward (from &optional up)
|
||||
"Scan forward from FROM over a single balanced element.
|
||||
Point must be between tokens. Return the position of the end of
|
||||
the tag that ends the element. `xmltok-start' will contain the
|
||||
the tag that ends the element. `xmltok-start' will contain the
|
||||
position of the start of the tag. If UP is non-nil, then scan
|
||||
past end-tag of element containing point. If no element is
|
||||
found, return nil. If a well-formedness error prevents scanning,
|
||||
|
|
@ -242,7 +242,7 @@ expected `%s'"
|
|||
(defun nxml-scan-element-backward (from &optional up bound)
|
||||
"Scan backward from FROM over a single balanced element.
|
||||
Point must be between tokens. Return the position of the end of
|
||||
the tag that starts the element. `xmltok-start' will contain the
|
||||
the tag that starts the element. `xmltok-start' will contain the
|
||||
position of the start of the tag. If UP is non-nil, then scan
|
||||
past start-tag of element containing point. If BOUND is non-nil,
|
||||
then don't scan back past BOUND. If no element is found, return
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
(require 'sgml-mode)
|
||||
|
||||
(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)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@
|
|||
;; For usage information, see the documentation for rng-validate-mode.
|
||||
;;
|
||||
;; This file provides a minor mode that continually validates a buffer
|
||||
;; against a RELAX NG schema. The validation state is used to support
|
||||
;; schema-sensitive editing as well as validation. Validation is
|
||||
;; against a RELAX NG schema. The validation state is used to support
|
||||
;; schema-sensitive editing as well as validation. Validation is
|
||||
;; performed while Emacs is idle. XML parsing is done using
|
||||
;; xmltok.el. This file is responsible for checking that end-tags
|
||||
;; xmltok.el. This file is responsible for checking that end-tags
|
||||
;; match their start-tags. Namespace processing is handled by
|
||||
;; nxml-ns.el. The RELAX NG Compact Syntax schema is parsed into
|
||||
;; nxml-ns.el. The RELAX NG Compact Syntax schema is parsed into
|
||||
;; internal form by rng-cmpct.el. This internal form is described by
|
||||
;; rng-pttrn.el. Validation of the document by matching against this
|
||||
;; internal form is done by rng-match.el. Handling of W3C XML Schema
|
||||
;; internal form is done by rng-match.el. Handling of W3C XML Schema
|
||||
;; datatypes is delegated by rng-match.el to rng-xsd.el. The minor
|
||||
;; mode is intended to be used in conjunction with the nxml major
|
||||
;; mode, but does not have to be.
|
||||
|
|
@ -44,11 +44,11 @@
|
|||
;; parse and validate it from start to end. As we parse and validate
|
||||
;; the buffer, we periodically cache the state. The state has three
|
||||
;; components: the stack of open elements, the namespace processing
|
||||
;; state and the RELAX NG validation state. The state is cached as the
|
||||
;; state and the RELAX NG validation state. The state is cached as the
|
||||
;; value of the rng-state text property on the closing greater-than of
|
||||
;; tags (but at intervals, not on every tag). We keep track of the
|
||||
;; position up to which cached state is known to be correct by adding
|
||||
;; a function to the buffer's after-change-functions. This is stored
|
||||
;; a function to the buffer's after-change-functions. This is stored
|
||||
;; in the rng-validate-up-to-date-end variable. The first way in
|
||||
;; which we make validation incremental is obvious: we start
|
||||
;; validation from the first cached state before
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
;; minimizing destructive changes to the objects storing the state.
|
||||
;; When state is changed, we use the old state to create new objects
|
||||
;; representing the new state rather than destructively modifying the
|
||||
;; objects representing the old state. Copying the state is just a
|
||||
;; objects representing the old state. Copying the state is just a
|
||||
;; matter of making a list of three objects, one for each component of
|
||||
;; the state; the three objects themselves can be shared and do not
|
||||
;; need to be copied.
|
||||
|
|
@ -261,7 +261,7 @@ to use for finding the schema."
|
|||
(remove-hook 'after-change-functions #'rng-after-change-function t))))
|
||||
|
||||
(defun rng-set-schema-file-and-validate (filename)
|
||||
"Sets the schema and turns on `rng-validate-mode' if not already on.
|
||||
"Set the schema and turn on `rng-validate-mode' if not already on.
|
||||
The schema is set like `rng-set-schema'."
|
||||
(interactive "fSchema file: ")
|
||||
(rng-set-schema-file filename)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
;;; Commentary:
|
||||
|
||||
;; The main entry point is `rng-xsd-compile'. The validator
|
||||
;; The main entry point is `rng-xsd-compile'. The validator
|
||||
;; knows to use this for the datatype library with URI
|
||||
;; https://www.w3.org/2001/XMLSchema-datatypes because it
|
||||
;; is the value of the rng-dt-compile property on that URI
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
;;; Commentary:
|
||||
|
||||
;; This implements an XML 1.0 parser. It also implements the XML
|
||||
;; This implements an XML 1.0 parser. It also implements the XML
|
||||
;; Namespaces Recommendation. It is designed to be conforming, but it
|
||||
;; works a bit differently from a normal XML parser. An XML document
|
||||
;; works a bit differently from a normal XML parser. An XML document
|
||||
;; consists of the prolog and an instance. The prolog is parsed as a
|
||||
;; single unit using `xmltok-forward-prolog'. The instance is
|
||||
;; considered as a sequence of tokens, where a token is something like
|
||||
;; a start-tag, a comment, a chunk of data or a CDATA section. The
|
||||
;; a start-tag, a comment, a chunk of data or a CDATA section. The
|
||||
;; tokenization of the instance is stateless: the tokenization of one
|
||||
;; part of the instance does not depend on tokenization of the
|
||||
;; preceding part of the instance. This allows the instance to be
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
;; value literals specifying default attribute values, and default
|
||||
;; attribute values are not reported to the client.
|
||||
;;
|
||||
;; 2. It does not implement internal entities containing elements. If
|
||||
;; 2. It does not implement internal entities containing elements. If
|
||||
;; an internal entity is referenced and parsing its replacement text
|
||||
;; yields one or more tags, then it will skip the reference and
|
||||
;; report this to the client.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue