changeset 43956:858065a2176d

(codepage-setup): Don't define a codepage if it is already defined.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 16 Mar 2002 16:42:05 +0000
parents 34ed592275f9
children 1b07ba20bc15
files lisp/international/codepage.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/codepage.el	Sat Mar 16 16:28:01 2002 +0000
+++ b/lisp/international/codepage.el	Sat Mar 16 16:42:05 2002 +0000
@@ -659,9 +659,12 @@
 	 (candidates (cp-supported-codepages)))
      (list (completing-read "Setup DOS Codepage: (default 437) " candidates
 			    nil t nil nil "437"))))
-  (let ((cp (format "cp%s" codepage)))
-    (cp-make-coding-systems-for-codepage
-     cp (cp-charset-for-codepage cp) (cp-offset-for-codepage cp))))
+  (let* ((cp (format "cp%s" codepage))
+	 (cp-defined (intern-soft cp)))
+    (or (and cp-defined  ;; avoid defining if already defined
+	     (coding-system-p cp-defined))
+	(cp-make-coding-systems-for-codepage
+	 cp (cp-charset-for-codepage cp) (cp-offset-for-codepage cp)))))
 
 (provide 'codepage)