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: Fri, 21 Sep 2012 11:59:55 +0200 Message-ID: References: <87r4qbodec.fsf@Rainer.invalid> <5051974D.2020106@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1348242819 31889 80.91.229.3 (21 Sep 2012 15:53:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2012 15:53:39 +0000 (UTC) To: 12392@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 17:53:43 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 1TF5Xy-0007pO-Lt for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 17:53:42 +0200 Original-Received: from localhost ([::1]:42817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF5Xu-0005DS-42 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 11:53:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF5Xm-0005B8-8N for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 11:53:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF5Xh-00069h-8D for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 11:53:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF5Xh-00069d-5F for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 11:53:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TF5ZG-00050x-5L for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 11:55: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: Fri, 21 Sep 2012 15:55: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.134824285819216 (code B ref 12392); Fri, 21 Sep 2012 15:55:02 +0000 Original-Received: (at 12392) by debbugs.gnu.org; 21 Sep 2012 15:54:18 +0000 Original-Received: from localhost ([127.0.0.1]:47296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF5YX-0004zs-De for submit@debbugs.gnu.org; Fri, 21 Sep 2012 11:54:18 -0400 Original-Received: from mail-ie0-f172.google.com ([209.85.223.172]:50597) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF03U-0004TF-6z for 12392@debbugs.gnu.org; Fri, 21 Sep 2012 06:01:53 -0400 Original-Received: by iec9 with SMTP id 9so5201390iec.3 for <12392@debbugs.gnu.org>; Fri, 21 Sep 2012 03:00:15 -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 :content-type; bh=6s4W+k4T9v2AcO5GNJiQRrDaSyDM/l7VAgwsiE+Xz/I=; b=l+KXNNvNOaK4B12WxWbJeZqtRWrvF2lryBHU8HG8qSpfjYb9wgoBILcLaLVyo9JOVy UGUO1Vb0L6G0isnjTbwLC+VOK6qn+lSsoCGnN8THCFlYKiY0Un0BsTIhC4/0aPPUYcon Chy5+M0LKbe4cmZcPP8BFO0NTCVJ+BCy6P73Hr1CaJCxa9YGKW4munqQ6lrC3QJgB+sX 1TkpWIwMRsVl6caUK4D8Up09qfUvrXOI63o3nnG7MyMEuGEGEWMoO0kv0XcDRoEY+VGV RzVcfpuXalZwnGh/a0T+HlO/rP1zz71gkL2szToqYoeH0cnMHU8h7PUCUhcnyPsQA4Nd 4pPw== Original-Received: by 10.50.88.194 with SMTP id bi2mr1132396igb.47.1348221615187; Fri, 21 Sep 2012 03:00:15 -0700 (PDT) Original-Received: by 10.64.28.204 with HTTP; Fri, 21 Sep 2012 02:59:55 -0700 (PDT) In-Reply-To: <5051974D.2020106@cs.ucla.edu> X-Mailman-Approved-At: Fri, 21 Sep 2012 11:54:15 -0400 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:64692 Archived-At: 2012/9/13 Paul Eggert : > This particular problem looks like it's probably an OpenSUSE bug, but > in general one cannot combine LC_NUMERIC=C with random encodings in > LC_CTYPE. It's safer if Emacs uses the C locale when parsing floating > point numbers. No, it's an Emacs bug, actually two of them: 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). 2. To make the parsing (and printing?) of number literals in Emacs Lisp locale-dependent is the wrong approach. 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. Note that inserting gtk_disable_setlocale() before gtk_init() does not help because this setting does not transcend to the loaded module. 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.