unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: jonathan@jonreeve.com
Cc: 57531@debbugs.gnu.org, schwab@linux-m68k.org
Subject: bug#57531: 28.1; Character encoding missing for "eo"
Date: Sun, 04 Sep 2022 11:28:06 +0300	[thread overview]
Message-ID: <83r10rlf1l.fsf@gnu.org> (raw)
In-Reply-To: <83tu5nlgyy.fsf@gnu.org> (message from Eli Zaretskii on Sun, 04 Sep 2022 10:46:29 +0300)

> Cc: jonathan@jonreeve.com, 57531@debbugs.gnu.org
> Date: Sun, 04 Sep 2022 10:46:29 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> 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)





  reply	other threads:[~2022-09-04  8:28 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 18:47 bug#57531: 28.1; Character encoding missing for "eo" Jonathan Reeve
2022-09-02  5:52 ` Eli Zaretskii
2022-09-03  1:28   ` Jonathan Reeve
2022-09-03 14:47     ` Eli Zaretskii
2022-09-03 16:54       ` Jonathan Reeve
2022-09-03 17:12         ` Eli Zaretskii
2022-09-03 17:32           ` Andreas Schwab
2022-09-03 17:58             ` Eli Zaretskii
2022-09-03 20:13               ` Andreas Schwab
2022-09-04  5:02                 ` Eli Zaretskii
2022-09-04  6:32                   ` Andreas Schwab
2022-09-04  6:54                     ` Eli Zaretskii
2022-09-04  7:33                       ` Andreas Schwab
2022-09-03 20:00           ` Jonathan Reeve
2022-09-04  5:37             ` Eli Zaretskii
2022-09-04  7:03               ` Andreas Schwab
2022-09-04  7:20                 ` Eli Zaretskii
2022-09-04  7:34                   ` Andreas Schwab
2022-09-04  7:46                     ` Eli Zaretskii
2022-09-04  8:28                       ` Eli Zaretskii [this message]
2022-10-04 11:44                         ` Lars Ingebrigtsen
2022-10-04 12:39                           ` Eli Zaretskii
2022-10-04 13:13                             ` Lars Ingebrigtsen
2022-10-06 10:51                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-06 11:28                               ` Gregory Heytings
2022-10-06 12:13                                 ` Lars Ingebrigtsen
2022-10-06 14:20                                 ` Eli Zaretskii
2022-10-06 15:15                                   ` Gregory Heytings
2022-10-06 16:05                                     ` Eli Zaretskii
2022-10-04 13:16                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-05  0:00                     ` Gregory Heytings
2022-09-05  8:16                       ` Gregory Heytings
2022-09-05  8:58                         ` Lars Ingebrigtsen
2022-09-05  9:10                           ` Gregory Heytings
2022-09-05  9:39                             ` Andreas Schwab
2022-09-05 11:46                               ` Gregory Heytings
2022-09-05  9:24                           ` Andreas Schwab
2022-09-05  9:30                             ` Gregory Heytings
2022-09-05 11:44                           ` Eli Zaretskii
2022-09-05 14:15                             ` Lars Ingebrigtsen
2022-09-05 11:40                         ` Eli Zaretskii
2022-09-05 12:00                           ` Gregory Heytings
2022-09-05 12:24                             ` Eli Zaretskii
2022-09-05 12:38                               ` Gregory Heytings
2022-09-05 13:04                                 ` Eli Zaretskii
2022-09-05 13:26                                   ` Gregory Heytings
2022-09-05 16:56                               ` Andreas Schwab
2022-09-05 17:50                                 ` Jonathan Reeve
2022-09-05 18:20                                   ` Gregory Heytings
2022-09-05 22:41                                     ` Jonathan Reeve
2022-09-05 23:14                                       ` Gregory Heytings
     [not found]                                       ` <57ffb073-c4ea-da56-18c0-661b9d8ab929@heytings.org>
2022-09-05 23:21                                         ` Gregory Heytings
2022-10-04 13:09                                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 13:05                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-04 23:35               ` Gregory Heytings
2022-09-05 11:29                 ` Eli Zaretskii
2022-09-05 12:07                   ` Gregory Heytings
2022-09-05 12:25                     ` Eli Zaretskii
2022-09-05 12:59                       ` Gregory Heytings
2022-09-05 13:11                         ` Eli Zaretskii
2022-09-05 13:33                           ` Gregory Heytings
2022-09-04  8:39 ` Andreas Schwab
2022-09-04  8:48   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r10rlf1l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=57531@debbugs.gnu.org \
    --cc=jonathan@jonreeve.com \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).