]> code.delx.au - gnu-emacs/blobdiff - lisp/nxml/xmltok.el
Merge from mainline.
[gnu-emacs] / lisp / nxml / xmltok.el
index 138d8e74a6b681d50a7a170bb11f1ee83d6befbc..d2aeff9778ee393a80fcb0532bdfe0e74b933de0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; xmltok.el --- XML tokenization
 
-;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: XML
@@ -315,16 +315,14 @@ and VALUE-END, otherwise a STRING giving the value."
           (cond ((> space-count 0)
                  (setq xmltok-type 'space))
                 (t
-                 (goto-char (1+ (point)))
+                 (forward-char 1)
                  (xmltok-scan-after-lt))))
          ((eq ch ?\&)
           (cond ((> space-count 0)
                  (setq xmltok-type 'space))
                 (t
-                 (goto-char (1+ (point)))
-                 (xmltok-scan-after-amp
-                  (lambda (start end)
-                    (xmltok-handle-entity start end))))))
+                 (forward-char 1)
+                 (xmltok-scan-after-amp 'xmltok-handle-entity))))
          ((re-search-forward "[<&]\\|\\(]]>\\)" nil t)
           (cond ((not (match-beginning 1))
                  (goto-char (match-beginning 0))
@@ -1761,8 +1759,7 @@ Processing instruction does not start with a name"
        (setcdr name-def 'not-well-formed) ; avoid infinite expansion loops
        (setq buf (get-buffer-create
                   (format " *Entity %s*" (car name-def))))
-       (save-excursion
-         (set-buffer buf)
+       (with-current-buffer buf
          (erase-buffer)
          (insert def)
          (goto-char (point-min))