]> git.eshelyaron.com Git - emacs.git/commitdiff
(coding-system-equal): Moved from mule-util.el.
authorKenichi Handa <handa@m17n.org>
Tue, 12 Oct 2004 05:26:29 +0000 (05:26 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 12 Oct 2004 05:26:29 +0000 (05:26 +0000)
lisp/ChangeLog
lisp/international/mule.el

index eb028c98a25a2c28b044c90e0959c708c7c36afd..4738fb4812fb3740de55dd1b6b13d454612953d7 100644 (file)
@@ -1,3 +1,11 @@
+2004-10-12  Kenichi Handa  <handa@m17n.org>
+
+       * international/mule.el (coding-system-equal): Moved from
+       mule-util.el.
+
+       * international/mule-util.el (coding-system-equal): Moved to
+       mule.el.
+
 2004-10-12  Kim F. Storm  <storm@cua.dk>
 
        * kmacro.el (kmacro-insert-counter, kmacro-add-counter): Use and
index 8b4ba9b2ce3fcdfe6ed0f081f3773daec1b8bff2..840dd67087fca2dacf891267324f2faabb3bbd12 100644 (file)
@@ -535,6 +535,18 @@ coding system whose eol-type is N."
                 (and (not (> (downcase c1) (downcase c2)))
                      (< c1 c2)))))))
 
+(defun coding-system-equal (coding-system-1 coding-system-2)
+  "Return t if and only if CODING-SYSTEM-1 and CODING-SYSTEM-2 are identical.
+Two coding systems are identical if two symbols are equal
+or one is an alias of the other."
+  (or (eq coding-system-1 coding-system-2)
+      (and (equal (coding-system-spec coding-system-1)
+                 (coding-system-spec coding-system-2))
+          (let ((eol-type-1 (coding-system-eol-type coding-system-1))
+                (eol-type-2 (coding-system-eol-type coding-system-2)))
+            (or (eq eol-type-1 eol-type-2)
+                (and (vectorp eol-type-1) (vectorp eol-type-2)))))))
+
 (defun add-to-coding-system-list (coding-system)
   "Add CODING-SYSTEM to `coding-system-list' while keeping it sorted."
   (if (or (null coding-system-list)