From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master e4e1e268c8e 2/2: Set a default locale on Android Date: Fri, 08 Dec 2023 16:31:08 +0200 Message-ID: <83r0jwzryr.fsf@gnu.org> References: <83sf4d2894.fsf@gnu.org> <83il5919fo.fsf@gnu.org> <87edfxmbnk.fsf@yahoo.com> <83edfx189r.fsf@gnu.org> <87a5qlma25.fsf@yahoo.com> <838r6516jc.fsf@gnu.org> <875y19m1es.fsf@yahoo.com> <83v898zxp3.fsf@gnu.org> <871qbwn76t.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35580"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 08 15:31:43 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBbtH-00093c-Hu for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Dec 2023 15:31:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBbsj-0003t4-1T; Fri, 08 Dec 2023 09:31:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBbsh-0003s0-5L for emacs-devel@gnu.org; Fri, 08 Dec 2023 09:31:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBbsc-0004cl-Rl; Fri, 08 Dec 2023 09:31:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=55ea3oUGpVWCeNWLj5p3SOtTbKiL+AD92sw8Nr3HDU4=; b=maJWSNUshK83 Db0uGE8CeSD7I27nDHvy28ajI6UWOVgrBevHNxZXGWRlO8uipCgmsKWxI/4NZ/uVeQvIWnBi5tRVd iDYn+QI2pQqGKJvKAKEyspa2Sz2VLfWwbN9q1YFSHpxiy3rjmNW6BiA1rYhUo5vIr8fSAE48dvyWZ aDA4a1Cqsc4Zp4mbIZz8JGcKJjrGzC5fWBNkBnuSY8ZmBFgz0vaxEA9R5QuN/mGc0Q8eZArLL+MmF RlT/kbDT7qhE3u2nPemJpR1FelsfrZXQAVYUhHhVUla7TBJfcS+cr8GyZkSF/TGSPD62FTSeGbrPW nJFMj9GjoEyqetRNGlrATA==; In-Reply-To: <871qbwn76t.fsf@yahoo.com> (message from Po Lu on Fri, 08 Dec 2023 21:40:42 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:313618 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Fri, 08 Dec 2023 21:40:42 +0800 > > Eli Zaretskii writes: > > >> The system's locale is _always_ UTF-8. > > > > Now I'm confused: if the above is true, then what is the below about? > > > > Emacs does not respect the locale configured for user applications > > in the system, for the selection of locales available there does not > > match that supplied by the C library. When Emacs starts on Android > > 5.0 or newer, the @code{LANG} environment variable is set to > > @code{en_US.utf8}, which induces subprocesses linked against the > > Android C library to print output sensibly. > > > > My interpretation of this was that Android does support locales > > "configured for user applications", but Emacs doesn't respect that. > > If that interpretation is incorrect, then how should the above text be > > interpreted? And what does "locale configured for user application" > > mean then? > > I could've chosen better nomenclature. That was meant as a reference to > the system's configured language, in Settings. Then at least the language part of the locale-dependent defaults in Emacs should follow those settings, IMO. > > Let's defer this question until we are on the same page wrt locales > > and language settings on Android. As an active user of Android > > (though not of Emacs on Android), I know that there _are_ > > configuration settings for system language and for each application, > > they are under Settings->General Management->Language and > > Settings->General Management->App Languages. There are also settings > > for keyboard, which are conceptually part of the language-environment > > in Emacs. Some Android smartphones also have Regional Preferences. > > Yes, but these don't affect the value of the LANG variable, and each of > the languages within uses the UTF-8 coding system. FTR, this is System > -> Languages & Input -> Languages for me. If UTF-8 is the standard on Android, then it's okay to have that as the default coding-system. But why ignore the language part? We should make sure the Emacs language-environment is set up at startup according to the language settings, either those specific to Emacs, or using the system default as the fallback. Any reasons not to do that? There are quite a few Emacs features that are sensitive to the current language, and they should ideally continue working on Android. > > How will that work with ispell.el in Emacs? > > Probably the copy of aspell must be modified; but the spell checker I > personally use on Android systems is jinx from ELPA, which is much > faster, and requires the default language be set by hand. Set by hand after entering the speller, or set by hand via some kind of invocation-time arguments/switches? Please note that Emacs can change the dictionary during a running Emacs session (one way is due to the user's invoking the ispell-change-dictionary command explicitly, but that's not the only one). Are you saying that this cannot possibly work on Android? That would mean that Emacs users on Android will be unable to spell-check buffers in different languages in the same Emacs session.