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.bugs Subject: bug#39898: 28.0.50; The off-by-one bug in `flyspell-check-previous-highlighted-word' Date: Fri, 28 Aug 2020 08:56:22 +0300 Message-ID: <831rjr1fg9.fsf@gnu.org> References: <874kv4bfhw.fsf@mail.parknet.co.jp> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38281"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39898@debbugs.gnu.org, hirofumi@mail.parknet.co.jp To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 28 07:57:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kBXNu-0009qY-I4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Aug 2020 07:57:10 +0200 Original-Received: from localhost ([::1]:40214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBXNs-0007hc-Un for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Aug 2020 01:57:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBXNn-0007hR-3u for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2020 01:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBXNm-0005Rh-JL for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2020 01:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kBXNm-0000SD-Hw for bug-gnu-emacs@gnu.org; Fri, 28 Aug 2020 01:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Aug 2020 05:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39898 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39898-submit@debbugs.gnu.org id=B39898.15985942021715 (code B ref 39898); Fri, 28 Aug 2020 05:57:02 +0000 Original-Received: (at 39898) by debbugs.gnu.org; 28 Aug 2020 05:56:42 +0000 Original-Received: from localhost ([127.0.0.1]:44893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBXNS-0000Rb-DG for submit@debbugs.gnu.org; Fri, 28 Aug 2020 01:56:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBXNP-0000RK-Sr for 39898@debbugs.gnu.org; Fri, 28 Aug 2020 01:56:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40595) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBXNI-0005Pi-SA; Fri, 28 Aug 2020 01:56:32 -0400 Original-Received: from [176.228.60.248] (port=1753 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kBXNI-00007X-7F; Fri, 28 Aug 2020 01:56:32 -0400 In-Reply-To: (message from Stefan Kangas on Thu, 27 Aug 2020 12:37:45 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186579 Archived-At: > From: Stefan Kangas > Date: Thu, 27 Aug 2020 12:37:45 -0700 > Cc: 39898@debbugs.gnu.org > > > With the following test, > > > > (with-temp-buffer > > (select-window (display-buffer (current-buffer))) > > (insert "appl") > > (flyspell-buffer) > > (flyspell-check-previous-highlighted-word)) > > > > `flyspell-check-previous-highlighted-word' calls `(error)'. But "appl" > > is the typo that should be fixed. > > > > At the following [**] mark in a that command, the ">" looks not allowing > > a typo at (point-min). Maybe the ">" should be the ">=". > > > > (defun flyspell-check-previous-highlighted-word (&optional arg) > > > > [...] > > > > (if (> pos (point-min)) <- [**] > > > > [...] > > > > (save-excursion > > (goto-char pos) > > (ispell-word) > > (setq flyspell-word-cache-word nil) ;; Force flyspell-word re-check > > (flyspell-word)) > > (error "No word to correct before point")))) > > Indeed, this just looks like an OBOE to me. Does it? The doc string of flyspell-check-previous-highlighted-word says: Correct the closest previous word that is highlighted as misspelled. This function scans for a word which starts before point that has been ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ highlighted by Flyspell as misspelled. The test case, AFAIU, creates a situation where the misspelled word starts _after_ point (remember that point is a place between 2 characters, and its value is the character following point). So I don't see a bug here. Am I missing something?