From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57531: 28.1; Character encoding missing for "eo" Date: Sun, 04 Sep 2022 11:28:06 +0300 Message-ID: <83r10rlf1l.fsf@gnu.org> References: <87h71r0w5z.fsf@jonreeve.com> <83h71qqq5e.fsf@gnu.org> <878rn1p7oz.fsf@jonreeve.com> <8335d8o6ow.fsf@gnu.org> <877d2kpfe1.fsf@jonreeve.com> <83o7vwmlet.fsf@gnu.org> <875yi4p6se.fsf@jonreeve.com> <831qsrn1im.fsf@gnu.org> <875yi31v17.fsf@linux-m68k.org> <83v8q3li60.fsf@gnu.org> <87wnajzj6z.fsf@linux-m68k.org> <83tu5nlgyy.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35503"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57531@debbugs.gnu.org, schwab@linux-m68k.org To: jonathan@jonreeve.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 04 10:29:42 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUl0f-00094X-Qk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 10:29:41 +0200 Original-Received: from localhost ([::1]:47260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUl0d-0002we-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 04:29:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUl02-0002wR-UI for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 04:29:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUl02-0002ow-KQ for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 04:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUl02-0003Mr-GS for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 04:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Sep 2022 08:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57531 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57531-submit@debbugs.gnu.org id=B57531.166228011712912 (code B ref 57531); Sun, 04 Sep 2022 08:29:02 +0000 Original-Received: (at 57531) by debbugs.gnu.org; 4 Sep 2022 08:28:37 +0000 Original-Received: from localhost ([127.0.0.1]:43445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUkzc-0003MC-J9 for submit@debbugs.gnu.org; Sun, 04 Sep 2022 04:28:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUkzb-0003La-EK for 57531@debbugs.gnu.org; Sun, 04 Sep 2022 04:28:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUkzV-0002md-U2; Sun, 04 Sep 2022 04:28:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oXwSSXDH5T/hiSp/nxFtdeelb+VZe8pc8LAC7o6MPuc=; b=Joi93caH1jYO 9LGgxz4J2bl8YgrtTg/5kdL9C/ygFDttM2InKuJeDIRysFhEbxr7V256RkDogbOUWhDL5TyCmCYWz u7zOdVvcjgustbeuxDZCKmQeN9y61MdxM3YyPURNSRnnc9dgQ/LjZqwcTJU0ZJA8En4Q6eZGmA+u9 SMKwhyAJG1uLf3ukN5Id9PwbssW5QMzJHEToj1Gog1cUd2dOi0fIUdBTF2PqCZjztw6gIe7WtViEI lsS9PfV38oPaDLCR0S+4kuD12pkGbZvp0H9K4PSSFA2fFGyaCHFXAxM8D6hVILYj4W1+YYg6lag8B jyHW/fMKsJXThuzWDT56wg==; Original-Received: from [87.69.77.57] (port=2937 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUkzV-0005zy-Ct; Sun, 04 Sep 2022 04:28:29 -0400 In-Reply-To: <83tu5nlgyy.fsf@gnu.org> (message from Eli Zaretskii on Sun, 04 Sep 2022 10:46:29 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241482 Archived-At: > Cc: jonathan@jonreeve.com, 57531@debbugs.gnu.org > Date: Sun, 04 Sep 2022 10:46:29 +0300 > From: Eli Zaretskii > > But like I said: feel free to submit a patch that doesn't potentially > destroy everything we have in that setup. If the patch is safe > enough, I see no reason not to accept it. Something like the below could be acceptable, if it solves the problem. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 4137642..6866291 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2317,7 +2317,7 @@ locale-language-names ;; en_IN -- fx. ("en_IN" "English" utf-8) ; glibc uses utf-8 for English in India ("en" "English" iso-8859-1) ; English - ("eo" . "Esperanto") ; Esperanto + ("eo" "Esperanto" locale-info) ; Esperanto ("es" "Spanish" iso-8859-1) ("et" . "Latin-9") ; Estonian ("eu" . "Latin-1") ; Basque @@ -2522,8 +2522,12 @@ locale-language-names (LOCALE-REGEXP LANG-ENV CODING-SYSTEM) The first element whose LOCALE-REGEXP matches the start of a downcased locale specifies the LANG-ENV \(language environment) -and CODING-SYSTEM corresponding to that locale. If there is no -appropriate language environment, the element may have this form: +and CODING-SYSTEM corresponding to that locale. +CODING-SYSTEM can be the special symbol `locale-info', which +means we should call `locale-info' to request the codeset of +the current locale. +If there is no appropriate language environment, the element may +have this form: (LOCALE-REGEXP . LANG-ENV) In this case, LANG-ENV is one of generic language environments for an specific encoding such as \"Latin-1\" and \"UTF-8\".") @@ -2794,9 +2798,23 @@ set-locale-environment ;; locale-language-names specify both lang-env and coding. ;; But, what specified in locale-preferred-coding-systems ;; has higher priority. - (setq coding-system (or coding-system - (nth 1 language-name)) - language-name (car language-name)) + (progn + (setq coding-system (or coding-system + (nth 1 language-name)) + language-name (car language-name)) + ;; If locale-language-names specifies we should query + ;; the underlying libc, do that now, but only when we + ;; are setting up for the current locale, i.e. when this + ;; function is called from startup.el with an argument + ;; of nil. + (if (eq coding-system 'locale-info) + (if locale-name + (setq coding-system nil) + (let ((locale-codeset (locale-info 'codeset))) + (when (stringp locale-codeset) + (setq coding-system (intern (downcase locale-codeset))) + (unless (coding-system-p coding-system) + (setq coding-system nil))))))) ;; Otherwise, if locale is not listed in locale-language-names, ;; use what listed in locale-charset-language-names. (if (not language-name)