From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Holger Arnold Newsgroups: gmane.emacs.bugs Subject: bug#12392: emacs-gtk misinterprets floating-point numbers under certain locales on openSUSE 12.2 Date: Sun, 23 Sep 2012 21:58:07 +0200 Message-ID: References: <1544800.869GeMQOQf@thinkpad.home> <2377593.YnO2rOpBpl@thinkpad.home> <505DED2A.8040302@swipnet.se> <505DED94.9030505@swipnet.se> <87r4qbodec.fsf@Rainer.invalid> <87k3vk8xar.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1348430358 25992 80.91.229.3 (23 Sep 2012 19:59:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2012 19:59:18 +0000 (UTC) Cc: 12392@debbugs.gnu.org To: Achim Gratz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 23 21:59:23 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 1TFsKo-0007p0-HX for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Sep 2012 21:59:22 +0200 Original-Received: from localhost ([::1]:52705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFsKj-0003I3-CG for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Sep 2012 15:59:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFsKg-0003Ht-R9 for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2012 15:59:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TFsKf-0006Yj-3C for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2012 15:59:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TFsKe-0006Ye-Vw for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2012 15:59:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TFsMQ-0005xL-7b for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2012 16:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Holger Arnold Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Sep 2012 20:01: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 Original-Received: via spool by 12392-submit@debbugs.gnu.org id=B12392.134843042322841 (code B ref 12392); Sun, 23 Sep 2012 20:01:02 +0000 Original-Received: (at 12392) by debbugs.gnu.org; 23 Sep 2012 20:00:23 +0000 Original-Received: from localhost ([127.0.0.1]:51527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFsLm-0005wL-P1 for submit@debbugs.gnu.org; Sun, 23 Sep 2012 16:00:23 -0400 Original-Received: from mail-ie0-f172.google.com ([209.85.223.172]:47068) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFsLi-0005wB-DY for 12392@debbugs.gnu.org; Sun, 23 Sep 2012 16:00:20 -0400 Original-Received: by iec9 with SMTP id 9so9817863iec.3 for <12392@debbugs.gnu.org>; Sun, 23 Sep 2012 12:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=hh7gjacuI5AA+iXOjaVLzAVrt5HfGHrH3MPDT+UMO9o=; b=zCnAnRLACHduUGFTt2dPw5FCO1ZHE2zUgLiVOHXDMuIbuP9WcyG8jXy5ztV7dmkSUL YCvGVy/NDFfdsuavWf2PahSQCgdeZqbgA9yMNog9Y6wuViLDEiRYX4YTyeyC3l8UUdZE +WP5sN2wtpnOTk8R+tgYaTcuMqDV9Q8yDi0IutFJMGVCBB5UqHu/Q47zAqWKS1eqQvdA gNcIvOV2ffW49KsQUFN6928EOwY0vu+Z99S0kw8tN3w7veXhyE4OOIwhBeE+8iClW4fE eEknVFMlSvbNHmVoE9u1LrOYKWFtgzy/qdFTRVtBV+GniDkjkctcIxmMFFvpkzCHAQ04 /z7w== Original-Received: by 10.50.170.98 with SMTP id al2mr3572902igc.47.1348430308038; Sun, 23 Sep 2012 12:58:28 -0700 (PDT) Original-Received: by 10.64.28.204 with HTTP; Sun, 23 Sep 2012 12:58:07 -0700 (PDT) In-Reply-To: <87k3vk8xar.fsf@Rainer.invalid> 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:64828 Archived-At: 2012/9/23 Achim Gratz : > Jan Dj=E4rv writes: >> BTW, does doing setlocale LC_NUMERIC before gtk_init make things work? > > Not from within emacs, only if it is set as an environment variable. Yes, that's what I meant. Sorry Jan, I didn't want to confuse you. Calling fixup_locale() before gtk_init() won't help. > The locale is reset again to the environment when gstreamer is > initialized, which is likely a bug in gstreamer. The main window is > already mapped at that time and the command loop is running. I am going to file a gstreamer bug for this. But since the setlocale() call has been in gstreamer since 2004, it's probably not going to change soon. > The proper fix is likely to not bother with fixup_locale at all in its > current form, but either implement the lisp reader without > locale-dependent functions or getting a locale object on entry, change > the locale, do whatever it needs to do under changed locale and then > restore the locale. This is what libraries are often doing for parsing > configuration files, anyway. No, only the first approach will work. As it is currently implemented, Emacs requires the numeric locale set to "C" whenever it reads or writes lisp objects (which means: all the time), and changing the locale before and after each such operation conflicts with components that expect the "user" locale (such as GTK or GStreamer). Besides, these components may start their own threads, which means that setting the locale after these components have been initialized introduces races. If Emacs is to be a localized program, the Lisp parsers and writers have to be made locale-independent; there is no way to avoid this. fixup_locale() must go. > There are also some hints that glib expects / recommends to call > setlocale, textdomain, bind_textdomain and bind_textdomain_codeset early > in main on order to properly initialize it. Yes, and the only call to setlocale() should be setlocale(LC_ALL, "") very early, before the user interface is initialized (that's why gtk_init() does exactly this). Holger