From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.bugs Subject: bug#12392: emacs-gtk misinterprets floating-point numbers under certain locales on openSUSE 12.2 Date: Sat, 22 Sep 2012 08:19:48 +0200 Organization: Linux Private Site Message-ID: <87zk4ifukb.fsf@Rainer.invalid> References: <87r4qbodec.fsf@Rainer.invalid> <5051974D.2020106@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1348294896 20328 80.91.229.3 (22 Sep 2012 06:21:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Sep 2012 06:21:36 +0000 (UTC) To: 12392@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 22 08:21:37 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TFJ5s-0005l3-07 for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Sep 2012 08:21:36 +0200 Original-Received: from localhost ([::1]:46745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ5n-0001rr-6e for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Sep 2012 02:21:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ5h-0001qe-Ny for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:21:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFJ5d-00040v-NJ for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:21:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ5d-00040r-Jw for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:21:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TFJ7G-0000xY-4e for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:23:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r4qbodec.fsf@Rainer.invalid> Resent-From: Achim Gratz Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Sep 2012 06:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12392 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13482949333628 (code B ref -1); Sat, 22 Sep 2012 06:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2012 06:22:13 +0000 Original-Received: from localhost ([127.0.0.1]:47845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFJ6P-0000wO-9P for submit@debbugs.gnu.org; Sat, 22 Sep 2012 02:22:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45642) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFJ6J-0000wD-75 for submit@debbugs.gnu.org; Sat, 22 Sep 2012 02:22:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFJ4b-0003SS-NN for submit@debbugs.gnu.org; Sat, 22 Sep 2012 02:20:21 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:56236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ4b-0003SF-KJ for submit@debbugs.gnu.org; Sat, 22 Sep 2012 02:20:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ4X-0001l6-CH for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:20:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFJ4S-0003EK-VF for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:20:13 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFJ4S-0003C1-Nn for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 02:20:08 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TFJ4S-0004kV-Po for bug-gnu-emacs@gnu.org; Sat, 22 Sep 2012 08:20:08 +0200 Original-Received: from pd9eb4c6b.dip.t-dialin.net ([217.235.76.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Sep 2012 08:20:08 +0200 Original-Received: from Stromeko by pd9eb4c6b.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 22 Sep 2012 08:20:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pd9eb4c6b.dip.t-dialin.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:ZZWizpSJ6AlPf2Kk9QK48uWbUbw= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64714 Archived-At: Holger Arnold writes: > 1. Emacs changes the locale _after_ GTK has been initialized, which, > according to the GTK docs, "may produce inconsistent results and is > not really supported" (see > http://developer.gnome.org/gtk/stable/gtk-General.html#gtk-set-locale). No, this docstring talks about gtk_set_locale, which emacs doesn't want or need to change. > 2. To make the parsing (and printing?) of number literals in Emacs > Lisp locale-dependent is the wrong approach. There are a lot of things that are wrong with internationalization, but this isn't one of them IMHO. Emacs does call setlocale for it. > What is happening here is that, after Emacs's second call to > fixup_locale() (after initializing GTK), a module implicitly loaded by > GTK (GStreamer in this case, accessed by GTK via libcanberra) calls > setlocale(LC_ALL, "") again. The GTK docs explicitly say that such > things may happen. Please cite chapter and verse: if it's documented, then there should be a documented way of dealing with it. Otherwise a _library_ changing the locale out from under a program is a bug, especially when it is already guaranteed that the library comes into existence in a sane locale environment. I'd think that the gstreamer part is what has changed between openSUSE 12.1 and 12.2, BTW. > Note that inserting gtk_disable_setlocale() before gtk_init() does not > help because this setting does not transcend to the loaded module. That dangling carrot looks appealing, but it appears we'd really want to gtk be initialized with the users' locale and not with the emacs altered one. > A quick work-around is to start Emacs with LC_NUMERIC set to "C". > > The long-term solution would be to fix Emacs's Lisp parser so that it > does not depend on the current locale. Hard-setting the locale to "C" > is bad style because it ignores the user's interface preferences. This is done all the time in other applications. What's the point of internationalization if you'd then need another function for each locale and variant that the program intends to use? That is exactly why setlocale returns an object that you can use to restore the locale at any point in time. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf microQ V2.22R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada