]> code.delx.au - gnu-emacs/blobdiff - lisp/nxml/rng-loc.el
Update copyright year to 2015
[gnu-emacs] / lisp / nxml / rng-loc.el
index bae99ff8be6377b6b509f669f616f55c4bf74f57..601e54aeef56f2c891ac0b8369bddcece14529b3 100644 (file)
@@ -1,16 +1,16 @@
 ;;; rng-loc.el --- locate the schema to use for validation
 
-;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
 
 ;; Author: James Clark
-;; Keywords: XML, RelaxNG
+;; Keywords: wp, hypermedia, languages, XML, RelaxNG
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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, or (at your option)
-;; any later version.
+;; 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
@@ -18,9 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -35,7 +33,7 @@
 
 (defvar rng-current-schema-file-name nil
   "Filename of schema being used for current buffer.
-Nil if using a vacuous schema.")
+It is nil if using a vacuous schema.")
 (make-variable-buffer-local 'rng-current-schema-file-name)
 
 (defvar rng-schema-locating-files-default
@@ -50,7 +48,7 @@ Nil if using a vacuous schema.")
   "Schema for schema locating files or nil if not yet loaded.")
 
 (defcustom rng-schema-locating-files rng-schema-locating-files-default
-  "*List of schema locating files."
+  "List of schema locating files."
   :type '(repeat file)
   :group 'relax-ng)
 
@@ -93,7 +91,7 @@ Nil if using a vacuous schema.")
 FILENAME must be the name of a file containing a schema.
 The extension of FILENAME is used to determine what kind of schema it
 is.  The variable `rng-schema-loader-alist' maps from schema
-extensions to schema loader functions. The function
+extensions to schema loader functions.  The function
 `rng-c-load-schema' is the loader for RELAX NG compact syntax.  The
 association is between the buffer and the schema: the association is
 lost when the buffer is killed."
@@ -119,7 +117,7 @@ lost when the buffer is killed."
          rng-any-element))
   (setq rng-current-schema-file-name filename)
   (run-hooks 'rng-schema-change-hook))
-  
+
 (defun rng-load-schema (filename)
   (let* ((extension (file-name-extension filename))
         (loader (cdr (assoc extension rng-schema-loader-alist))))
@@ -134,7 +132,7 @@ lost when the buffer is killed."
   "Display a message saying what schema `rng-validate-mode' is using."
   (interactive)
   (if rng-current-schema-file-name
-      (message "Using schema %s" 
+      (message "Using schema %s"
               (abbreviate-file-name rng-current-schema-file-name))
     (message "Using vacuous schema")))
 
@@ -190,7 +188,7 @@ If TYPE-ID is non-nil, then locate the schema for this TYPE-ID."
 (defun rng-locate-schema-file-using (files)
   "Locate a schema using the schema locating files FILES.
 FILES is a list of file-names.
-Return either a URI, a list (TYPE-ID) where TYPE-ID is a string
+Return either a URI, a list (TYPE-ID) where TYPE-ID is a string,
 or nil."
   (let (rules
        ;; List of types that override normal order-based
@@ -383,7 +381,7 @@ NS is t if the document has a non-nil, but not otherwise known namespace."
 
 (defun rng-locate-schema-file-from-type-id (type-id file)
   "Locate the schema for type id TYPE-ID using schema locating file FILE.
-Return either a URI, a list (TYPE-ID) where TYPE-ID is a string
+Return either a URI, a list (TYPE-ID) where TYPE-ID is a string,
 or nil."
   (let ((rules (rng-get-parsed-schema-locating-file file))
        schema rule)
@@ -427,7 +425,7 @@ or nil."
                   (cons (list file mtime parsed)
                         rng-schema-locating-file-alist)))
           parsed))))
-  
+
 (defconst rng-locate-namespace-uri
   (nxml-make-namespace "http://thaiopensource.com/ns/locating-rules/1.0"))
 
@@ -510,8 +508,7 @@ saved to the first writable file in `rng-schema-locating-files'."
                                         "schema location")
                                       file)))))
          (t
-          (save-excursion
-            (set-buffer (find-file-noselect file))
+          (with-current-buffer (find-file-noselect file)
             (let ((modified (buffer-modified-p)))
               (if (> (buffer-size) 0)
                   (let (xmltok-dtd)
@@ -549,5 +546,4 @@ saved to the first writable file in `rng-schema-locating-files'."
 
 (provide 'rng-loc)
 
-;; arch-tag: 725cf968-37a2-418b-b47b-d5209871a9ab
 ;;; rng-loc.el ends here