summaryrefslogtreecommitdiff
path: root/lisp/nxml/xmltok.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-10-07 09:54:48 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-10-07 09:54:48 -0400
commitda3e5ebb8d6b69f82191ac6e6dc63926f210db68 (patch)
tree2b4d370db8fdab4446469051f7f284c6ab44b7c1 /lisp/nxml/xmltok.el
parent2f84ba10862ccbd5fb70044b160c43e4c00b5822 (diff)
downloademacs-da3e5ebb8d6b69f82191ac6e6dc63926f210db68.tar.gz
* lisp/nxml/nxml-mode.el: Use lexical-binding and syntax-propertize.
(font-lock-beg, font-lock-end): Move before first use. (nxml-mode): Use syntax-propertize-function. (nxml-after-change, nxml-after-change1): Adjust accordingly. (nxml-extend-after-change-region): Remove. * lisp/nxml/nxml-ns.el: Use lexical-binding. (nxml-ns-save): Use `declare'. (nxml-ns-prefixes-for): Avoid add-to-list. * lisp/nxml/nxml-util.el: Use lexical-binding. (nxml-with-degradation-on-error, nxml-with-invisible-motion): Use `declare'. * lisp/nxml/rng-match.el: Use lexical-binding. (rng--ipattern): Use cl-defstruct. (rng-compute-start-tag-open-deriv, rng-compute-start-attribute-deriv) (rng-cons-group-after, rng-subst-group-after) (rng-subst-interleave-after, rng-apply-after, rng-compute-data-deriv): Use closures instead of `(lambda...). * lisp/nxml/xmltok.el: Use lexical-binding. (xmltok-save): Use `declare'. (xmltok-unclosed-reparse-p, xmltok-semi-closed-reparse-p): Remove.
Diffstat (limited to 'lisp/nxml/xmltok.el')
-rw-r--r--lisp/nxml/xmltok.el38
1 files changed, 4 insertions, 34 deletions
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 9bfcd21618d..a4ad0de853e 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -1,4 +1,4 @@
-;;; xmltok.el --- XML tokenization
+;;; xmltok.el --- XML tokenization -*- lexical-binding:t -*-
;; Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
@@ -142,6 +142,7 @@ string giving the error message and START and END are integers
indicating the position of the error.")
(defmacro xmltok-save (&rest body)
+ (declare (indent 0) (debug t))
`(let (xmltok-type
xmltok-start
xmltok-name-colon
@@ -152,9 +153,6 @@ indicating the position of the error.")
xmltok-errors)
,@body))
-(put 'xmltok-save 'lisp-indent-function 0)
-(def-edebug-spec xmltok-save t)
-
(defsubst xmltok-attribute-name-start (att)
(aref att 0))
@@ -411,7 +409,6 @@ Return the type of the token."
(eval-when-compile
(let* ((or "\\|")
(open "\\(?:")
- (gopen "\\(")
(close "\\)")
(name-start-char "[_[:alpha:]]")
(name-continue-not-start-char "[-.[:digit:]]")
@@ -988,33 +985,6 @@ Return the type of the token."
(xmltok-valid-char-p n)
n)))
-(defun xmltok-unclosed-reparse-p (change-start
- change-end
- pre-change-length
- start
- end
- delimiter)
- (let ((len-1 (1- (length delimiter))))
- (goto-char (max start (- change-start len-1)))
- (search-forward delimiter (min end (+ change-end len-1)) t)))
-
-;; Handles a <!-- with the next -- not followed by >
-
-(defun xmltok-semi-closed-reparse-p (change-start
- change-end
- pre-change-length
- start
- end
- delimiter
- delimiter-length)
- (or (<= (- end delimiter-length) change-end)
- (xmltok-unclosed-reparse-p change-start
- change-end
- pre-change-length
- start
- end
- delimiter)))
-
(defun xmltok-valid-char-p (n)
"Return non-nil if N is the Unicode code of a valid XML character."
(cond ((< n #x20) (memq n '(#xA #xD #x9)))
@@ -1072,7 +1042,7 @@ Adds to `xmltok-errors' as appropriate."
(setq xmltok-dtd xmltok-predefined-entity-alist)
(xmltok-scan-xml-declaration)
(xmltok-next-prolog-token)
- (while (condition-case err
+ (while (condition-case nil
(when (xmltok-parse-prolog-item)
(xmltok-next-prolog-token))
(xmltok-markup-declaration-parse-error
@@ -1371,7 +1341,7 @@ If LIMIT is non-nil, then do not consider characters beyond LIMIT."
(t
(let ((xmltok-start (1- (point)))
xmltok-type xmltok-replacement)
- (xmltok-scan-after-amp (lambda (start end)))
+ (xmltok-scan-after-amp (lambda (_start _end)))
(cond ((eq xmltok-type 'char-ref)
(setq value-parts
(cons (buffer-substring-no-properties