From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Artem Boldarev Newsgroups: gmane.emacs.bugs Subject: bug#32280: 26.1; FLYSPELL-BUFFER sometimes misbehaves for some input in a large enough buffer Date: Sun, 29 Jul 2018 17:09:54 +0300 Message-ID: References: <992503e5-5f88-30c7-e9b9-fe0a884d2e52@gmail.com> <83bmassv88.fsf@gnu.org> <29a7677b-47ad-a42b-17af-01ff4c06105e@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532873349 2389 195.159.176.226 (29 Jul 2018 14:09:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Jul 2018 14:09:09 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cc: 32280@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 29 16:09:05 2018 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 1fjmNd-0000YD-D9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jul 2018 16:09:05 +0200 Original-Received: from localhost ([::1]:48537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjmPk-0000oo-7U for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jul 2018 10:11:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjmPb-0000oC-HZ for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjmPW-0003Wf-Hd for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjmPW-0003Wb-EP for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fjmPW-00063w-9U for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Artem Boldarev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Jul 2018 14:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32280 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32280-submit@debbugs.gnu.org id=B32280.153287340523240 (code B ref 32280); Sun, 29 Jul 2018 14:11:02 +0000 Original-Received: (at 32280) by debbugs.gnu.org; 29 Jul 2018 14:10:05 +0000 Original-Received: from localhost ([127.0.0.1]:33964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjmOb-00062l-2L for submit@debbugs.gnu.org; Sun, 29 Jul 2018 10:10:05 -0400 Original-Received: from mail-lf1-f67.google.com ([209.85.167.67]:35437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjmOZ-000629-GH for 32280@debbugs.gnu.org; Sun, 29 Jul 2018 10:10:03 -0400 Original-Received: by mail-lf1-f67.google.com with SMTP id f18-v6so6419072lfc.2 for <32280@debbugs.gnu.org>; Sun, 29 Jul 2018 07:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=vF5bKXfSZbqp76vH0ND+h3DR0BMZeV5BhKaH62iu5s4=; b=cryGZk4xe1CAxW8Krkb42jyAHhH3B+9+Boc1JaR2mDF5ihRTskZTv9w0WIJ6wLnXJp PYyK8p6nRWWEaPgSZsrhYWp/54VYbQCy//Hwvr7ze/RCkz7NtEatIFJaWUS+PsSlsODj pZq5wJROtFyzFoDZEnUCs2pO054S57vM/L+BWc7t1exctBtzMvE9ox23lu563zfGN+b2 CWMTwrHKgV/v8I0KsNsohN0ZJ0xBxtJi0dm/Q4zwVyFJYOi7TKlp6cTj/YJnzukY2RJW kEqvd0yS5MlrS7WJAl5icvzVXYTKkFVtSy04f2yaoTIvo35GubWeEuKyhxDbxlwIPvYS bA5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=vF5bKXfSZbqp76vH0ND+h3DR0BMZeV5BhKaH62iu5s4=; b=jSznqqklQj9ffagOcxo4MAs8pHeY3kKPuJZD3QIaW83L6mSc7DfqYA04ryoRznSmBy JZXxpoe3JMbZXcRow3jlbAz24lDniVz+GyCxecNUSQAQX+p+U9gjV8oX5OOC2kMu4Gch YKmKSv4bD1EMF7HC5y5C0ldpfiWvoGZhTu7+mN3Wx4sH0LlkoVfXESVN+f2GxZPUt0nY nHsdP0/qqqkOd4Tw5EyZxlNd34AsmrriUFUJ8dNLSBKg1WPe3rNVJad4w5bhNqGLIo/8 LhKQCFwK+2TDOMOLTbEO+2ZyXtn+dxdE7RDSfnwCB6xV/ajESsDGlwh2Dws2YbbJ+KHw d7og== X-Gm-Message-State: AOUpUlEE7fZuXrSl8wfJyHHM8aCXa3EtFxLVh1nKb0kXg84v6fHgVfqR ERO2Fdm1E/8DfA+6hrum7jQUuk/m X-Google-Smtp-Source: AAOMgpdHJAtJ8LXFe79pvRlkJVEeCbQbLvv2YgVolxbDqPaaKhg90XnDTfePCMJ1olvpDZCWlX5wRQ== X-Received: by 2002:a19:db44:: with SMTP id s65-v6mr7838221lfg.109.1532873397057; Sun, 29 Jul 2018 07:09:57 -0700 (PDT) Original-Received: from ?IPv6:2a01:d0:dec0:0:1d18:8e73:1956:539e? ([2a01:d0:dec0:0:1d18:8e73:1956:539e]) by smtp.gmail.com with ESMTPSA id k65-v6sm1590913lje.3.2018.07.29.07.09.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jul 2018 07:09:56 -0700 (PDT) In-Reply-To: <29a7677b-47ad-a42b-17af-01ff4c06105e@gmail.com> Content-Language: ru 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:149047 Archived-At: Hello, I have crafted some sample data as well as wrote instruction how to reproduce the bug. The sample file can be found by following this link: https://chaoticlab.io/pub/flyspell-bug/flyspell-sample.txt The instruction alongside with the required code can be downloaded from here: https://chaoticlab.io/pub/flyspell-bug/flyspell-bug-reproduction.el I made some screenshots which demonstrate the bug: https://chaoticlab.io/pub/flyspell-bug/flyspell-bug-linux.png https://chaoticlab.io/pub/flyspell-bug/flyspell-bug-windows.png I haven't been able to demonstrate the case when a misspelt word is not highlighted though. I will send an update should I craft the required data. I hope this is helpful. Regards, Artem > Hello Eli, >> Can you post the text where this happens? > The text where I encountered the problem is a personal e-mail, so I > can not share it as it is. I will try to craft a sample text and > describe the steps for bug reproduction using emacs -Q. >> AFAICT, you have removed a single line: >> >>                  (< found-length misspell-length) > > I am also replaced: > ;; Size matches, we really found it. > (= found-length misspell-length) > > with > > ;; Size and content matches, we really found it. >  (and (= found-length misspell-length) >           (string= found word)) > > I believe, in this case there is no need in  (< found-length > misspell-length) anymore. >> Can you take me through your reasoning why this line is incorrect, and >> what assumptions it made that are correct for English, but not for >> Russian? > As about my reasoning behind the changes: I felt that it is not right > to mark the word as misspelt without actually checking the content. > Moreover, look at the original comment right behind the (< > found-length misspell-length) line: >                  ;; Misspelling has higher length than >                  ;; what flyspell considers the word. >                              ;; Caused by boundary-chars mismatch. >                              ;; Validating seems safe. > I am not sure that comparing length of found word and misspelt word is > enough to make an assumption that validating is safe (even considering > the preceding checks). The keyword here, I think, is 'seems'. For some > reason, it really works most of the time. > > I believe that the bug should be possible to reproduce for texts in > English too. For some reason, I have not encountered this problem > while spell checking English. I should note that flyspell-buffer works > fine for *most* of the texts in Russian and Ukrainian which I have > checked and the discussed issue is rarely encountered. I did not know > that It exists until  I started using flyspell-buffer regularly. > > Kind regards, > Artem >