From: Kenichi Handa Date: Mon, 15 Mar 1999 00:51:20 +0000 (+0000) Subject: (detect-coding-with-priority): Restore the internal database. X-Git-Tag: emacs-20.4~464 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e74d79268be74d35f6f1dccc4301c63edc5cae17;p=emacs.git (detect-coding-with-priority): Restore the internal database. --- diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 70872b636dc..82114740c20 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -258,13 +258,19 @@ or one is an alias of the other." "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." - `(let* ((prio-list ,priority-list) - (coding-category-list coding-category-list) - ,@(mapcar (function (lambda (x) (list x x))) coding-category-list)) - (mapcar (function (lambda (x) (set (car x) (cdr x)))) - prio-list) - (set-coding-priority (mapcar (function (lambda (x) (car x))) prio-list)) - (detect-coding-region ,from ,to))) + `(unwind-protect + (let* ((prio-list ,priority-list) + (coding-category-list coding-category-list) + ,@(mapcar (function (lambda (x) (list x x))) + coding-category-list)) + (mapcar (function (lambda (x) (set (car x) (cdr x)))) + prio-list) + (set-coding-priority (mapcar (function (lambda (x) (car x))) + prio-list)) + (detect-coding-region ,from ,to)) + ;; We must restore the internal database. + (set-coding-priority coding-category-list) + (update-coding-systems-internal))) ;;;###autoload (defun detect-coding-with-language-environment (from to lang-env)