Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / nxml / rng-nxml.el
index 5b3f2a7..1047ead 100644 (file)
@@ -1,16 +1,16 @@
 ;;; rng-nxml.el --- make nxml-mode take advantage of rng-validate-mode
 
-;; Copyright (C) 2003, 2007 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:
 
 (require 'rng-loc)
 
 (defcustom rng-nxml-auto-validate-flag t
-  "*Non-nil means automatically turn on validation with nxml-mode."
+  "Non-nil means automatically turn on validation with nxml-mode."
   :type 'boolean
   :group 'relax-ng)
 
-(defvar rng-preferred-prefix-alist-default nil
-  "Default value for variable `rng-preferred-prefix-alist'.")
-
-(defcustom rng-preferred-prefix-alist rng-preferred-prefix-alist-default
-  "*Alist of namespaces vs preferred prefixes."
+(defcustom rng-preferred-prefix-alist
+  '(("http://www.w3.org/1999/XSL/Transform" . "xsl")
+    ("http://www.w3.org/1999/02/22-rdf-syntax-ns#" . "rdf")
+    ("http://www.w3.org/1999/xlink" . "xlink")
+    ("http://www.w3.org/2001/XmlSchema" . "xsd")
+    ("http://www.w3.org/2001/XMLSchema-instance" . "xsi")
+    ("http://purl.org/dc/elements/1.1/" . "dc")
+    ("http://purl.org/dc/terms/" . "dcterms"))
+  "Alist of namespaces vs preferred prefixes."
   :type '(repeat (cons :tag "With"
                       (string :tag "this namespace URI")
                       (string :tag "use this prefix")))
@@ -100,8 +102,9 @@ Validation will be enabled if `rng-nxml-auto-validate-flag' is non-nil."
   (easy-menu-define rng-nxml-menu nxml-mode-map
     "Menu for nxml-mode used with rng-validate-mode."
     rng-nxml-easy-menu)
-  (setq mode-line-process
-       '(rng-validate-mode (:eval (rng-compute-mode-line-string))))
+  (add-to-list 'mode-line-process
+               '(rng-validate-mode (:eval (rng-compute-mode-line-string)))
+               'append)
   (cond (rng-nxml-auto-validate-flag
         (rng-validate-mode 1)
         (add-hook 'nxml-completion-hook 'rng-complete nil t)
@@ -369,7 +372,7 @@ If unsure, return non-nil."
 (defun rng-set-state-after (&optional pos)
   "Set the state for after parsing the first token with endpoint >= POS.
 This does not change the xmltok state or point.  However, it does
-set `xmltok-dtd'. Returns the position of the end of the token."
+set `xmltok-dtd'.  Returns the position of the end of the token."
   (unless pos (setq pos (point)))
   (when (< rng-validate-up-to-date-end pos)
     (message "Parsing...")
@@ -445,7 +448,7 @@ set `xmltok-dtd'. Returns the position of the end of the token."
          (rng-process-start-tag 'stop)
          (rng-find-undeclared-prefixes)
          t)))))
-       
+
 (defun rng-find-undeclared-prefixes ()
   ;; Start with the newly effective namespace declarations.
   ;; (Includes declarations added during recovery.)
@@ -564,7 +567,7 @@ set `xmltok-dtd'. Returns the position of the end of the token."
                                    (list (cdr name))))
                                rng-complete-target-names)))
           'string<))))
-       
+
 (defun rng-get-preferred-unused-prefix (ns)
   (let ((ns-prefix (assoc (symbol-name ns) rng-preferred-prefix-alist))
        iter prefix)
@@ -588,5 +591,4 @@ set `xmltok-dtd'. Returns the position of the end of the token."
 
 (provide 'rng-nxml)
 
-;; arch-tag: bec0d6ed-6be1-4540-9c2c-6f56e8e55d8b
 ;;; rng-nxml.el ends here