changeset 88810:c949437b3a53

(detect-coding-with-priority): Rewritten.
author Dave Love <fx@gnu.org>
date Sat, 29 Jun 2002 10:44:03 +0000
parents 0d0f856a4c77
children bafdb12cd3e8
files lisp/international/mule-util.el
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-util.el	Thu Jun 27 22:07:39 2002 +0000
+++ b/lisp/international/mule-util.el	Sat Jun 29 10:44:03 2002 +0000
@@ -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 (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)