From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24603: [PATCHv5 07/11] Introduce =?UTF-8?Q?=E2=80=98buffer-language=E2=80=99?= buffer-locar variable Date: Sat, 11 Mar 2017 11:29:35 +0200 Message-ID: <83bmt8duv4.fsf@gnu.org> References: <20170309215150.9562-1-mina86@mina86.com> <20170309215150.9562-8-mina86@mina86.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1489224673 19702 195.159.176.226 (11 Mar 2017 09:31:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 09:31:13 +0000 (UTC) Cc: 24603@debbugs.gnu.org To: Michal Nazarewicz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 11 10:31:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmdMf-0004Jq-KC for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 10:31:05 +0100 Original-Received: from localhost ([::1]:42559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdMl-00033q-Iv for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 04:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdMf-00033a-Bl for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmdMc-0006Bk-5f for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:31:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmdMc-0006Bg-1k for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmdMb-00040T-SO for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 04:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 09:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24603 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24603-submit@debbugs.gnu.org id=B24603.148922460315263 (code B ref 24603); Sat, 11 Mar 2017 09:31:01 +0000 Original-Received: (at 24603) by debbugs.gnu.org; 11 Mar 2017 09:30:03 +0000 Original-Received: from localhost ([127.0.0.1]:50247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmdLe-0003y3-9T for submit@debbugs.gnu.org; Sat, 11 Mar 2017 04:30:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmdLd-0003xO-60 for 24603@debbugs.gnu.org; Sat, 11 Mar 2017 04:30:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmdLU-0005sK-S6 for 24603@debbugs.gnu.org; Sat, 11 Mar 2017 04:29:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmdLU-0005sG-Or; Sat, 11 Mar 2017 04:29:52 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4758 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cmdLU-0007eI-10; Sat, 11 Mar 2017 04:29:52 -0500 In-reply-to: <20170309215150.9562-8-mina86@mina86.com> (message from Michal Nazarewicz on Thu, 9 Mar 2017 22:51:46 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:130470 Archived-At: > From: Michal Nazarewicz > Date: Thu, 9 Mar 2017 22:51:46 +0100 > > diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el > index bdba8eeb112..d883e8c2298 100644 > --- a/lisp/international/mule-cmds.el > +++ b/lisp/international/mule-cmds.el > @@ -2601,7 +2601,7 @@ set-locale-environment > (setq system-messages-locale locale) > (setq system-time-locale locale)) > > - (if (string-match "^[a-z][a-z]" locale) > + (when (string-match "^[a-z][a-z]" locale) > ;; The value of 'current-iso639-language' is matched against > ;; the ':lang' property of font-spec objects when selecting > ;; and prioritizing available fonts for displaying > @@ -2613,7 +2613,11 @@ set-locale-environment > ;; match mentioned above uses memq, and ':lang' > ;; properties have lower-case values, the letter-case > ;; must match exactly. > - (intern (downcase (match-string 0 locale)))))) > + (intern (downcase (match-string 0 locale)))) > + > + ;; ‘buffer-language’ is used to identify language buffer is in for the > + ;; purpose of performing language-specific operations. > + (setq-default buffer-language locale))) This make buffer-language's value include the locale's codeset, which is unnecessary and might get in the way later. I think we should remove the codeset part, if present. In addition, there's the case of Windows, where languages use a different, 3-letter notation (e.g., "ENU" instead of the Posix "en_US"). So I think we need a function to generate the portable language name from the locale, which will need to use a database of conversions for Windows (this could be added later, if you like, but we need at least a FIXME comment to that effect). > + bset_language (&buffer_defaults, Qnil); It's hard to see if this default is TRT, since the practical meaning of nil here is not yet clear, not even after reading the doc string of buffer-language. The nil value is of course okay for special casing rules, but you propose this feature for more than that. For example, for spell-checking purposes, it is not clear what nil means. I have a higher-level comments on this feature, which I will post elsewhere. Last, but not least: can we have some tests for this? Thanks.