]> git.eshelyaron.com Git - emacs.git/commitdiff
(detect-coding-with-priority):
authorDave Love <fx@gnu.org>
Sat, 29 Jun 2002 10:46:39 +0000 (10:46 +0000)
committerDave Love <fx@gnu.org>
Sat, 29 Jun 2002 10:46:39 +0000 (10:46 +0000)
Rewritten.

lisp/ChangeLog
lisp/international/mule-util.el

index 0d9f18f12f24387f3c0f86e1c981659dd33b88d3..6c31914853c295c8297a57e6197f6d5003ea34af 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-28  Dave Love  <fx@gnu.org>
+
+       * international/mule-util.el (detect-coding-with-priority):
+       Rewritten.
+
 2002-06-27  Dave Love  <fx@gnu.org>
 
        * composite.el (compose-string): Doc fix.
index 9bdb4843e8071b3607fc20666a11546226d2fef6..8c3623731859962f4cced695447a17433533bc9d 100644 (file)
@@ -2,6 +2,7 @@
 
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
+;; Copyright (C) 2002 Free Software Foundation, Inc.
 
 ;; Keywords: mule, multilingual
 
@@ -265,24 +266,15 @@ or one is an alias of the other."
             (or (eq eol-type-1 eol-type-2)
                 (and (vectorp eol-type-1) (vectorp eol-type-2)))))))
 
-;; Fixme: delete this?
 ;;;###autoload
 (defmacro detect-coding-with-priority (from to priority-list)
   "Detect a coding system of the text between FROM and TO with PRIORITY-LIST.
 PRIORITY-LIST is an alist of coding categories vs the corresponding
 coding systems ordered by priority."
-  `(unwind-protect
-       (let* ((prio-list ,priority-list)
-             (coding-category-list coding-category-list)
-             ,@(mapcar (function (lambda (x) (list x x)))
-                       coding-category-list))
-        (mapc (function (lambda (x) (set (car x) (cdr x))))
-              prio-list)
-        (set-coding-priority (mapcar #'car prio-list))
-        (detect-coding-region ,from ,to))
-     ;; We must restore the internal database.
-     (set-coding-priority coding-category-list)
-     (update-coding-systems-internal)))
+  `(with-coding-priority ,(mapcar #'cdr priority-list)
+     (detect-coding-region ,from ,to)))
+(make-obsolete 'detect-coding-with-priority
+              "Use with-coding-priority and detect-coding-region" "22.1")
 
 ;;;###autoload
 (defun detect-coding-with-language-environment (from to lang-env)