]> code.delx.au - gnu-emacs/blobdiff - lisp/nxml/rng-cmpct.el
Update copyright year to 2016
[gnu-emacs] / lisp / nxml / rng-cmpct.el
index 53a11caa4de84a9faaacac3873cb2f066cd454a1..39aee9780ff658fa4cd8613fa1d6391144ed4d89 100644 (file)
@@ -1,9 +1,9 @@
 ;;; rng-cmpct.el --- parsing of RELAX NG Compact Syntax schemas
 
-;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: James Clark
-;; Keywords: XML, RelaxNG
+;; Keywords: wp, hypermedia, languages, XML, RelaxNG
 
 ;; This file is part of GNU Emacs.
 
@@ -45,13 +45,8 @@ Return a pattern."
 
 ;;; Error handling
 
-(put 'rng-c-incorrect-schema
-     'error-conditions
-     '(error rng-error nxml-file-parse-error rng-c-incorrect-schema))
-
-(put 'rng-c-incorrect-schema
-     'error-message
-     "Incorrect schema")
+(define-error 'rng-c-incorrect-schema
+  "Incorrect schema" '(rng-error nxml-file-parse-error))
 
 (defun rng-c-signal-incorrect-schema (filename pos message)
   (nxml-signal-file-parse-error filename
@@ -348,8 +343,7 @@ OVERRIDE is either nil, require or t."
 (defvar rng-c-file-index nil)
 
 (defun rng-c-parse-file (filename &optional context)
-  (save-excursion
-    (set-buffer (get-buffer-create (rng-c-buffer-name context)))
+  (with-current-buffer (get-buffer-create (rng-c-buffer-name context))
     (erase-buffer)
     (rng-c-init-buffer)
     (setq rng-c-file-name
@@ -369,7 +363,7 @@ OVERRIDE is either nil, require or t."
            "*")))
 
 (defun rng-c-process-escapes ()
-  ;; Check for any nuls, since we will use nul chars
+  ;; Check for any NULs, since we will use NUL chars
   ;; for internal purposes.
   (let ((pos (search-forward "\C-@" nil t)))
     (and pos
@@ -406,7 +400,7 @@ OVERRIDE is either nil, require or t."
 (defun rng-c-error (&rest args)
   (rng-c-signal-incorrect-schema rng-c-file-name
                                 (rng-c-translate-position (point))
-                                (apply 'format args)))
+                                (apply #'format-message args)))
 
 (defun rng-c-parse-top-level (context)
   (let ((rng-c-namespace-decls nil)
@@ -938,5 +932,3 @@ Current token after parse is token following ]."
 (provide 'rng-cmpct)
 
 ;;; rng-cmpct.el
-
-;; arch-tag: 90395eb1-283b-4146-bbc1-6d6ef1704e57