# HG changeset patch # User Dave Love # Date 1035753054 0 # Node ID a34ad9e6b88a551d3f746c816af2dcae3928a70f # Parent 51d2baa0181df520e912e32b8d254add7f6e30e4 (wid-edit): Require when compiling. (set-locale-environment): Check locale against coding system aliases too. diff -r 51d2baa0181d -r a34ad9e6b88a lisp/international/mule-cmds.el --- a/lisp/international/mule-cmds.el Sun Oct 27 21:10:00 2002 +0000 +++ b/lisp/international/mule-cmds.el Sun Oct 27 21:10:54 2002 +0000 @@ -30,7 +30,9 @@ ;;; Code: -(eval-when-compile (defvar dos-codepage)) +(eval-when-compile + (defvar dos-codepage) + (require 'wid-edit)) ;;; MULE related key bindings and menus. @@ -1929,7 +1931,7 @@ (cdr element))) (defun locale-charset-match-p (charset1 charset2) - "Whether charset names CHARSET1 and CHARSET2 are equivalent. + "Whether charset names (strings) CHARSET1 and CHARSET2 are equivalent. Matching is done ignoring case and any hyphens and underscores in the names. E.g. `ISO_8859-1' and `iso88591' both match `iso-8859-1'." (setq charset1 (replace-regexp-in-string "[-_]" "" charset1)) @@ -2051,10 +2053,15 @@ (let ((codeset (langinfo 'codeset)) (coding-system (car (coding-system-priority-list)))) (when codeset - (unless (locale-charset-match-p (symbol-name coding-system) - (langinfo 'codeset)) - (message "Warning: Default coding system `%s' doesn't agree with -the system code set `%s' for this locale." coding-system codeset)))))))) + (let ((cs (coding-system-aliases coding-system)) + result) + (while (and cs (not result)) + (setq result + (locale-charset-match-p (symbol-name (pop cs)) + (langinfo 'codeset)))) + (unless result + (message "Warning: Default coding system `%s' doesn't agree with +the system code set `%s' for this locale." coding-system codeset))))))))) ;;; Character code property (put 'char-code-property-table 'char-table-extra-slots 0)