Commit 10545bd8 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

Fix typos, and general docstring cleanup.

* nxml/nxml-glyph.el (nxml-glyph-set-hook):
* nxml/nxml-uchnm.el (nxml-unicode-blocks)
(nxml-unicode-block-char-name-set):
* nxml/nxml-util.el (nxml-debug, nxml-make-namespace):
* nxml/rng-nxml.el (rng-set-state-after):
* nxml/rng-uri.el (rng-file-name-uri): Fix typo in docstring.

* nxml/rng-cmpct.el (rng-c-lookup-create, rng-c-parse-primary)
(rng-c-parse-annotation-body):
* nxml/rng-dt.el (rng-dt-namespace-context-getter): Reflow docstrings.

* nxml/nxml-mode.el (nxml, nxml-mode, nxml-after-change1)
(nxml-extend-region, nxml-merge-indent-context-type, nxml-complete)
(nxml-forward-balanced-item, nxml-dynamic-markup-word)
(nxml-define-char-name-set, nxml-toggle-char-ref-extra-display):
Fix typos in docstrings.
(nxml-attribute-indent): Reflow docstring.
(nxml-bind-meta-tab-to-complete-flag, nxml-last-fontify-end)
(nxml-default-buffer-file-coding-system): Doc fixes.

* nxml/nxml-ns.el (nxml-ns-state, nxml-ns-initial-state)
(nxml-ns-set-prefix): Fix typos in docstrings.
(nxml-ns-push-state, nxml-ns-pop-state, nxml-ns-set-default):
Reflow docstring.
(nxml-ns-get-prefix, nxml-ns-get-default): Doc fixes.

* nxml/nxml-outln.el (nxml-hide-all-text-content)
(nxml-show-direct-text-content, nxml-show-direct-subheadings)
(nxml-hide-direct-text-content, nxml-hide-subheadings)
(nxml-hide-text-content, nxml-show-subheadings, nxml-hide-other)
(nxml-outline-display-rest, nxml-outline-set-overlay)
(nxml-section-tag-forward, nxml-section-tag-backward)
(nxml-back-to-section-start): Fix typos in docstrings.

* nxml/nxml-parse.el (nxml-validate-function, nxml-parse-file):
Doc fixes.

* nxml/nxml-rap.el (nxml-scan-end, nxml-move-tag-backwards)
(nxml-scan-element-forward, nxml-scan-element-backward): Doc fixes.
(nxml-scan-after-change): Fix typo in docstring.

* nxml/rng-match.el (rng-being-compiled, rng-normalize-choice-list)
(rng-name-class-possible-names): Doc fixes.
(rng-memo-map-add, rng-intern-group, rng-match-possible-namespace-uris)
(rng-match-possible-start-tag-names, rng-match-possible-value-strings):
Fix typos in docstrings.
(rng-intern-group-shortcut, rng-intern-choice-shortcut):
Reflow docstrings.

* nxml/rng-util.el (rng-uniquify-eq, rng-uniquify-equal): Doc fixes.
(rng-substq, rng-complete-before-point): Fix typos in docstrings.

* nxml/rng-xsd.el (rng-xsd-make-date-time-regexp)
(rng-xsd-convert-date-time): Reflow docstrings.
(rng-xsd-compile): Fix typo in docstring.

* nxml/rng-loc.el (rng-current-schema-file-name)
(rng-locate-schema-file-using, rng-locate-schema-file-from-type-id):
Doc fixes.
(rng-set-schema-file): Fix typo in docstring.

* nxml/rng-valid.el (rng-error-count, rng-validate-mode)
(rng-do-some-validation, rng-process-start-tag, rng-process-text):
Fix typos in docstrings.
(rng-message-overlay, rng-conditional-up-to-date-start)
(rng-conditional-up-to-date-end): Doc fixes.
(rng-next-error, rng-previous-error): Reflow docstrings.

