From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolay Kudryavtsev Newsgroups: gmane.emacs.help Subject: Re: ispell.el and multilanguage lines. Date: Mon, 7 Mar 2016 04:18:20 +0300 Message-ID: <56DCD6DC.60503@gmail.com> References: <56709EF2.2080302@gmail.com> <83y4cv12tr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1457313572 12765 80.91.229.3 (7 Mar 2016 01:19:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2016 01:19:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 07 02:19:25 2016 Return-path: Envelope-to: geh-help-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 1acjpT-00047o-RX for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Mar 2016 02:19:24 +0100 Original-Received: from localhost ([::1]:52835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acjpP-0003Qp-Jr for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Mar 2016 20:19:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acjpC-0003QE-PY for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 20:19:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acjp9-0003JP-J5 for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 20:19:06 -0500 Original-Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:35430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acjp9-0003IU-5G for help-gnu-emacs@gnu.org; Sun, 06 Mar 2016 20:19:03 -0500 Original-Received: by mail-lb0-x235.google.com with SMTP id bc4so113872757lbc.2 for ; Sun, 06 Mar 2016 17:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=nQx4Cu1k5aPxnHdNSWQHqboFkqCYBI/Zg2DTcG/r4io=; b=dxNTc0zwxiv985tLapW2PISHQN3CgmnwlXhzSvtnm3xkL6p4P1p9kjbDd3Nh/G6ef2 e4ZsloPnCEY0+BufrNOAvCw5mFNFrMi9Rp/7XklNGdyZYL/9pw+S98eAVjl1dZhY7mWu XVFB3KPQ1J3Yv9877wEoiLIUgl+Pkr66GqvLiuk3qnfm+BEofVUZernA8ujClcKlij4Z fw7JnE8lCKnlQ28+3n5Eypu7dVpjn9IRvjfPCW5BssrroVrf6uhFoDn3WmMo19rAS/wQ 2j8VSY4Wx0tnjVzbIo13X0O61eoeDgIJPU/b0BTAKjnvAwHn6E0a7gOIgfoo1ApIkuMk bD6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=nQx4Cu1k5aPxnHdNSWQHqboFkqCYBI/Zg2DTcG/r4io=; b=l8pe4EXUaZu24++b3C+w2MER8v39eCCg64XYctOQ4chocej/Codnu0OguWU+hfeAwr jb9MyqFt1Bkiac687gZj2S9IC/xUvJBjEUHjZXrXFEMtK5+vd/1s7wIIajAWlcAYOWqU vVELB1yBUAkJvAVCCpU3n9Bq4qSpbkq7519+Isul/1zHzzjIb1p4qR0TxIjIfXVHD0DU K2J0OTNgxqo3BeG/dYDNHShCiWCgHqfg/WjGYZhUJP9WfXg4fO+rC+dXO47G+o8xpR4f 3IzFsyjqDEFOadS1IWQM7g4X2+oHATF7TCJ7LPQaKM5R6EnTvpQikfauhT5l92Oned9t 0oYA== X-Gm-Message-State: AD7BkJL7U5Xs5QiWyFeJ3dsA62b+9gF6MdqRJljadjZCkne0Tbt4kbm8/N7eqJ+979/6Kg== X-Received: by 10.25.169.82 with SMTP id s79mr7031589lfe.47.1457313541796; Sun, 06 Mar 2016 17:19:01 -0800 (PST) Original-Received: from [192.168.199.2] (broadband-95-84-209-126.nationalcablenetworks.ru. [95.84.209.126]) by smtp.gmail.com with ESMTPSA id v140sm2423315lfd.24.2016.03.06.17.19.00 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2016 17:19:00 -0800 (PST) X-Google-Original-From: Nikolay Kudryavtsev User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <83y4cv12tr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::235 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109487 Archived-At: Sorry, for the very late reply, was somewhat busy, plus this stuff required somewhat extensive extra checking. > Emacs doesn't yet have a concept of the language of the text, > certainly not when several languages are mixed in a buffer. Ispell.el has CASECHARS and NOT-CASECHARS regular expressions in ispell-dictionary-alist. This should be enough for the purpose of differentiating Russian from English, if only it worked. But in practice, those regexps are not used correctly, since now ispell-get-line sends the whole line when re-search-forward finds CASECHARS within it. While I'd agree that the number of use cases, where CASECHARS and NOT-CASECHARS are useful is rather limited, fixing them seems easier than removing. > Yes, and the latest code base (of what will become Emacs 25.1) > supports this feature of Hunspell. I've tried that version, sure it fixes this bug , but I actually never had a problem with it in the first place, since you can avoid it in 24.5 by setting ispell-dictionary-alist manually after ispell-set-spellchecker-params had ran. > I believe that "mess" is fixed in the current code. So I suggest you > try the latest emacs-25 branch. There's a really confusing bug with the way hunspell behaves with Russian codepages on windows, that is not really emacs related. FYI: I'm using current hunspell from ezwinports. Let's start hunspell in windows cmd: chcp 1251 hunspell -a "" -d ru_RU -i cp1251 тестовоеслово testword Both of the above would result in spellchecking failures. Let's add them to the personal dictionary: *тестовоеслово *testword # Now, if you try exiting and starting hunspell again, both words would be considered correct, since they are in your personal dictionary. Here's where the bug comes into play. If you start some kind of bash, be it cygwin bash, or msys and try using hunspell there: hunspell -a "" -d ru_RU -i utf-8 testword would check ok, but тестовоеслово would fail. The same would happen within emacs. My best guess is that this happens because of some locale-connected environmental variable, that bash(and emacs) sets. So, in the end, I'm stuck with aspell and running one spellcheck per dictionary. -- Best Regards, Nikolay Kudryavtsev