Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / nxml / rng-cmpct.el
index a1915b1..9ea68c3 100644 (file)
@@ -1,16 +1,16 @@
 ;;; rng-cmpct.el --- parsing of RELAX NG Compact Syntax schemas
 
-;; Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
 
 ;; Author: James Clark
 ;; Keywords: 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:
 
@@ -247,14 +245,16 @@ and URI is a symbol.")
 (defconst rng-c-about-combine-slot 1)
 
 (defun rng-c-lookup-create (name grammar)
-  "Return a def object for NAME.  A def object is a pair
-\(ABOUT . REF) where REF is returned by `rng-make-ref'.  ABOUT is a
-two-element vector [OVERRIDE COMBINE].  COMBINE is either nil, choice
-or interleave.  OVERRIDE is either nil, require or t."
+  "Return a def object for NAME.
+A def object is a pair \(ABOUT . REF) where REF is returned by
+`rng-make-ref'.
+ABOUT is a two-element vector [OVERRIDE COMBINE].
+COMBINE is either nil, choice or interleave.
+OVERRIDE is either nil, require or t."
   (let ((def (gethash name grammar)))
     (if def
        def
-      (progn 
+      (progn
        (setq def (cons (vector nil nil) (rng-make-ref name)))
        (puthash name def grammar)
        def))))
@@ -348,8 +348,7 @@ or interleave.  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
@@ -472,14 +471,14 @@ or interleave.  OVERRIDE is either nil, require or t."
          (cons (cons prefix
                      (rng-make-datatypes-uri (rng-c-parse-literal)))
                rng-c-datatype-decls))))
-    
+
 (defun rng-c-parse-namespace ()
   (rng-c-declare-namespace nil
                           (rng-c-parse-identifier-or-keyword)))
 
 (defun rng-c-parse-default ()
   (rng-c-expect "namespace")
-  (rng-c-declare-namespace t 
+  (rng-c-declare-namespace t
                           (if (string-equal rng-c-current-token "=")
                               nil
                             (rng-c-parse-identifier-or-keyword))))
@@ -617,9 +616,10 @@ or interleave.  OVERRIDE is either nil, require or t."
       p)))
 
 (defun rng-c-parse-primary ()
-  "Parse a primary expression.  The current token must be the first
-token of the expression.  After parsing the current token should be
-token following the primary expression."
+  "Parse a primary expression.
+The current token must be the first token of the expression.
+After parsing the current token should be the token following
+the primary expression."
   (cond ((rng-c-current-token-keyword-p)
         (let ((parse-function (get (intern rng-c-current-token)
                                    'rng-c-pattern)))
@@ -693,7 +693,7 @@ token following the primary expression."
        ((rng-c-current-token-quoted-identifier-p)
         (rng-c-advance-with (substring rng-c-current-token 1)))
        (t (rng-c-error "Expected identifier or keyword"))))
-   
+
 (put 'string 'rng-c-pattern 'rng-c-parse-string)
 (put 'token 'rng-c-pattern 'rng-c-parse-token)
 (put 'element 'rng-c-pattern 'rng-c-parse-element)
@@ -742,7 +742,7 @@ token following the primary expression."
                   (string-equal rng-c-current-token "|")))
          (rng-make-choice-name-class name-classes))
       name-class)))
-         
+
 (defun rng-c-parse-primary-name-class (attribute)
   (cond ((rng-c-current-token-ncname-p)
         (rng-c-advance-with
@@ -903,8 +903,8 @@ token following the primary expression."
 ;; XXX don't allow attributes after text
 
 (defun rng-c-parse-annotation-body (&optional allow-text)
-  "Current token is [.  Parse up to matching ]. Current token after
-parse is token following ]."
+  "Current token is [.  Parse up to matching ].
+Current token after parse is token following ]."
   (or (string-equal rng-c-current-token "[")
       (rng-c-error "Expected ["))
   (rng-c-advance)
@@ -924,7 +924,7 @@ parse is token following ]."
                  (rng-c-parse-literal))
                 (t (rng-c-error "Expected = or ["))))))
   (rng-c-advance))
-            
+
 (defun rng-c-advance-with (pattern)
   (rng-c-advance)
   pattern)
@@ -938,4 +938,3 @@ parse is token following ]."
 
 ;;; rng-cmpct.el
 
-;; arch-tag: 90395eb1-283b-4146-bbc1-6d6ef1704e57