comparison lisp/nxml/rng-uri.el @ 96496:e374c747704b

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.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 03 Jul 2008 12:25:23 +0000
parents d495d4d5452f
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
96495:c7a78d44a1d3 96496:e374c747704b
24 24
25 ;;; Code: 25 ;;; Code:
26 26
27 (defun rng-file-name-uri (f) 27 (defun rng-file-name-uri (f)
28 "Return a URI for the filename F. 28 "Return a URI for the filename F.
29 Multibyte characters are left as is. Use `rng-uri-escape-multibyte' to 29 Multibyte characters are left as is. Use `rng-uri-escape-multibyte' to
30 escape them using %HH." 30 escape them using %HH."
31 (setq f (expand-file-name f)) 31 (setq f (expand-file-name f))
32 (let ((url 32 (let ((url
33 (replace-regexp-in-string "[\000-\032\177<>#%\"{}|\\^[]`%?;]" 33 (replace-regexp-in-string "[\000-\032\177<>#%\"{}|\\^[]`%?;]"
34 'rng-percent-encode 34 'rng-percent-encode
100 absolutep 100 absolutep
101 (file-name-absolute-p (substring path 1))) 101 (file-name-absolute-p (substring path 1)))
102 (setq path (substring path 1))) 102 (setq path (substring path 1)))
103 (when (and pattern (string-match "\\`\\./" path)) 103 (when (and pattern (string-match "\\`\\./" path))
104 (setq path (substring path 2))) 104 (setq path (substring path 2)))
105 (setq path 105 (setq path
106 (cond ((eq pattern 'match) 106 (cond ((eq pattern 'match)
107 (rng-uri-unescape-unibyte-match path)) 107 (rng-uri-unescape-unibyte-match path))
108 ((eq pattern 'replace) 108 ((eq pattern 'replace)
109 (rng-uri-unescape-unibyte-replace path 2)) 109 (rng-uri-unescape-unibyte-replace path 2))
110 (t 110 (t
160 (when scheme 160 (when scheme
161 (setq parts 161 (setq parts
162 (cons scheme 162 (cons scheme
163 (cons ":" parts)))) 163 (cons ":" parts))))
164 (apply 'concat parts)))) 164 (apply 'concat parts))))
165 165
166 (defun rng-uri-resolve (uri-ref base-uri) 166 (defun rng-uri-resolve (uri-ref base-uri)
167 "Resolve a possibly relative URI reference into absolute form. 167 "Resolve a possibly relative URI reference into absolute form.
168 URI-REF is the URI reference to be resolved. 168 URI-REF is the URI reference to be resolved.
169 BASE-URI is the base URI to use for resolving it. 169 BASE-URI is the base URI to use for resolving it.
170 The algorithm is specified by RFC 2396. 170 The algorithm is specified by RFC 2396.
306 (defun rng-multibyte-percent-decode (str) 306 (defun rng-multibyte-percent-decode (str)
307 (decode-coding-string (apply 'string 307 (decode-coding-string (apply 'string
308 (mapcar (lambda (h) (string-to-number h 16)) 308 (mapcar (lambda (h) (string-to-number h 16))
309 (split-string str "%"))) 309 (split-string str "%")))
310 'utf-8)) 310 'utf-8))
311 311
312 (defun rng-uri-unescape-unibyte (str) 312 (defun rng-uri-unescape-unibyte (str)
313 (replace-regexp-in-string "%[0-7][0-9a-fA-F]" 313 (replace-regexp-in-string "%[0-7][0-9a-fA-F]"
314 (lambda (h) 314 (lambda (h)
315 (string-to-number (substring h 1) 16)) 315 (string-to-number (substring h 1) 16))
316 str 316 str