summaryrefslogtreecommitdiff
path: root/lisp/nxml
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/nxml')
-rw-r--r--lisp/nxml/nxml-enc.el6
-rw-r--r--lisp/nxml/nxml-glyph.el423
-rw-r--r--lisp/nxml/nxml-maint.el46
-rw-r--r--lisp/nxml/nxml-mode.el121
-rw-r--r--lisp/nxml/nxml-ns.el2
-rw-r--r--lisp/nxml/nxml-outln.el28
-rw-r--r--lisp/nxml/nxml-parse.el4
-rw-r--r--lisp/nxml/nxml-rap.el4
-rw-r--r--lisp/nxml/nxml-uchnm.el251
-rw-r--r--lisp/nxml/nxml-util.el2
-rw-r--r--lisp/nxml/rng-cmpct.el4
-rw-r--r--lisp/nxml/rng-dt.el6
-rw-r--r--lisp/nxml/rng-loc.el17
-rw-r--r--lisp/nxml/rng-maint.el4
-rw-r--r--lisp/nxml/rng-match.el7
-rw-r--r--lisp/nxml/rng-nxml.el8
-rw-r--r--lisp/nxml/rng-parse.el4
-rw-r--r--lisp/nxml/rng-pttrn.el4
-rw-r--r--lisp/nxml/rng-uri.el4
-rw-r--r--lisp/nxml/rng-util.el2
-rw-r--r--lisp/nxml/rng-valid.el20
-rw-r--r--lisp/nxml/rng-xsd.el10
-rw-r--r--lisp/nxml/xmltok.el2
-rw-r--r--lisp/nxml/xsd-regexp.el8
24 files changed, 83 insertions, 904 deletions
diff --git a/lisp/nxml/nxml-enc.el b/lisp/nxml/nxml-enc.el
index 32917688df8..6406f57ff63 100644
--- a/lisp/nxml/nxml-enc.el
+++ b/lisp/nxml/nxml-enc.el
@@ -1,6 +1,6 @@
-;;; nxml-enc.el --- XML encoding auto-detection
+;;; nxml-enc.el --- XML encoding auto-detection -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
@@ -68,7 +68,7 @@
(and nxml-non-xml-set-auto-coding-function
(funcall nxml-non-xml-set-auto-coding-function file-name size))))
-(defun nxml-set-xml-coding (file-name size)
+(defun nxml-set-xml-coding (_file-name size)
"Function to use as `set-auto-coding-function' when file is known to be XML."
(nxml-detect-coding-system (+ (point) (min size 1024))))
diff --git a/lisp/nxml/nxml-glyph.el b/lisp/nxml/nxml-glyph.el
deleted file mode 100644
index 449d92bc32d..00000000000
--- a/lisp/nxml/nxml-glyph.el
+++ /dev/null
@@ -1,423 +0,0 @@
-;;; nxml-glyph.el --- glyph-handling for nxml-mode
-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
-
-;; Author: James Clark
-;; Keywords: wp, hypermedia, languages, XML
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; The entry point to this file is `nxml-glyph-display-string'.
-;; The current implementation is heuristic due to a lack of
-;; Emacs primitives necessary to implement it properly. The user
-;; can tweak the heuristics using `nxml-glyph-set-functions'.
-
-;;; Code:
-
-(defconst nxml-ascii-glyph-set
- [(#x0020 . #x007E)])
-
-(defconst nxml-latin1-glyph-set
- [(#x0020 . #x007E)
- (#x00A0 . #x00FF)])
-
-;; These were generated by using nxml-insert-target-repertoire-glyph-set
-;; on the TARGET[123] files in
-;; http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
-
-(defconst nxml-misc-fixed-1-glyph-set
- [(#x0020 . #x007E)
- (#x00A0 . #x00FF)
- (#x0100 . #x017F)
- #x018F #x0192
- (#x0218 . #x021B)
- #x0259
- (#x02C6 . #x02C7)
- (#x02D8 . #x02DD)
- (#x0374 . #x0375)
- #x037A #x037E
- (#x0384 . #x038A)
- #x038C
- (#x038E . #x03A1)
- (#x03A3 . #x03CE)
- (#x0401 . #x040C)
- (#x040E . #x044F)
- (#x0451 . #x045C)
- (#x045E . #x045F)
- (#x0490 . #x0491)
- (#x05D0 . #x05EA)
- (#x1E02 . #x1E03)
- (#x1E0A . #x1E0B)
- (#x1E1E . #x1E1F)
- (#x1E40 . #x1E41)
- (#x1E56 . #x1E57)
- (#x1E60 . #x1E61)
- (#x1E6A . #x1E6B)
- (#x1E80 . #x1E85)
- (#x1EF2 . #x1EF3)
- (#x2010 . #x2022)
- #x2026 #x2030
- (#x2039 . #x203A)
- #x20AC #x2116 #x2122 #x2126
- (#x215B . #x215E)
- (#x2190 . #x2193)
- #x2260
- (#x2264 . #x2265)
- (#x23BA . #x23BD)
- (#x2409 . #x240D)
- #x2424 #x2500 #x2502 #x250C #x2510 #x2514 #x2518 #x251C #x2524 #x252C #x2534 #x253C #x2592 #x25C6 #x266A #xFFFD]
- "Glyph set for TARGET1 glyph repertoire of misc-fixed-* font.
-This repertoire is supported for the bold and oblique fonts.")
-
-(defconst nxml-misc-fixed-2-glyph-set
- [(#x0020 . #x007E)
- (#x00A0 . #x00FF)
- (#x0100 . #x017F)
- #x018F #x0192
- (#x01FA . #x01FF)
- (#x0218 . #x021B)
- #x0259
- (#x02C6 . #x02C7)
- #x02C9
- (#x02D8 . #x02DD)
- (#x0300 . #x0311)
- (#x0374 . #x0375)
- #x037A #x037E
- (#x0384 . #x038A)
- #x038C
- (#x038E . #x03A1)
- (#x03A3 . #x03CE)
- #x03D1
- (#x03D5 . #x03D6)
- #x03F1
- (#x0401 . #x040C)
- (#x040E . #x044F)
- (#x0451 . #x045C)
- (#x045E . #x045F)
- (#x0490 . #x0491)
- (#x05D0 . #x05EA)
- (#x1E02 . #x1E03)
- (#x1E0A . #x1E0B)
- (#x1E1E . #x1E1F)
- (#x1E40 . #x1E41)
- (#x1E56 . #x1E57)
- (#x1E60 . #x1E61)
- (#x1E6A . #x1E6B)
- (#x1E80 . #x1E85)
- (#x1EF2 . #x1EF3)
- (#x2010 . #x2022)
- #x2026 #x2030
- (#x2032 . #x2034)
- (#x2039 . #x203A)
- #x203C #x203E #x2044
- (#x2070 . #x2071)
- (#x2074 . #x208E)
- (#x20A3 . #x20A4)
- #x20A7 #x20AC
- (#x20D0 . #x20D7)
- #x2102 #x2105 #x2113
- (#x2115 . #x2116)
- #x211A #x211D #x2122 #x2124 #x2126 #x212E
- (#x215B . #x215E)
- (#x2190 . #x2195)
- (#x21A4 . #x21A8)
- (#x21D0 . #x21D5)
- (#x2200 . #x2209)
- (#x220B . #x220C)
- #x220F
- (#x2211 . #x2213)
- #x2215
- (#x2218 . #x221A)
- (#x221D . #x221F)
- #x2221
- (#x2224 . #x222B)
- #x222E #x223C #x2243 #x2245
- (#x2248 . #x2249)
- #x2259
- (#x225F . #x2262)
- (#x2264 . #x2265)
- (#x226A . #x226B)
- (#x2282 . #x228B)
- #x2295 #x2297
- (#x22A4 . #x22A7)
- (#x22C2 . #x22C3)
- #x22C5 #x2300 #x2302
- (#x2308 . #x230B)
- #x2310
- (#x2320 . #x2321)
- (#x2329 . #x232A)
- (#x23BA . #x23BD)
- (#x2409 . #x240D)
- #x2424 #x2500 #x2502 #x250C #x2510 #x2514 #x2518 #x251C #x2524 #x252C #x2534 #x253C
- (#x254C . #x2573)
- (#x2580 . #x25A1)
- (#x25AA . #x25AC)
- (#x25B2 . #x25B3)
- #x25BA #x25BC #x25C4 #x25C6
- (#x25CA . #x25CB)
- #x25CF
- (#x25D8 . #x25D9)
- #x25E6
- (#x263A . #x263C)
- #x2640 #x2642 #x2660 #x2663
- (#x2665 . #x2666)
- (#x266A . #x266B)
- (#xFB01 . #xFB02)
- #xFFFD]
- "Glyph set for TARGET2 glyph repertoire of the misc-fixed-* fonts.
-This repertoire is supported for the following fonts:
-5x7.bdf 5x8.bdf 6x9.bdf 6x10.bdf 6x12.bdf 7x13.bdf 7x14.bdf clR6x12.bdf")
-
-(defconst nxml-misc-fixed-3-glyph-set
- [(#x0020 . #x007E)
- (#x00A0 . #x00FF)
- (#x0100 . #x01FF)
- (#x0200 . #x0220)
- (#x0222 . #x0233)
- (#x0250 . #x02AD)
- (#x02B0 . #x02EE)
- (#x0300 . #x034F)
- (#x0360 . #x036F)
- (#x0374 . #x0375)
- #x037A #x037E
- (#x0384 . #x038A)
- #x038C
- (#x038E . #x03A1)
- (#x03A3 . #x03CE)
- (#x03D0 . #x03F6)
- (#x0400 . #x0486)
- (#x0488 . #x04CE)
- (#x04D0 . #x04F5)
- (#x04F8 . #x04F9)
- (#x0500 . #x050F)
- (#x0531 . #x0556)
- (#x0559 . #x055F)
- (#x0561 . #x0587)
- (#x0589 . #x058A)
- (#x05B0 . #x05B9)
- (#x05BB . #x05C4)
- (#x05D0 . #x05EA)
- (#x05F0 . #x05F4)
- (#x10D0 . #x10F8)
- #x10FB
- (#x1E00 . #x1E9B)
- (#x1EA0 . #x1EF9)
- (#x1F00 . #x1F15)
- (#x1F18 . #x1F1D)
- (#x1F20 . #x1F45)
- (#x1F48 . #x1F4D)
- (#x1F50 . #x1F57)
- #x1F59 #x1F5B #x1F5D
- (#x1F5F . #x1F7D)
- (#x1F80 . #x1FB4)
- (#x1FB6 . #x1FC4)
- (#x1FC6 . #x1FD3)
- (#x1FD6 . #x1FDB)
- (#x1FDD . #x1FEF)
- (#x1FF2 . #x1FF4)
- (#x1FF6 . #x1FFE)
- (#x2000 . #x200A)
- (#x2010 . #x2027)
- (#x202F . #x2052)
- #x2057
- (#x205F . #x2063)
- (#x2070 . #x2071)
- (#x2074 . #x208E)
- (#x20A0 . #x20B1)
- (#x20D0 . #x20EA)
- (#x2100 . #x213A)
- (#x213D . #x214B)
- (#x2153 . #x2183)
- (#x2190 . #x21FF)
- (#x2200 . #x22FF)
- (#x2300 . #x23CE)
- (#x2400 . #x2426)
- (#x2440 . #x244A)
- (#x2500 . #x25FF)
- (#x2600 . #x2613)
- (#x2616 . #x2617)
- (#x2619 . #x267D)
- (#x2680 . #x2689)
- (#x27E6 . #x27EB)
- (#x27F5 . #x27FF)
- (#x2A00 . #x2A06)
- #x2A1D #x2A3F #x303F
- (#xFB00 . #xFB06)
- (#xFB13 . #xFB17)
- (#xFB1D . #xFB36)
- (#xFB38 . #xFB3C)
- #xFB3E
- (#xFB40 . #xFB41)
- (#xFB43 . #xFB44)
- (#xFB46 . #xFB4F)
- (#xFE20 . #xFE23)
- (#xFF61 . #xFF9F)
- #xFFFD]
- "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)
- #x0192
- (#x01FA . #x01FF)
- (#x02C6 . #x02C7)
- #x02C9
- (#x02D8 . #x02DB)
- #x02DD
- (#x0384 . #x038A)
- #x038C
- (#x038E . #x03A1)
- (#x03A3 . #x03CE)
- (#x0401 . #x040C)
- (#x040E . #x044F)
- (#x0451 . #x045C)
- (#x045E . #x045F)
- (#x0490 . #x0491)
- (#x1E80 . #x1E85)
- (#x1EF2 . #x1EF3)
- (#x2013 . #x2015)
- (#x2017 . #x201E)
- (#x2020 . #x2022)
- #x2026 #x2030
- (#x2032 . #x2033)
- (#x2039 . #x203A)
- #x203C #x203E #x2044 #x207F
- (#x20A3 . #x20A4)
- #x20A7 #x20AC #x2105 #x2113 #x2116 #x2122 #x2126 #x212E
- (#x215B . #x215E)
- (#x2190 . #x2195)
- #x21A8 #x2202 #x2206 #x220F
- (#x2211 . #x2212)
- #x2215
- (#x2219 . #x221A)
- (#x221E . #x221F)
- #x2229 #x222B #x2248
- (#x2260 . #x2261)
- (#x2264 . #x2265)
- #x2302 #x2310
- (#x2320 . #x2321)
- #x2500 #x2502 #x250C #x2510 #x2514 #x2518 #x251C #x2524
- #x252C #x2534 #x253C
- (#x2550 . #x256C)
- #x2580 #x2584 #x2588 #x258C
- (#x2590 . #x2593)
- (#x25A0 . #x25A1)
- (#x25AA . #x25AC)
- #x25B2 #x25BA #x25BC #x25C4
- (#x25CA . #x25CB)
- #x25CF
- (#x25D8 . #x25D9)
- #x25E6
- (#x263A . #x263C)
- #x2640 #x2642 #x2660 #x2663
- (#x2665 . #x2666)
- (#x266A . #x266B)
- (#xFB01 . #xFB02)]
- "Glyph set corresponding to Windows Glyph List 4.")
-
-(defvar nxml-glyph-set-functions nil
- "Abnormal hook for determining the set of glyphs in a face.
-Each function in this hook is called in turn, unless one of them
-returns non-nil. Each function is called with 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 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-functions'.")
-
-(define-obsolete-variable-alias 'nxml-glyph-set-hook
- 'nxml-glyph-set-functions "24.3")
-
-(defvar nxml-glyph-set nil
- "Used by `nxml-glyph-set-functions' to return set of glyphs in a FACE.
-This should dynamically bound by any function that runs
-`nxml-glyph-set-functions'. The value must be either nil representing an
-empty set or a vector. Each member of the vector is either a single
-integer or a cons (FIRST . LAST) representing the range of integers
-from FIRST to LAST. An integer represents a glyph with that Unicode
-code-point. The vector must be ordered.")
-
-(defun nxml-x-set-glyph-set (face)
- (setq nxml-glyph-set
- (if (equal (face-attribute face :family) "misc-fixed")
- nxml-misc-fixed-3-glyph-set
- nxml-wgl4-glyph-set)))
-
-(defun nxml-w32-set-glyph-set (face)
- (setq nxml-glyph-set nxml-wgl4-glyph-set))
-
-(defun nxml-window-system-set-glyph-set (face)
- (setq nxml-glyph-set nxml-latin1-glyph-set))
-
-(defun nxml-terminal-set-glyph-set (face)
- (setq nxml-glyph-set nxml-ascii-glyph-set))
-
-(add-hook 'nxml-glyph-set-functions
- (or (cdr (assq window-system
- '((x . nxml-x-set-glyph-set)
- (w32 . nxml-w32-set-glyph-set)
- (nil . nxml-terminal-set-glyph-set))))
- 'nxml-window-system-set-glyph-set)
- t)
-
-;;;###autoload
-(defun nxml-glyph-display-string (n face)
- "Return a string that can display a glyph for Unicode code-point N.
-FACE gives the face that will be used for displaying the string.
-Return nil if the face cannot display a glyph for N."
- (let ((nxml-glyph-set nil))
- (run-hook-with-args-until-success 'nxml-glyph-set-functions face)
- (and nxml-glyph-set
- (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))
- found mid mid-val mid-start-val mid-end-val)
- (while (> end start)
- (setq mid (+ start
- (/ (- end start) 2)))
- (setq mid-val (aref v mid))
- (if (consp mid-val)
- (setq mid-start-val (car mid-val)
- mid-end-val (cdr mid-val))
- (setq mid-start-val mid-val
- mid-end-val mid-val))
- (cond ((and (<= mid-start-val n)
- (<= n mid-end-val))
- (setq found t)
- (setq start end))
- ((< n mid-start-val)
- (setq end mid))
- (t
- (setq start
- (if (eq start mid)
- end
- mid)))))
- found))
-
-(provide 'nxml-glyph)
-
-;;; nxml-glyph.el ends here
diff --git a/lisp/nxml/nxml-maint.el b/lisp/nxml/nxml-maint.el
index 73abfd9ac96..5d24d9b3138 100644
--- a/lisp/nxml/nxml-maint.el
+++ b/lisp/nxml/nxml-maint.el
@@ -1,6 +1,6 @@
-;;; nxml-maint.el --- commands for maintainers of nxml-*.el
+;;; nxml-maint.el --- commands for maintainers of nxml-*.el -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
@@ -24,48 +24,6 @@
;;; Code:
-;;; Generating files with Unicode char names.
-
-(require 'nxml-uchnm)
-
-(defun nxml-create-unicode-char-name-sets (file)
- "Generate files containing char names from Unicode standard."
- (interactive "fUnicodeData file: ")
- (mapc (lambda (block)
- (let ((nameset (nxml-unicode-block-char-name-set (nth 0 block))))
- (save-excursion
- (find-file (concat (get nameset 'nxml-char-name-set-file)
- ".el"))
- (erase-buffer)
- (insert "(nxml-define-char-name-set '")
- (prin1 nameset (current-buffer))
- (insert "\n '())\n")
- (goto-char (- (point) 3)))))
- nxml-unicode-blocks)
- (save-excursion
- (find-file file)
- (goto-char (point-min))
- (let ((blocks nxml-unicode-blocks)
- code name)
- (while (re-search-forward "^\\([0-9A-F]+\\);\\([^<;][^;]*\\);"
- nil
- t)
- (setq code (string-to-number (match-string 1) 16))
- (setq name (match-string 2))
- (while (and blocks
- (> code (nth 2 (car blocks))))
- (setq blocks (cdr blocks)))
- (when (and (<= (nth 1 (car blocks)) code)
- (<= code (nth 2 (car blocks))))
- (save-excursion
- (find-file (concat (get (nxml-unicode-block-char-name-set
- (nth 0 (car blocks)))
- 'nxml-char-name-set-file)
- ".el"))
- (insert "(")
- (prin1 name (current-buffer))
- (insert (format " #x%04X)\n " code))))))))
-
;;; Parsing target repertoire files from ucs-fonts.
;; This is for converting the TARGET? files in
;; http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 0e2fca349a5..db607502889 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -1,6 +1,6 @@
;;; nxml-mode.el --- a new XML mode -*- lexical-binding:t -*-
-;; Copyright (C) 2003-2004, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
@@ -33,7 +33,6 @@
(require 'xmltok)
(require 'nxml-enc)
-(require 'nxml-glyph)
(require 'nxml-util)
(require 'nxml-rap)
(require 'nxml-outln)
@@ -55,9 +54,7 @@
(defcustom nxml-char-ref-display-glyph-flag t
"Non-nil means display glyph following character reference.
-The glyph is displayed in face `nxml-glyph'. The abnormal hook
-`nxml-glyph-set-functions' can be used to change the characters
-for which glyphs are displayed."
+The glyph is displayed in face `nxml-glyph'."
:group 'nxml
:type 'boolean)
@@ -583,8 +580,7 @@ Many aspects this mode can be customized using
(jit-lock-contextually . t)
(font-lock-unfontify-region-function . nxml-unfontify-region)))
- (rng-nxml-mode-init)
- (nxml-enable-unicode-char-name-sets))
+ (with-demoted-errors (rng-nxml-mode-init)))
(defun nxml-cleanup ()
"Clean up after nxml-mode."
@@ -2477,116 +2473,15 @@ and attempts to find another possible way to do the markup."
;;; Character names
-(defvar nxml-char-name-ignore-case t)
-
-(defvar nxml-char-name-alist nil
- "Alist of character names.
-Each member of the list has the form (NAME CODE . NAMESET),
-where NAME is a string naming a character, NAMESET is a symbol
-identifying a set of names and CODE is an integer specifying the
-Unicode scalar value of the named character.
-The NAME will only be used for completion if NAMESET has
-a non-nil `nxml-char-name-set-enabled' property.
-If NAMESET does does not have `nxml-char-name-set-defined' property,
-then it must have a `nxml-char-name-set-file' property and `load'
-will be applied to the value of this property if the nameset
-is enabled.")
-
-(defvar nxml-char-name-table (make-hash-table :test 'eq)
- "Hash table for mapping char codes to names.
-Each key is a Unicode scalar value.
-Each value is a list of pairs of the form (NAMESET . NAME),
-where NAMESET is a symbol identifying a set of names,
-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)
- (put nameset 'nxml-char-name-set-enabled t))
-
-(defun nxml-disable-char-name-set (nameset)
- (put nameset 'nxml-char-name-set-enabled nil))
-
-(defun nxml-char-name-set-enabled-p (nameset)
- (get nameset 'nxml-char-name-set-enabled))
-
-(defun nxml-autoload-char-name-set (nameset file)
- (unless (memq nameset nxml-autoload-char-name-set-list)
- (setq nxml-autoload-char-name-set-list
- (cons nameset nxml-autoload-char-name-set-list)))
- (put nameset 'nxml-char-name-set-file file))
-
-(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."
- (when (get nameset 'nxml-char-name-set-defined)
- (error "Nameset `%s' already defined" nameset))
- (let ((iter alist))
- (while iter
- (let* ((name-code (car iter))
- (name (car name-code))
- (code (cadr name-code)))
- (puthash code
- (cons (cons nameset name)
- (gethash code nxml-char-name-table))
- nxml-char-name-table))
- (setcdr (cdr (car iter)) nameset)
- (setq iter (cdr iter))))
- (setq nxml-char-name-alist
- (nconc alist nxml-char-name-alist))
- (put nameset 'nxml-char-name-set-defined t))
-
-(defun nxml-get-char-name (code)
- (mapc 'nxml-maybe-load-char-name-set nxml-autoload-char-name-set-list)
- (let ((names (gethash code nxml-char-name-table))
- name)
- (while (and names (not name))
- (if (nxml-char-name-set-enabled-p (caar names))
- (setq name (cdar names))
- (setq names (cdr names))))
- name))
-
-(defvar nxml-named-char-history nil)
-
(defun nxml-insert-named-char (arg)
"Insert a character using its name.
The name is read from the minibuffer.
Normally, inserts the character as a numeric character reference.
With a prefix argument, inserts the character directly."
(interactive "*P")
- (mapc 'nxml-maybe-load-char-name-set nxml-autoload-char-name-set-list)
- (let ((name
- (let ((completion-ignore-case nxml-char-name-ignore-case))
- (completing-read "Character name: "
- nxml-char-name-alist
- (lambda (member)
- (get (cddr member) 'nxml-char-name-set-enabled))
- t
- nil
- 'nxml-named-char-history)))
- (alist nxml-char-name-alist)
- elt code)
- (while (and alist (not code))
- (setq elt (assoc name alist))
- (if (get (cddr elt) 'nxml-char-name-set-enabled)
- (setq code (cadr elt))
- (setq alist (cdr (member elt alist)))))
+ (let ((code (read-char-by-name "Character name: ")))
(when code
- (insert (if arg
- (or (decode-char 'ucs code)
- (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))
- (stringp (get sym 'nxml-char-name-set-file)))
- (load (get sym 'nxml-char-name-set-file))))
+ (insert (if arg code (format "&#x%X;" code))))))
(defun nxml-toggle-char-ref-extra-display (arg)
"Toggle the display of extra information for character references."
@@ -2602,9 +2497,11 @@ With a prefix argument, inserts the character directly."
(defun nxml-char-ref-display-extra (start end n)
(when nxml-char-ref-extra-display
- (let ((name (nxml-get-char-name n))
+ (let ((name (or (get-char-code-property n 'name)
+ (get-char-code-property n 'old-name)))
(glyph-string (and nxml-char-ref-display-glyph-flag
- (nxml-glyph-display-string n 'nxml-glyph)))
+ (char-displayable-p n)
+ (string n)))
ov)
(when (or name glyph-string)
(setq ov (make-overlay start end nil t))
diff --git a/lisp/nxml/nxml-ns.el b/lisp/nxml/nxml-ns.el
index e55ecc36b01..81506a4642a 100644
--- a/lisp/nxml/nxml-ns.el
+++ b/lisp/nxml/nxml-ns.el
@@ -1,6 +1,6 @@
;;; nxml-ns.el --- XML namespace processing -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-outln.el b/lisp/nxml/nxml-outln.el
index c87cd5378fa..79e6406f553 100644
--- a/lisp/nxml/nxml-outln.el
+++ b/lisp/nxml/nxml-outln.el
@@ -1,6 +1,6 @@
-;;; nxml-outln.el --- outline support for nXML mode
+;;; nxml-outln.el --- outline support for nXML mode -*- lexical-binding:t -*-
-;; Copyright (C) 2004, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
@@ -248,6 +248,16 @@ customize which elements are recognized as sections and headings."
(interactive)
(nxml-transform-subtree-outline '((hide-children . t))))
+;; These variables are dynamically bound. They are use to pass information to
+;; nxml-section-tag-transform-outline-state.
+
+(defvar nxml-outline-state-transform-exceptions nil)
+(defvar nxml-target-section-pos nil)
+(defvar nxml-depth-in-target-section nil)
+(defvar nxml-outline-state-transform-alist nil)
+
+(defvar nxml-outline-display-section-tag-function nil)
+
(defun nxml-hide-other ()
"Hide text content other than that directly in the section containing point.
Hide headings other than those of ancestors of that section and their
@@ -275,14 +285,6 @@ customize which elements are recognized as sections and headings."
(nxml-transform-buffer-outline '((nil . hide-children)
(t . hide-children)))))
-;; These variables are dynamically bound. They are use to pass information to
-;; nxml-section-tag-transform-outline-state.
-
-(defvar nxml-outline-state-transform-exceptions nil)
-(defvar nxml-target-section-pos nil)
-(defvar nxml-depth-in-target-section nil)
-(defvar nxml-outline-state-transform-alist nil)
-
(defun nxml-transform-buffer-outline (alist)
(let ((nxml-target-section-pos nil)
(nxml-depth-in-target-section 0)
@@ -350,7 +352,7 @@ customize which elements are recognized as sections and headings."
(defun nxml-section-tag-transform-outline-state (startp
section-start-pos
&optional
- heading-start-pos)
+ _heading-start-pos)
(if (not startp)
(setq nxml-depth-in-target-section
(and nxml-depth-in-target-section
@@ -427,8 +429,6 @@ customize which elements are recognized as sections and headings."
(nxml-outline-error
(nxml-report-outline-error "Cannot display outline: %s" err)))))
-(defvar nxml-outline-display-section-tag-function nil)
-
(defun nxml-outline-display-rest (outline-state start-tag-indent tag-qnames)
"Display up to and including the end of the current element.
OUTLINE-STATE can be nil, t, hide-children. START-TAG-INDENT is the
@@ -789,7 +789,7 @@ no new overlay will be created."
(defun nxml-end-of-heading ()
"Move from the start of the content of the heading to the end.
Do not move past the end of the line."
- (let ((pos (condition-case err
+ (let ((pos (condition-case nil
(and (nxml-scan-element-forward (point) t)
xmltok-start)
(nxml-scan-error nil))))
diff --git a/lisp/nxml/nxml-parse.el b/lisp/nxml/nxml-parse.el
index d8523ee9dbe..edf012921a9 100644
--- a/lisp/nxml/nxml-parse.el
+++ b/lisp/nxml/nxml-parse.el
@@ -1,6 +1,6 @@
-;;; nxml-parse.el --- XML parser, sharing infrastructure with nxml-mode
+;;; nxml-parse.el --- XML parser, sharing infrastructure with nxml-mode -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el
index 5689b12c41e..e68c8a427fd 100644
--- a/lisp/nxml/nxml-rap.el
+++ b/lisp/nxml/nxml-rap.el
@@ -1,6 +1,6 @@
-;;; nxml-rap.el --- low-level support for random access parsing for nXML mode
+;;; nxml-rap.el --- low-level support for random access parsing for nXML mode -*- lexical-binding:t -*-
-;; Copyright (C) 2003-2004, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2004, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/nxml-uchnm.el b/lisp/nxml/nxml-uchnm.el
deleted file mode 100644
index 1d92ab38791..00000000000
--- a/lisp/nxml/nxml-uchnm.el
+++ /dev/null
@@ -1,251 +0,0 @@
-;;; nxml-uchnm.el --- support for Unicode standard cha names in nxml-mode
-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
-
-;; Author: James Clark
-;; Keywords: wp, hypermedia, languages, XML
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This enables the use of the character names defined in the Unicode
-;; Standard. The use of the names can be controlled on a per-block
-;; basis, so as both to reduce memory usage and loading time,
-;; and to make completion work better.
-
-;;; Code:
-
-(require 'nxml-mode)
-
-(defconst nxml-unicode-blocks
- '(("Basic Latin" #x0000 #x007F)
- ("Latin-1 Supplement" #x0080 #x00FF)
- ("Latin Extended-A" #x0100 #x017F)
- ("Latin Extended-B" #x0180 #x024F)
- ("IPA Extensions" #x0250 #x02AF)
- ("Spacing Modifier Letters" #x02B0 #x02FF)
- ("Combining Diacritical Marks" #x0300 #x036F)
- ("Greek and Coptic" #x0370 #x03FF)
- ("Cyrillic" #x0400 #x04FF)
- ("Cyrillic Supplementary" #x0500 #x052F)
- ("Armenian" #x0530 #x058F)
- ("Hebrew" #x0590 #x05FF)
- ("Arabic" #x0600 #x06FF)
- ("Syriac" #x0700 #x074F)
- ("Thaana" #x0780 #x07BF)
- ("Devanagari" #x0900 #x097F)
- ("Bengali" #x0980 #x09FF)
- ("Gurmukhi" #x0A00 #x0A7F)
- ("Gujarati" #x0A80 #x0AFF)
- ("Oriya" #x0B00 #x0B7F)
- ("Tamil" #x0B80 #x0BFF)
- ("Telugu" #x0C00 #x0C7F)
- ("Kannada" #x0C80 #x0CFF)
- ("Malayalam" #x0D00 #x0D7F)
- ("Sinhala" #x0D80 #x0DFF)
- ("Thai" #x0E00 #x0E7F)
- ("Lao" #x0E80 #x0EFF)
- ("Tibetan" #x0F00 #x0FFF)
- ("Myanmar" #x1000 #x109F)
- ("Georgian" #x10A0 #x10FF)
- ("Hangul Jamo" #x1100 #x11FF)
- ("Ethiopic" #x1200 #x137F)
- ("Cherokee" #x13A0 #x13FF)
- ("Unified Canadian Aboriginal Syllabics" #x1400 #x167F)
- ("Ogham" #x1680 #x169F)
- ("Runic" #x16A0 #x16FF)
- ("Tagalog" #x1700 #x171F)
- ("Hanunoo" #x1720 #x173F)
- ("Buhid" #x1740 #x175F)
- ("Tagbanwa" #x1760 #x177F)
- ("Khmer" #x1780 #x17FF)
- ("Mongolian" #x1800 #x18AF)
- ("Latin Extended Additional" #x1E00 #x1EFF)
- ("Greek Extended" #x1F00 #x1FFF)
- ("General Punctuation" #x2000 #x206F)
- ("Superscripts and Subscripts" #x2070 #x209F)
- ("Currency Symbols" #x20A0 #x20CF)
- ("Combining Diacritical Marks for Symbols" #x20D0 #x20FF)
- ("Letterlike Symbols" #x2100 #x214F)
- ("Number Forms" #x2150 #x218F)
- ("Arrows" #x2190 #x21FF)
- ("Mathematical Operators" #x2200 #x22FF)
- ("Miscellaneous Technical" #x2300 #x23FF)
- ("Control Pictures" #x2400 #x243F)
- ("Optical Character Recognition" #x2440 #x245F)
- ("Enclosed Alphanumerics" #x2460 #x24FF)
- ("Box Drawing" #x2500 #x257F)
- ("Block Elements" #x2580 #x259F)
- ("Geometric Shapes" #x25A0 #x25FF)
- ("Miscellaneous Symbols" #x2600 #x26FF)
- ("Dingbats" #x2700 #x27BF)
- ("Miscellaneous Mathematical Symbols-A" #x27C0 #x27EF)
- ("Supplemental Arrows-A" #x27F0 #x27FF)
- ("Braille Patterns" #x2800 #x28FF)
- ("Supplemental Arrows-B" #x2900 #x297F)
- ("Miscellaneous Mathematical Symbols-B" #x2980 #x29FF)
- ("Supplemental Mathematical Operators" #x2A00 #x2AFF)
- ("CJK Radicals Supplement" #x2E80 #x2EFF)
- ("Kangxi Radicals" #x2F00 #x2FDF)
- ("Ideographic Description Characters" #x2FF0 #x2FFF)
- ("CJK Symbols and Punctuation" #x3000 #x303F)
- ("Hiragana" #x3040 #x309F)
- ("Katakana" #x30A0 #x30FF)
- ("Bopomofo" #x3100 #x312F)
- ("Hangul Compatibility Jamo" #x3130 #x318F)
- ("Kanbun" #x3190 #x319F)
- ("Bopomofo Extended" #x31A0 #x31BF)
- ("Katakana Phonetic Extensions" #x31F0 #x31FF)
- ("Enclosed CJK Letters and Months" #x3200 #x32FF)
- ("CJK Compatibility" #x3300 #x33FF)
- ("CJK Unified Ideographs Extension A" #x3400 #x4DBF)
- ;;("CJK Unified Ideographs" #x4E00 #x9FFF)
- ("Yi Syllables" #xA000 #xA48F)
- ("Yi Radicals" #xA490 #xA4CF)
- ;;("Hangul Syllables" #xAC00 #xD7AF)
- ;;("High Surrogates" #xD800 #xDB7F)
- ;;("High Private Use Surrogates" #xDB80 #xDBFF)
- ;;("Low Surrogates" #xDC00 #xDFFF)
- ;;("Private Use Area" #xE000 #xF8FF)
- ;;("CJK Compatibility Ideographs" #xF900 #xFAFF)
- ("Alphabetic Presentation Forms" #xFB00 #xFB4F)
- ("Arabic Presentation Forms-A" #xFB50 #xFDFF)
- ("Variation Selectors" #xFE00 #xFE0F)
- ("Combining Half Marks" #xFE20 #xFE2F)
- ("CJK Compatibility Forms" #xFE30 #xFE4F)
- ("Small Form Variants" #xFE50 #xFE6F)
- ("Arabic Presentation Forms-B" #xFE70 #xFEFF)
- ("Halfwidth and Fullwidth Forms" #xFF00 #xFFEF)
- ("Specials" #xFFF0 #xFFFF)
- ("Old Italic" #x10300 #x1032F)
- ("Gothic" #x10330 #x1034F)
- ("Deseret" #x10400 #x1044F)
- ("Byzantine Musical Symbols" #x1D000 #x1D0FF)
- ("Musical Symbols" #x1D100 #x1D1FF)
- ("Mathematical Alphanumeric Symbols" #x1D400 #x1D7FF)
- ;;("CJK Unified Ideographs Extension B" #x20000 #x2A6DF)
- ;;("CJK Compatibility Ideographs Supplement" #x2F800 #x2FA1F)
- ("Tags" #xE0000 #xE007F)
- ;;("Supplementary Private Use Area-A" #xF0000 #xFFFFF)
- ;;("Supplementary Private Use Area-B" #x100000 #x10FFFF)
- )
- "List of Unicode blocks.
-For each block there is a list (NAME FIRST LAST), where
-NAME is a string giving the official name of the block,
-FIRST is the first code-point and LAST is the last code-point.
-Blocks containing only characters with algorithmic names or no names
-are omitted.")
-
-(defun nxml-unicode-block-char-name-set (name)
- "Return a symbol for a block whose official Unicode name is NAME.
-The symbol is generated by downcasing and replacing each space
-by a hyphen."
- (intern (replace-regexp-in-string " " "-" (downcase name))))
-
-;; This is intended to be a superset of the coverage
-;; of existing standard entity sets.
-(defvar nxml-enabled-unicode-blocks-default
- '(basic-latin
- latin-1-supplement
- latin-extended-a
- latin-extended-b
- ipa-extensions
- spacing-modifier-letters
- combining-diacritical-marks
- greek-and-coptic
- cyrillic
- general-punctuation
- superscripts-and-subscripts
- currency-symbols
- combining-diacritical-marks-for-symbols
- letterlike-symbols
- number-forms
- arrows
- mathematical-operators
- miscellaneous-technical
- control-pictures
- optical-character-recognition
- enclosed-alphanumerics
- box-drawing
- block-elements
- geometric-shapes
- miscellaneous-symbols
- dingbats
- miscellaneous-mathematical-symbols-a
- supplemental-arrows-a
- supplemental-arrows-b
- miscellaneous-mathematical-symbols-b
- supplemental-mathematical-operators
- cjk-symbols-and-punctuation
- alphabetic-presentation-forms
- variation-selectors
- small-form-variants
- specials
- mathematical-alphanumeric-symbols)
- "Default value for `nxml-enabled-unicode-blocks'.")
-
-(mapc (lambda (block)
- (nxml-autoload-char-name-set
- (nxml-unicode-block-char-name-set (car block))
- (expand-file-name
- (format "nxml/%05X-%05X"
- (nth 1 block)
- (nth 2 block))
- data-directory)))
- nxml-unicode-blocks)
-
-;; Internal flag to control whether customize reloads the character tables.
-;; Should be set the first time the
-(defvar nxml-internal-unicode-char-name-sets-enabled nil)
-
-(defcustom nxml-enabled-unicode-blocks nxml-enabled-unicode-blocks-default
- "List of Unicode blocks for which Unicode character names are enabled.
-Each block is identified by a symbol derived from the name
-of the block by downcasing and replacing each space by a hyphen."
- :group 'nxml
- :set (lambda (sym value)
- (set-default 'nxml-enabled-unicode-blocks value)
- (when nxml-internal-unicode-char-name-sets-enabled
- (nxml-enable-unicode-char-name-sets)))
- :type (cons 'set
- (mapcar (lambda (block)
- `(const :tag ,(format "%s (%04X-%04X)"
- (nth 0 block)
- (nth 1 block)
- (nth 2 block))
- ,(nxml-unicode-block-char-name-set
- (nth 0 block))))
- nxml-unicode-blocks)))
-
-;;;###autoload
-(defun nxml-enable-unicode-char-name-sets ()
- "Enable the use of Unicode standard names for characters.
-The Unicode blocks for which names are enabled is controlled by
-the variable `nxml-enabled-unicode-blocks'."
- (interactive)
- (setq nxml-internal-unicode-char-name-sets-enabled t)
- (mapc (lambda (block)
- (nxml-disable-char-name-set
- (nxml-unicode-block-char-name-set (car block))))
- nxml-unicode-blocks)
- (mapc (lambda (nameset)
- (nxml-enable-char-name-set nameset))
- nxml-enabled-unicode-blocks))
-
-(provide 'nxml-uchnm)
-
-;;; nxml-uchnm.el ends here
diff --git a/lisp/nxml/nxml-util.el b/lisp/nxml/nxml-util.el
index 27b43824312..14b887ea085 100644
--- a/lisp/nxml/nxml-util.el
+++ b/lisp/nxml/nxml-util.el
@@ -1,6 +1,6 @@
;;; nxml-util.el --- utility functions for nxml-*.el -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el
index 31864a4dfc3..a699e9e3d96 100644
--- a/lisp/nxml/rng-cmpct.el
+++ b/lisp/nxml/rng-cmpct.el
@@ -1,6 +1,6 @@
-;;; rng-cmpct.el --- parsing of RELAX NG Compact Syntax schemas
+;;; rng-cmpct.el --- parsing of RELAX NG Compact Syntax schemas -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-dt.el b/lisp/nxml/rng-dt.el
index 855bf93e8a9..a3cb8bc6aa5 100644
--- a/lisp/nxml/rng-dt.el
+++ b/lisp/nxml/rng-dt.el
@@ -1,6 +1,6 @@
-;;; rng-dt.el --- datatype library interface for RELAX NG
+;;; rng-dt.el --- datatype library interface for RELAX NG -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -57,7 +57,7 @@ a datatype library.")
(t
(rng-dt-error "There is no built-in datatype %s" name))))
-(put (rng-make-datatypes-uri "") 'rng-dt-compile 'rng-dt-builtin-compile)
+(put (rng-make-datatypes-uri "") 'rng-dt-compile #'rng-dt-builtin-compile)
(provide 'rng-dt)
diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el
index 601e54aeef5..376e9169d37 100644
--- a/lisp/nxml/rng-loc.el
+++ b/lisp/nxml/rng-loc.el
@@ -1,6 +1,6 @@
-;;; rng-loc.el --- locate the schema to use for validation
+;;; rng-loc.el --- Locate the schema to use for validation -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -31,10 +31,9 @@
(require 'rng-util)
(require 'xmltok)
-(defvar rng-current-schema-file-name nil
+(defvar-local rng-current-schema-file-name nil
"Filename of schema being used for current buffer.
It is nil if using a vacuous schema.")
-(make-variable-buffer-local 'rng-current-schema-file-name)
(defvar rng-schema-locating-files-default
(list "schemas.xml" (expand-file-name "schema/schemas.xml" data-directory))
@@ -233,11 +232,11 @@ or nil."
rules))))))))
best-so-far))
-(put 'documentElement 'rng-rule-matcher 'rng-match-document-element-rule)
-(put 'namespace 'rng-rule-matcher 'rng-match-namespace-rule)
-(put 'uri 'rng-rule-matcher 'rng-match-uri-rule)
-(put 'transformURI 'rng-rule-matcher 'rng-match-transform-uri-rule)
-(put 'default 'rng-rule-matcher 'rng-match-default-rule)
+(put 'documentElement 'rng-rule-matcher #'rng-match-document-element-rule)
+(put 'namespace 'rng-rule-matcher #'rng-match-namespace-rule)
+(put 'uri 'rng-rule-matcher #'rng-match-uri-rule)
+(put 'transformURI 'rng-rule-matcher #'rng-match-transform-uri-rule)
+(put 'default 'rng-rule-matcher #'rng-match-default-rule)
(defun rng-match-document-element-rule (props)
(let ((document-element (rng-document-element))
diff --git a/lisp/nxml/rng-maint.el b/lisp/nxml/rng-maint.el
index be42e1029c1..32a041e0c17 100644
--- a/lisp/nxml/rng-maint.el
+++ b/lisp/nxml/rng-maint.el
@@ -1,6 +1,6 @@
-;;; rng-maint.el --- commands for RELAX NG maintainers
+;;; rng-maint.el --- commands for RELAX NG maintainers -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-match.el b/lisp/nxml/rng-match.el
index ef55e85f300..d2b629e8d83 100644
--- a/lisp/nxml/rng-match.el
+++ b/lisp/nxml/rng-match.el
@@ -1,6 +1,6 @@
;;; rng-match.el --- matching of RELAX NG patterns against XML events -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -56,9 +56,8 @@ Used to detect invalid recursive references.")
;;; Inline functions
(defsubst rng-update-match-state (new-state)
- (if (and (eq new-state rng-not-allowed-ipattern)
- (not (eq rng-match-state rng-not-allowed-ipattern)))
- nil
+ (if (eq new-state rng-not-allowed-ipattern)
+ (eq rng-match-state rng-not-allowed-ipattern)
(setq rng-match-state new-state)
t))
diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el
index 30ae462d851..85e4bf33ee0 100644
--- a/lisp/nxml/rng-nxml.el
+++ b/lisp/nxml/rng-nxml.el
@@ -1,6 +1,6 @@
-;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode
+;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -349,7 +349,7 @@ Return non-nil if in a context it understands."
(recover-fun (funcall recover-fun prefix (cdr qname)))))
(cons (and defaultp (nxml-ns-get-default)) (cdr qname)))))
-(defun rng-start-tag-expand-recover (prefix local-name)
+(defun rng-start-tag-expand-recover (_prefix local-name)
(let ((ns (rng-match-infer-start-tag-namespace local-name)))
(and ns
(cons ns local-name))))
@@ -386,7 +386,7 @@ set `xmltok-dtd'. Returns the position of the end of the token."
(save-restriction
(widen)
(nxml-with-invisible-motion
- (if (= pos 1)
+ (if (= pos (point-min))
(rng-set-initial-state)
(let ((state (get-text-property (1- pos) 'rng-state)))
(cond (state
diff --git a/lisp/nxml/rng-parse.el b/lisp/nxml/rng-parse.el
index 30878b4aac4..3ae4b5cc9c4 100644
--- a/lisp/nxml/rng-parse.el
+++ b/lisp/nxml/rng-parse.el
@@ -1,6 +1,6 @@
-;;; rng-parse.el --- parse an XML file and validate it against a schema
+;;; rng-parse.el --- parse an XML file and validate it against a schema -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-pttrn.el b/lisp/nxml/rng-pttrn.el
index 3324dc40617..e847f5e02a8 100644
--- a/lisp/nxml/rng-pttrn.el
+++ b/lisp/nxml/rng-pttrn.el
@@ -1,6 +1,6 @@
-;;; rng-pttrn.el --- RELAX NG patterns
+;;; rng-pttrn.el --- RELAX NG patterns -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-uri.el b/lisp/nxml/rng-uri.el
index 98b43848f01..8fc0a01e293 100644
--- a/lisp/nxml/rng-uri.el
+++ b/lisp/nxml/rng-uri.el
@@ -1,6 +1,6 @@
-;;; rng-uri.el --- URI parsing and manipulation
+;;; rng-uri.el --- URI parsing and manipulation -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/rng-util.el b/lisp/nxml/rng-util.el
index cde41248bee..4c14e2b6597 100644
--- a/lisp/nxml/rng-util.el
+++ b/lisp/nxml/rng-util.el
@@ -1,6 +1,6 @@
;;; rng-util.el --- utility functions for RELAX NG library
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index 61a96545a82..9b0b4df67f8 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -1,6 +1,6 @@
-;;; rng-valid.el --- real-time validation of XML using RELAX NG
+;;; rng-valid.el --- real-time validation of XML using RELAX NG -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -430,13 +430,13 @@ The schema is set like `rng-auto-set-schema'."
(when (buffer-live-p buffer) ; bug#13999
(with-current-buffer buffer
(if rng-validate-mode
- (if (let ((rng-validate-display-point (point))
- (rng-validate-display-modified-p (buffer-modified-p)))
- (rng-do-some-validation 'rng-validate-while-idle-continue-p))
- (force-mode-line-update)
- (rng-validate-done))
- ;; must have done kill-all-local-variables
- (rng-kill-timers)))))
+ (if (let ((rng-validate-display-point (point))
+ (rng-validate-display-modified-p (buffer-modified-p)))
+ (rng-do-some-validation 'rng-validate-while-idle-continue-p))
+ (force-mode-line-update)
+ (rng-validate-done))
+ ;; Must have done kill-all-local-variables.
+ (rng-kill-timers)))))
(defun rng-validate-quick-while-idle (buffer)
(when (buffer-live-p buffer) ; bug#13999
@@ -709,7 +709,7 @@ Return t if there is work to do, nil otherwise."
;; If we don't do this, then the front delimiter can move
;; past the end delimiter.
-(defun rng-error-modified (overlay after-p beg end &optional pre-change-len)
+(defun rng-error-modified (overlay after-p _beg _end &optional _pre-change-len)
(when (and after-p
(overlay-start overlay) ; check not deleted
(>= (overlay-start overlay)
diff --git a/lisp/nxml/rng-xsd.el b/lisp/nxml/rng-xsd.el
index 9b585c0b7b8..c0989ae1073 100644
--- a/lisp/nxml/rng-xsd.el
+++ b/lisp/nxml/rng-xsd.el
@@ -1,6 +1,6 @@
-;;; rng-xsd.el --- W3C XML Schema datatypes library for RELAX NG
+;;; rng-xsd.el --- W3C XML Schema datatypes library for RELAX NG -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, RelaxNG
@@ -42,7 +42,7 @@
;;;###autoload
(put 'http://www.w3.org/2001/XMLSchema-datatypes
'rng-dt-compile
- 'rng-xsd-compile)
+ #'rng-xsd-compile)
;;;###autoload
(defun rng-xsd-compile (name params)
@@ -50,9 +50,9 @@
NAME is a symbol giving the local name of the datatype. PARAMS is a
list of pairs (PARAM-NAME . PARAM-VALUE) where PARAM-NAME is a symbol
giving the name of the parameter and PARAM-VALUE is a string giving
-its value. If NAME or PARAMS are invalid, it calls rng-dt-error
+its value. If NAME or PARAMS are invalid, it calls `rng-dt-error'
passing it arguments in the same style as format; the value from
-rng-dt-error will be returned. Otherwise, it returns a list. The
+`rng-dt-error' will be returned. Otherwise, it returns a list. The
first member of the list is t if any string is a legal value for the
datatype and nil otherwise. The second argument is a symbol; this
symbol will be called as a function passing it a string followed by
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index fe6a6050be9..8fc66c99a45 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -1,6 +1,6 @@
;;; xmltok.el --- XML tokenization -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML
diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el
index 7b1e6165583..a3f476d00be 100644
--- a/lisp/nxml/xsd-regexp.el
+++ b/lisp/nxml/xsd-regexp.el
@@ -1,6 +1,6 @@
-;;; xsd-regexp.el --- translate W3C XML Schema regexps to Emacs regexps
+;;; xsd-regexp.el --- translate W3C XML Schema regexps to Emacs regexps -*- lexical-binding:t -*-
-;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
;; Author: James Clark
;; Keywords: wp, hypermedia, languages, XML, regexp
@@ -147,7 +147,7 @@ ranges are merged wherever possible."
(defun xsdre-range-list-difference (orig subtract)
"Return a range-list for the difference of two range-lists."
(when orig
- (let (new head next first last)
+ (let (new head first last)
(while orig
(setq head (car orig))
(setq first (xsdre-range-first head))
@@ -745,7 +745,7 @@ Code is inserted into the current buffer."
(save-excursion
(goto-char start)
(down-list 2)
- (while (condition-case err
+ (while (condition-case nil
(progn
(forward-sexp)
t)