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: ispell.el and multilanguage lines. Date: Wed, 16 Dec 2015 02:14:58 +0300 Message-ID: <56709EF2.2080302@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1450221358 19835 80.91.229.3 (15 Dec 2015 23:15:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Dec 2015 23:15:58 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 16 00:15:51 2015 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 1a8yox-0003TM-1w for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Dec 2015 00:15:51 +0100 Original-Received: from localhost ([::1]:39551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yow-0000T3-Ce for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Dec 2015 18:15:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yol-0000Su-Sq for help-gnu-emacs@gnu.org; Tue, 15 Dec 2015 18:15:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8yoi-0006ul-J6 for help-gnu-emacs@gnu.org; Tue, 15 Dec 2015 18:15:39 -0500 Original-Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:33993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8yoi-0006ud-AC for help-gnu-emacs@gnu.org; Tue, 15 Dec 2015 18:15:36 -0500 Original-Received: by mail-lf0-x22c.google.com with SMTP id y184so17742969lfc.1 for ; Tue, 15 Dec 2015 15:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=PHbefqJ4xYu8PbWlCgp5QX+wFAhz3GlWBh9j656jyGg=; b=x5NvpdGpgx3p4sFyGjYraodGzmZE+4aZBosi9Pe0QsLLxYjf8iOuSKhagU9ifIs46H 5F4MuYv9ZXx6qeosHvPcVJ+XsPKXueq290QaURfO7ixE7ILXg6N9wOqTXg7THBKkseIo CIBRAdpgA55l5nQho9sRydav93yLWQ4hGnIXBHL7wlXpdstbYwbbubzg4Fe3G4TWA594 YLeEvl1jWXZxZq3NVVgWn8fPYedT5uOcYgllIllG+7mcp+rKgoBLr9wrdU1nKnHHzi4L ICA5OAzAlSTXYsF2HcmMkL553VNXvYvd3nRHWHa7s2/lSDX/Ayjt2heh69GYNwyY5mQ+ dRBA== X-Received: by 10.25.82.144 with SMTP id g138mr8988307lfb.8.1450221335643; Tue, 15 Dec 2015 15:15:35 -0800 (PST) Original-Received: from [192.168.199.5] (broadband-95-84-209-126.nationalcablenetworks.ru. [95.84.209.126]) by smtp.gmail.com with ESMTPSA id l5sm527220lbc.36.2015.12.15.15.15.34 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Dec 2015 15:15:34 -0800 (PST) X-Google-Original-From: Nikolay Kudryavtsev User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c 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:108410 Archived-At: Here's the problem I've found with ispell.el. As a bilingual person and an avid org-mode user I often have lines in multiple languages. The fact that Russian language has a different alphabet is great for the purpose of spell checking, since I can check English first, then switch dictionary and check Russian. And spell checker is supposed to ignore words not in the dictionary alphabet. ispell-dictionary-alist has all the facilities needed for this and it should work in theory. Here's where it fails in practice - ispell.el uses a function called ispell-region and what it does is that it sends buffer line by line and whether the line gets sent is decided by ispell-get-line where the criteria is (re-search-forward ispell-casechars end t) - that is if there's a match with the language for the current dictionary the whole line gets sent. And of course words in that line that are in a different language get considered misspelled by the spell checker. I tried checking in bug reports, but this does not seem to have been reported yet. I'll submit it as a bug later. There's a possible workaround if you're using hunspell, by using multiple dictionaries at the same time, like this: ("ru_RU,en_US" "[[:alpha:]]" "[^[:alpha:]]" "['0-9]" t ("-d" "ru_RU,en_US") nil koi8-r) But this creates a mess in user dictionaries. -- Best Regards, Nikolay Kudryavtsev