GNU bug report logs - #9655
24.0.50; `set-locale-environment' should use completion

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 2 Oct 2011 19:47:01 UTC

Severity: wishlist

Tags: moreinfo

Found in version 24.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9655 in the body.
You can then email your comments to 9655 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Sun, 02 Oct 2011 19:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Oct 2011 19:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; `set-locale-environment' should use completion
Date: Sun, 2 Oct 2011 12:45:03 -0700
The doc string says "LOCALE-NAME should be a string which is the name of
a locale supported by the system."  Isn't the set of locales supported
by the system something that Emacs can determine, and then make these
available as completion candidates?  Why should a user have to
investigate or guess which locales are choosable?
 
It also says: "The locale names supported by your system can typically
be found in a directory named `/usr/share/locale' or `/usr/lib/locale'."
This does not help users who are not on a UNIX/Gnu/Linux platform.
Where can they be found on Windows, for instance?
 
Some of the code looks as if it is specific to UNIX/Gnu/Linux/X-Window.
Should the setting of `locale-translation-file-name' be specific to such
systems, for instance?
 
It also looks like the code for this command should be split
up/factored.  Much of the command body is apparently about
non-interactive use (e.g. nil LOCALE-NAME) - factor that out, for
instance.
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-19 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
 
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Mon, 03 Oct 2011 07:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9655 <at> debbugs.gnu.org
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Mon, 03 Oct 2011 03:14:46 -0400
> From: "Drew Adams" <drew.adams <at> oracle.com>
> Date: Sun, 2 Oct 2011 12:45:03 -0700
> 
> It also says: "The locale names supported by your system can typically
> be found in a directory named `/usr/share/locale' or `/usr/lib/locale'."
> This does not help users who are not on a UNIX/Gnu/Linux platform.
> Where can they be found on Windows, for instance?

Nowhere a mere mortal can see it.  The OS maintains the list of
supported locales, and will divulge it via a certain C-level API.  But
you cannot find that list by searching files or directories, AFAIK.
As an interactive user, you can see the list in the Control Panel, but
programmatically the list is available only through that API.

> Some of the code looks as if it is specific to UNIX/Gnu/Linux/X-Window.
> Should the setting of `locale-translation-file-name' be specific to such
> systems, for instance?

Maybe, but I'm not sure a simple test for file's existence is worth
ugly system-dependent conditions.  If nothing else, it allows Windows
users to have locale translations, something that could be considered
a feature.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Mon, 03 Oct 2011 07:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: drew.adams <at> oracle.com
Cc: 9655 <at> debbugs.gnu.org
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Mon, 03 Oct 2011 03:26:24 -0400
> Date: Mon, 03 Oct 2011 03:14:46 -0400
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 9655 <at> debbugs.gnu.org
> Reply-To: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: "Drew Adams" <drew.adams <at> oracle.com>
> > Date: Sun, 2 Oct 2011 12:45:03 -0700
> > 
> > It also says: "The locale names supported by your system can typically
> > be found in a directory named `/usr/share/locale' or `/usr/lib/locale'."
> > This does not help users who are not on a UNIX/Gnu/Linux platform.
> > Where can they be found on Windows, for instance?
> 
> Nowhere a mere mortal can see it.  The OS maintains the list of
> supported locales, and will divulge it via a certain C-level API.  But
> you cannot find that list by searching files or directories, AFAIK.
> As an interactive user, you can see the list in the Control Panel, but
> programmatically the list is available only through that API.

Forgot to mention that this API has a Lisp binding in Emacs:
w32-get-valid-locale-ids.  E.g., try

  (mapcar 'w32-get-locale-info (w32-get-valid-locale-ids))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Mon, 03 Oct 2011 13:37:01 GMT) Full text and rfc822 format available.

Message #14 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9655 <at> debbugs.gnu.org
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Mon, 03 Oct 2011 09:35:07 -0400
severity 9655 wishlist
thanks

> The doc string says "LOCALE-NAME should be a string which is the name of
> a locale supported by the system."  Isn't the set of locales supported
> by the system something that Emacs can determine, and then make these
> available as completion candidates?

I think so, yes.

> Why should a user have to investigate or guess which locales
> are choosable?

Because nobody provided a patch to provide the completion table.


        Stefan




Severity set to 'wishlist' from 'minor' Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Mon, 03 Oct 2011 13:37:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Wed, 25 Aug 2021 12:37:01 GMT) Full text and rfc822 format available.

Message #19 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9655 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Wed, 25 Aug 2021 14:36:19 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Forgot to mention that this API has a Lisp binding in Emacs:
> w32-get-valid-locale-ids.  E.g., try
>
>   (mapcar 'w32-get-locale-info (w32-get-valid-locale-ids))

Looking at `set-locale-environment', it already has a bunch of hacks
that depend on Unix-related stuff:

  (setq locale-translation-file-name
	(let ((files
	       '("/usr/share/X11/locale/locale.alias" ; e.g. X11R7

I wonder whether we should just add an equally hacky `get-locale-names'
function that would call that w32 function (if defined), and if not,
just parse the output of "locale -a" (if "locale" exists on the system).

Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 12:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Wed, 25 Aug 2021 12:45:02 GMT) Full text and rfc822 format available.

Message #24 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9655 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Wed, 25 Aug 2021 15:44:00 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: drew.adams <at> oracle.com,  9655 <at> debbugs.gnu.org
> Date: Wed, 25 Aug 2021 14:36:19 +0200
> 
> >   (mapcar 'w32-get-locale-info (w32-get-valid-locale-ids))
> 
> Looking at `set-locale-environment', it already has a bunch of hacks
> that depend on Unix-related stuff:
> 
>   (setq locale-translation-file-name
> 	(let ((files
> 	       '("/usr/share/X11/locale/locale.alias" ; e.g. X11R7
> 
> I wonder whether we should just add an equally hacky `get-locale-names'
> function that would call that w32 function (if defined), and if not,
> just parse the output of "locale -a" (if "locale" exists on the system).
> 
> Any opinions?

Before invoking 'locale -a', wouldn't it be better to use
locale-translation-file-name?

Otherwise sounds like a plan ;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9655; Package emacs. (Wed, 25 Aug 2021 15:35:02 GMT) Full text and rfc822 format available.

Message #27 received at 9655 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9655 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#9655: 24.0.50; `set-locale-environment' should use completion
Date: Wed, 25 Aug 2021 17:34:05 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Before invoking 'locale -a', wouldn't it be better to use
> locale-translation-file-name?

The locale-translation-file-name file has all locales known, but what's
interesting is the list of locales available on the system, which is
what "locale -a" outputs.

> Otherwise sounds like a plan ;-)

Now implemented.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 9655 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 15:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Sep 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.