* nxml/xmltok.el (xmltok-attribute-raw-normalized-value): Doc fix.
(xmltok-dtd, xmltok-dependent-regions, xmltok-attribute-refs)
(xmltok-valid-char-p, xmltok-standalone, xmltok-forward-prolog)
(xmltok-merge-attributes): Fix typos in docstrings.
(xmltok-make-attribute, xmltok-forward-special)
(xmltok-get-declared-encoding-position): Reflow docstrings.

* nxml/xsd-regexp.el (xsdre-char-class-to-range-list): Doc fix.
(xsdre-range-list-union, xsdre-check-range-list, xsdre-current-regexp):
Fix typos in docstrings.
parent 946598bf
2008-07-03 Juanma Barranquero <lekktu@gmail.com>
* nxml/nxml-glyph.el (nxml-glyph-set-hook):
* nxml/nxml-uchnm.el (nxml-unicode-blocks)
(nxml-unicode-block-char-name-set):
* nxml/nxml-util.el (nxml-debug, nxml-make-namespace):
* nxml/rng-nxml.el (rng-set-state-after):
* nxml/rng-uri.el (rng-file-name-uri): Fix typo in docstring.
* nxml/rng-cmpct.el (rng-c-lookup-create, rng-c-parse-primary)
(rng-c-parse-annotation-body):
* nxml/rng-dt.el (rng-dt-namespace-context-getter): Reflow docstrings.
* nxml/nxml-mode.el (nxml, nxml-mode, nxml-after-change1)
(nxml-extend-region, nxml-merge-indent-context-type, nxml-complete)
(nxml-forward-balanced-item, nxml-dynamic-markup-word)
(nxml-define-char-name-set, nxml-toggle-char-ref-extra-display):
Fix typos in docstrings.
(nxml-attribute-indent): Reflow docstring.
(nxml-bind-meta-tab-to-complete-flag, nxml-last-fontify-end)
(nxml-default-buffer-file-coding-system): Doc fixes.
* nxml/nxml-ns.el (nxml-ns-state, nxml-ns-initial-state)
(nxml-ns-set-prefix): Fix typos in docstrings.
(nxml-ns-push-state, nxml-ns-pop-state, nxml-ns-set-default):
Reflow docstring.
(nxml-ns-get-prefix, nxml-ns-get-default): Doc fixes.
* nxml/nxml-outln.el (nxml-hide-all-text-content)
(nxml-show-direct-text-content, nxml-show-direct-subheadings)
(nxml-hide-direct-text-content, nxml-hide-subheadings)
(nxml-hide-text-content, nxml-show-subheadings, nxml-hide-other)
(nxml-outline-display-rest, nxml-outline-set-overlay)
(nxml-section-tag-forward, nxml-section-tag-backward)
(nxml-back-to-section-start): Fix typos in docstrings.
* nxml/nxml-parse.el (nxml-validate-function, nxml-parse-file):
Doc fixes.
* nxml/nxml-rap.el (nxml-scan-end, nxml-move-tag-backwards)
(nxml-scan-element-forward, nxml-scan-element-backward): Doc fixes.
(nxml-scan-after-change): Fix typo in docstring.
* nxml/rng-match.el (rng-being-compiled, rng-normalize-choice-list)
(rng-name-class-possible-names): Doc fixes.
(rng-memo-map-add, rng-intern-group, rng-match-possible-namespace-uris)
(rng-match-possible-start-tag-names, rng-match-possible-value-strings):
Fix typos in docstrings.
(rng-intern-group-shortcut, rng-intern-choice-shortcut):
Reflow docstrings.
* nxml/rng-util.el (rng-uniquify-eq, rng-uniquify-equal): Doc fixes.
(rng-substq, rng-complete-before-point): Fix typos in docstrings.
* nxml/rng-xsd.el (rng-xsd-make-date-time-regexp)
(rng-xsd-convert-date-time): Reflow docstrings.
(rng-xsd-compile): Fix typo in docstring.
* nxml/rng-loc.el (rng-current-schema-file-name)
(rng-locate-schema-file-using, rng-locate-schema-file-from-type-id):
Doc fixes.
(rng-set-schema-file): Fix typo in docstring.
* nxml/rng-valid.el (rng-error-count, rng-validate-mode)
(rng-do-some-validation, rng-process-start-tag, rng-process-text):
Fix typos in docstrings.
(rng-message-overlay, rng-conditional-up-to-date-start)
(rng-conditional-up-to-date-end): Doc fixes.
(rng-next-error, rng-previous-error): Reflow docstrings.
* nxml/xmltok.el (xmltok-attribute-raw-normalized-value): Doc fix.
(xmltok-dtd, xmltok-dependent-regions, xmltok-attribute-refs)
(xmltok-valid-char-p, xmltok-standalone, xmltok-forward-prolog)
(xmltok-merge-attributes): Fix typos in docstrings.
(xmltok-make-attribute, xmltok-forward-special)
(xmltok-get-declared-encoding-position): Reflow docstrings.
* nxml/xsd-regexp.el (xsdre-char-class-to-range-list): Doc fix.
(xsdre-range-list-union, xsdre-check-range-list, xsdre-current-regexp):
Fix typos in docstrings.
2008-07-02 John Paul Wallington <jpw@pobox.com>
* ibuffer.el (ibuffer-buffer-file-name):
......
......@@ -271,7 +271,7 @@ This repertoire is supported for the following fonts:
"Glyph set for TARGET3 glyph repertoire of the misc-fixed-* fonts.
This repertoire is supported for the following fonts:
6x13.bdf 8x13.bdf 9x15.bdf 9x18.bdf 10x20.bdf")
(defconst nxml-wgl4-glyph-set
[(#x0020 . #x007E)
(#x00A0 . #x017F)
......@@ -334,14 +334,14 @@ This repertoire is supported for the following fonts:
(defvar nxml-glyph-set-hook nil
"*Hook for determining the set of glyphs in a face.
The hook will receive a single argument FACE. If it can determine the
set of glyphs representable by FACE, it must set the variable
`nxml-glyph-set' and return non-nil. Otherwise, it must return
nil. The hook will be run until success. The constants
The hook will receive a single argument FACE. If it can determine
the set of glyphs representable by FACE, it must set the variable
`nxml-glyph-set' and return non-nil. Otherwise, it must return nil.
The hook will be run until success. The constants
`nxml-ascii-glyph-set', `nxml-latin1-glyph-set',
`nxml-misc-fixed-1-glyph-set', `nxml-misc-fixed-2-glyph-set',
`nxml-misc-fixed-3-glyph-set' and `nxml-wgl4-glyph-set' are predefined
for use by `nxml-glyph-set-hook'.")
`nxml-misc-fixed-3-glyph-set' and `nxml-wgl4-glyph-set' are
predefined for use by `nxml-glyph-set-hook'.")
(defvar nxml-glyph-set nil
"Used by `nxml-glyph-set-hook' to return set of glyphs in a FACE.
......@@ -386,7 +386,7 @@ Return nil if the face cannot display a glyph for N."
(nxml-glyph-set-contains-p n nxml-glyph-set)
(let ((ch (decode-char 'ucs n)))
(and ch (string ch))))))
(defun nxml-glyph-set-contains-p (n v)
(let ((start 0)
(end (length v))
......
......@@ -44,7 +44,7 @@
;;; Customization
(defgroup nxml nil
"New XML editing mode"
"New XML editing mode."
:group 'languages
:group 'wp)
......@@ -86,9 +86,9 @@ nothing else other than that start-tag."
(defcustom nxml-attribute-indent 4
"*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."
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."
:group 'nxml
:type 'integer)
......@@ -97,7 +97,7 @@ attribute on the previous line."
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
binding `rng-complete' when both are bound. So it's better
binding for `nxml-complete' when both are bound. So it's better
to bind M-TAB only when it will work."
:group 'nxml
:set (lambda (sym flag)
......@@ -125,7 +125,7 @@ and when the encoding declaration specifies `UTF-16'."
(defcustom nxml-default-buffer-file-coding-system nil
"*Default value for `buffer-file-coding-system' for a buffer for a new file.
Nil means use the default value of `buffer-file-coding-system' as normal.
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)
......@@ -263,7 +263,7 @@ This includes ths `x' in hex references."
'((t (:inherit nxml-delimiter)))
"Face used for the colon in attribute names."
:group 'nxml-faces)
(defface nxml-attribute-local-name
'((t (:inherit font-lock-variable-name-face)))
"Face used for the local name of attributes."
......@@ -339,7 +339,7 @@ The delimiters are <! and >."
:foreground
"black"
:weight
normal
normal
:slant
normal))
(t
......@@ -348,7 +348,7 @@ The delimiters are <! and >."
:foreground
"black"
:weight
normal
normal
:slant
normal)))
"Face used for glyph for char references."
......@@ -363,7 +363,7 @@ See the function `xmltok-forward-prolog' for more information.")
(defvar nxml-last-fontify-end nil
"Position where fontification last ended.
Nil if the buffer changed since the last fontification.")
It is nil if the buffer changed since the last fontification.")
(make-variable-buffer-local 'nxml-last-fontify-end)
(defvar nxml-degraded nil
......@@ -416,7 +416,7 @@ reference.")
(define-key map "\C-c\C-o" nxml-outline-prefix-map)
(define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content)
(define-key map "/" 'nxml-electric-slash)
(define-key map [C-return] 'nxml-complete)
(define-key map [C-return] 'nxml-complete)
(when nxml-bind-meta-tab-to-complete-flag
(define-key map "\M-\t" 'nxml-complete))
map)
......@@ -439,7 +439,7 @@ reference.")
\\[nxml-finish-element] finishes the current element by inserting an end-tag.
C-c C-i closes a start-tag with `>' and then inserts a balancing end-tag
leaving point between the start-tag and end-tag.
leaving point between the start-tag and end-tag.
\\[nxml-balanced-close-start-tag-block] is similar but for block rather than inline elements:
the start-tag, point, and end-tag are all left on separate lines.
If `nxml-slash-auto-complete-flag' is non-nil, then inserting a `</'
......@@ -459,8 +459,8 @@ instead of C-c.
Validation is provided by the related minor-mode `rng-validate-mode'.
This also makes completion schema- and context- sensitive. Element
names, attribute names, attribute values and namespace URIs can all be
completed. By default, `rng-validate-mode' is automatically enabled. You
can toggle it using \\[rng-validate-mode] or change the default by
completed. By default, `rng-validate-mode' is automatically enabled.
You can toggle it using \\[rng-validate-mode] or change the default by
customizing `rng-nxml-auto-validate-flag'.
\\[indent-for-tab-command] indents the current line appropriately.
......@@ -468,8 +468,8 @@ This can be customized using the variable `nxml-child-indent'
and the variable `nxml-attribute-indent'.
\\[nxml-insert-named-char] inserts a character reference using
the character's name (by default, the Unicode name). \\[universal-argument] \\[nxml-insert-named-char]
inserts the character directly.
the character's name (by default, the Unicode name).
\\[universal-argument] \\[nxml-insert-named-char] inserts the character directly.
The Emacs commands that normally operate on balanced expressions will
operate on XML markup items. Thus \\[forward-sexp] will move forward
......@@ -609,10 +609,10 @@ Many aspects this mode can be customized using
start end pre-change-length)))))))))
(defun nxml-after-change1 (start end pre-change-length)
"After-change bookkeeping. Returns a cons cell containing a
possibly-enlarged change region. You must call
nxml-extend-region on this expanded region to obtain the full
extent of the area needing refontification.
"After-change bookkeeping.
Returns a cons cell containing a possibly-enlarged change region.
You must call `nxml-extend-region' on this expanded region to obtain
the full extent of the area needing refontification.
For bookkeeping, call this function even when fontification is
disabled."
......@@ -800,7 +800,7 @@ The XML declaration will declare an encoding depending on the buffer's
(setq suitable-coding-systems (cdr suitable-coding-systems))))
ret)))
(defun nxml-choose-utf-coding-system ()
(defun nxml-choose-utf-coding-system ()
(let ((cur (and (local-variable-p 'buffer-file-coding-system)
buffer-file-coding-system
(coding-system-base buffer-file-coding-system))))
......@@ -840,7 +840,7 @@ The XML declaration will declare an encoding depending on the buffer's
(defvar font-lock-beg) (defvar font-lock-end)
(defun nxml-extend-region ()
"Extend the region to hold the minimum area we can fontify with nXML.
Called with font-lock-beg and font-lock-end dynamically bound."
Called with `font-lock-beg' and `font-lock-end' dynamically bound."
(let ((start font-lock-beg)
(end font-lock-end))
......@@ -1278,7 +1278,7 @@ No extra whitespace is inserted."
(insert "\n")
(indent-line-to (+ nxml-child-indent indent)))
(goto-char pos)))))
(defun nxml-finish-element ()
"Finish the current element by inserting an end-tag."
(interactive "*")
......@@ -1480,8 +1480,8 @@ its line. Otherwise return nil."
(defun nxml-merge-indent-context-type (context)
"Merge the indent context type CONTEXT with the token in `xmltok-type'.
Return the merged indent context type. An indent context type is
either nil or one of the symbols start-tag, end-tag, markup, comment,
mixed."
either nil or one of the symbols `start-tag', `end-tag', `markup',
`comment', `mixed'."
(cond ((memq xmltok-type '(start-tag partial-start-tag))
(if (memq context '(nil start-tag comment))
'start-tag
......@@ -1573,7 +1573,7 @@ xmltok-* variables to be set up as by `xmltok-forward'."
(setq atts nil))
(t (setq atts (cdr atts)))))
value-boundary))
(defun nxml-compute-indent-in-delimited-token (pos open-delim close-delim)
"Return the indent for a line that starts inside a token with delimiters.
OPEN-DELIM and CLOSE-DELIM are strings giving the opening and closing
......@@ -1604,7 +1604,7 @@ of the line. This expects the xmltok-* variables to be set up as by
Inserts as many characters as can be completed. However, if not even
one character can be completed, then a buffer with the possibilities
is popped up and the symbol is read from the minibuffer with
completion. If the symbol is complete, then any characters that must
completion. If the symbol is complete, then any characters that must
follow the symbol are also inserted.
The name space used for completion and what is treated as a symbol
......@@ -1626,11 +1626,11 @@ This is the equivalent of `forward-sexp' for XML.
An element contains as items strings with no markup, tags, processing
instructions, comments, CDATA sections, entity references and
characters references. However, if the variable
characters references. However, if the variable
`nxml-sexp-element-flag' is non-nil, then an element is treated as a
single markup item. A start-tag contains an element name followed by
one or more attributes. An end-tag contains just an element name. An
attribute value literals contains strings with no markup, entity
one or more attributes. An end-tag contains just an element name.
An attribute value literals contains strings with no markup, entity
references and character references. A processing instruction
consists of a target and a content string. A comment or a CDATA
section contains a single string. An entity reference contains a
......@@ -2130,7 +2130,7 @@ HAD-DATA says whether there have been non-whitespace data characters yet."
(goto-char (+ xmltok-start offset))
(and (re-search-forward "^[ \t]*$" end t)
(match-beginning 0)))))
((and (memq xmltok-type '(start-tag
((and (memq xmltok-type '(start-tag
end-tag
empty-element
comment
......@@ -2146,7 +2146,7 @@ HAD-DATA says whether there have been non-whitespace data characters yet."
(looking-at "[ \t]*$")
(not (nxml-in-mixed-content-p t)))
(save-excursion
(or (search-forward "\n" nil t)
(or (search-forward "\n" nil t)
(point-max))))))
(defun nxml-paragraph-start-pos (had-data offset)
......@@ -2186,7 +2186,7 @@ HAD-DATA says whether there have been non-whitespace data characters yet."
(goto-char (- (point) offset))
(and (re-search-backward "^[ \t]*$" xmltok-start t)
(match-beginning 0))))
((and (memq xmltok-type '(start-tag
((and (memq xmltok-type '(start-tag
end-tag
empty-element
comment
......@@ -2194,7 +2194,7 @@ HAD-DATA says whether there have been non-whitespace data characters yet."
entity-ref))
(nxml-token-ends-line-p)
(nxml-token-begins-line-p))
(or (search-forward "\n" nil t)
(or (search-forward "\n" nil t)
(point-max)))
((and (eq xmltok-type 'start-tag)
(nxml-token-begins-line-p)
......@@ -2334,7 +2334,7 @@ ENDP is t in the former case, nil in the latter."
(fill-region-as-paragraph start end arg))
(skip-line-prefix fill-prefix)
fill-prefix))
(defun nxml-newline-and-indent (soft)
(delete-horizontal-space)
(if soft (insert-and-inherit ?\n) (newline 1))
......@@ -2356,10 +2356,10 @@ 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.
It works in a similar way to \\[dabbrev-expand]. It searches first
It works in a similar way to \\[dabbrev-expand]. It searches first
backwards from point, then forwards from point for an element whose
content is a string which matches the contents of the buffer before
point and which includes at least the word before point. It then
point and which includes at least the word before point. It then
copies the start- and end-tags from that element and uses them to
surround the matching string before point.
......@@ -2465,7 +2465,7 @@ and attempts to find another possible way to do the markup."
(- start-tag-close-pos xmltok-start)))
(insert "</" name ">")
(setq nxml-dynamic-markup-prev-pos (point))))))))))
;;; Character names
......@@ -2494,10 +2494,10 @@ and NAME is a string naming a character.")
(defvar nxml-autoload-char-name-set-list nil
"List of char namesets that can be autoloaded.")
(defun nxml-enable-char-name-set (nameset)
(defun nxml-enable-char-name-set (nameset)
(put nameset 'nxml-char-name-set-enabled t))
(defun nxml-disable-char-name-set (nameset)
(defun nxml-disable-char-name-set (nameset)
(put nameset 'nxml-char-name-set-enabled nil))
(defun nxml-char-name-set-enabled-p (nameset)
......@@ -2512,9 +2512,9 @@ and NAME is a string naming a character.")
(defun nxml-define-char-name-set (nameset alist)
"Define a set of character names.
NAMESET is a symbol identifying the set.
Alist is a list where each member has the form (NAME CODE),
where NAME is a string naming a character and code
is an integer giving the Unicode scalar value of the character."
ALIST is a list where each member has the form (NAME CODE),
where NAME is a string naming a character and code is an
integer giving the Unicode scalar value of the character."
(when (get nameset 'nxml-char-name-set-defined)
(error "Nameset `%s' already defined" nameset))
(let ((iter alist))
......@@ -2573,7 +2573,7 @@ With a prefix argument, inserts the character directly."
(error "Character %x is not supported by Emacs"
code))
(format "&#x%X;" code))))))
(defun nxml-maybe-load-char-name-set (sym)
(when (and (get sym 'nxml-char-name-set-enabled)
(not (get sym 'nxml-char-name-set-defined))
......@@ -2581,7 +2581,7 @@ With a prefix argument, inserts the character directly."
(load (get sym 'nxml-char-name-set-file))))
(defun nxml-toggle-char-ref-extra-display (arg)
"*Toggle the display of extra information for character references."
"Toggle the display of extra information for character references."
(interactive "P")
(let ((new (if (null arg)
(not nxml-char-ref-extra-display)
......@@ -2619,7 +2619,7 @@ With a prefix argument, inserts the character directly."
(defun nxml-start-delimiter-length (type)
(or (get type 'nxml-start-delimiter-length)
0))
(put 'cdata-section 'nxml-start-delimiter-length 9)
(put 'comment 'nxml-start-delimiter-length 4)
(put 'processing-instruction 'nxml-start-delimiter-length 2)
......@@ -2632,7 +2632,7 @@ With a prefix argument, inserts the character directly."
(defun nxml-end-delimiter-length (type)
(or (get type 'nxml-end-delimiter-length)
0))
(put 'cdata-section 'nxml-end-delimiter-length 3)
(put 'comment 'nxml-end-delimiter-length 3)
(put 'processing-instruction 'nxml-end-delimiter-length 2)
......
......@@ -29,22 +29,22 @@
(require 'nxml-util)
(defvar nxml-ns-state nil
"Contains the state of namespace processing. The state
is never modified destructively and so can be saved and restored
without copying.
The value is a stack represented by a list. The list has length N + 1
where N is the number of open elements. Each member of the list
represents the bindings in effect for a particular element. Each
member is itself a list whose car is the default namespace
"Contains the state of namespace processing.
The state is never modified destructively and so can be saved and
restored without copying.
The value is a stack represented by a list. The list has length
N + 1 where N is the number of open elements. Each member of the
list represents the bindings in effect for a particular element.
Each member is itself a list whose car is the default namespace
\(a symbol or nil) and whose cdr is an alist of (PREFIX . NS) pairs
where PREFIX is a string (never nil) and NS is the namespace URI
symbol.")
(defconst nxml-ns-initial-state
(list (list nil (cons "xml" nxml-xml-namespace-uri)))
"A list to be used as the initial value of nxml-ns-state. This
represents the state with no open elements and with the default
"A list to be used as the initial value of `nxml-ns-state'.
This represents the state with no open elements and with the default
namespace bindings (no default namespace and only the xml prefix bound).")
(defsubst nxml-ns-state () nxml-ns-state)
......@@ -66,25 +66,25 @@ namespace bindings (no default namespace and only the xml prefix bound).")
(setq nxml-ns-state nxml-ns-initial-state))
(defun nxml-ns-push-state ()
"Change the state by starting a new element. Namespace declarations
are inherited from the parent state."
"Change the state by starting a new element.
Namespace declarations are inherited from the parent state."
(setq nxml-ns-state (cons (car nxml-ns-state) nxml-ns-state)))
(defun nxml-ns-pop-state ()
"Change the state by ending an element. The behavior is undefined
if there is no open element."
"Change the state by ending an element.
The behavior is undefined if there is no open element."
(setq nxml-ns-state (cdr nxml-ns-state)))
(defun nxml-ns-get-prefix (prefix)
"Return the symbol for namespace bound to PREFIX, or nil if PREFIX
is unbound. PREFIX is a string, never nil."
"Return the symbol for namespace bound to PREFIX.
Return nil if PREFIX is unbound. PREFIX is a string, never nil."
(let ((binding (assoc prefix (cdar nxml-ns-state))))
(and binding (cdr binding))))
(defun nxml-ns-set-prefix (prefix ns)
"Change the binding of PREFIX. PREFIX is a string (never nil). NS
is a symbol (never nil). The change will be in effect until the end of
the current element."
"Change the binding of PREFIX.
PREFIX is a string (never nil). NS is a symbol (never nil).
The change will be in effect until the end of the current element."
(setq nxml-ns-state
(let ((bindings (car nxml-ns-state)))
(cons (cons (car bindings)
......@@ -92,13 +92,13 @@ the current element."
(cdr nxml-ns-state)))))
(defun nxml-ns-get-default ()
"Return the current default namespace as a symbol, or nil
if there is no default namespace."
"Return the current default namespace as a symbol.
Return nil if there is no default namespace."
(caar nxml-ns-state))
(defun nxml-ns-set-default (ns)
"Changes the current default namespace. The change
will be in effect until the end of the current element.
"Changes 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
(cons (cons ns (cdar nxml-ns-state))
......@@ -142,7 +142,7 @@ NS is a symbol or nil."
(cons (caar new) changed))
(setq new (cdr new))))
changed))
(provide 'nxml-ns)
;; arch-tag: 5968e4b7-fb37-46ce-8621-c65db9793028
......
......@@ -161,7 +161,7 @@ See the variable `nxml-section-element-name-regexp' for more details."
(defun nxml-hide-all-text-content ()
"Hide all text content in the buffer.
Anything that is in a section but is not a heading will be hidden.
The visibility of headings at any level will not be changed. See the
The visibility of headings at any level will not be changed. See the
variable `nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -170,8 +170,8 @@ customize which elements are recognized as sections and headings."
(defun nxml-show-direct-text-content ()
"Show the text content that is directly part of the section containing point.
Each subsection will be shown according to its individual state, which
will not be changed. The section containing point is the innermost
section that contains the character following point. See the variable
will not be changed. The section containing point is the innermost
section that contains the character following point. See the variable
`nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -183,7 +183,7 @@ customize which elements are recognized as sections and headings."
(defun nxml-show-direct-subheadings ()
"Show the immediate subheadings of the section containing point.
The section containing point is the innermost section that contains
the character following point. See the variable
the character following point. See the variable
`nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -197,7 +197,7 @@ customize which elements are recognized as sections and headings."
"Hide the text content that is directly part of the section containing point.
The heading of the section will remain visible. The state of
subsections will not be changed. The section containing point is the
innermost section that contains the character following point. See the
innermost section that contains the character following point. See the
variable `nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -212,7 +212,7 @@ customize which elements are recognized as sections and headings."
The text content will also be hidden, leaving only the heading of the
section itself visible. The state of the subsections will also be
changed to hide their headings, so that \\[nxml-show-direct-text-content]
would show only the heading of the subsections. The section containing
would show only the heading of the subsections. The section containing
point is the innermost section that contains the character following
point. See the variable `nxml-section-element-name-regexp' for more
details on how to customize which elements are recognized as sections
......@@ -235,7 +235,7 @@ sections and headings."
(defun nxml-hide-text-content ()
"Hide text content at all levels in the section containing point.
The section containing point is the innermost section that contains
the character following point. See the variable
the character following point. See the variable
`nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -245,7 +245,7 @@ customize which elements are recognized as sections and headings."
"Show the subheadings at all levels of the section containing point.
The visibility of the text content at all levels in the section is not
changed. The section containing point is the innermost section that
contains the character following point. See the variable
contains the character following point. See the variable
`nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -255,7 +255,7 @@ customize which elements are recognized as sections and headings."
"Hide text content other than that directly in the section containing point.
Hide headings other than those of ancestors of that section and their
immediate subheadings. The section containing point is the innermost
section that contains the character following point. See the variable
section that contains the character following point. See the variable
`nxml-section-element-name-regexp' for more details on how to
customize which elements are recognized as sections and headings."
(interactive)
......@@ -349,7 +349,7 @@ customize which elements are recognized as sections and headings."
(when change
(nxml-set-outline-state section-start-pos
(cdr change)))))
(defun nxml-section-tag-transform-outline-state (startp
section-start-pos
&optional
......@@ -418,7 +418,7 @@ customize which elements are recognized as sections and headings."
(or (eq xmltok-type 'end-tag)
(eq xmltok-type 'partial-end-tag)))
(defun nxml-refresh-outline ()
(defun nxml-refresh-outline ()
"Refresh the outline to correspond to the current XML element structure."
(interactive)
(save-excursion
......@@ -438,7 +438,7 @@ OUTLINE-STATE can be nil, t, hide-children. START-TAG-INDENT is the
indent of the start-tag of the current element, or nil if no
containing element has a non-nil OUTLINE-STATE. TAG-QNAMES is a list
of the qnames of the open elements. Point is after the title content.
Leave point after the closing end-tag Return t if we had a
Leave point after the closing end-tag. Return t if we had a
non-transparent child section."
(let ((last-pos (point))
(transparent-depth 0)
......@@ -661,7 +661,7 @@ non-transparent child section."
t)
'display
nxml-highlighted-empty-end-tag))
(defun nxml-outline-display-multi-line-end-tag (last-pos start-tag-indent)
(let ((indentp (save-excursion
(goto-char last-pos)
......@@ -765,12 +765,12 @@ non-transparent child section."