GNU bug report logs - #50443
Fwd: Flyspell error traversal additions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Kangas <stefan@HIDDEN>; Keywords: patch; dated Tue, 7 Sep 2021 00:23:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50443 <at> debbugs.gnu.org:


Received: (at 50443) by debbugs.gnu.org; 10 Sep 2021 06:50:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 10 02:50:12 2021
Received: from localhost ([127.0.0.1]:36748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOaMW-0001te-42
	for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 02:50:12 -0400
Received: from mail-pj1-f48.google.com ([209.85.216.48]:41639)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1mOaMU-0001tI-4G
 for 50443 <at> debbugs.gnu.org; Fri, 10 Sep 2021 02:50:10 -0400
Received: by mail-pj1-f48.google.com with SMTP id
 m21-20020a17090a859500b00197688449c4so817215pjn.0
 for <50443 <at> debbugs.gnu.org>; Thu, 09 Sep 2021 23:50:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=oP4qlBALSih4EGXrXVzPOOFy7gCESngZXdFcjXIPQCs=;
 b=VotI2qYXq3AotuW37LJ5UgmluSdbYALwYg+DXnFmwY1kye7ZpG6G/wpaRmJxt14yK7
 wt7XkOSnfGornOzH7RQeou9XEe9oW1/8A2EwrRBuk8Has/e9drSuQLWZ51owKMKNIGre
 yx+zvGIueYSvEuYdO46f0aLI2OWoO8OgqHfDZszTbWxt/zm6d1BOxXBNQP9umi/7GqpC
 6bG/fzwilGXiP9jx/HzRsfN1X66Yg/Y4m04sSWZbeqj/p4T0QuceP4UvzHWW6J3rQlE7
 NxwkzB9OXoBXj0GP0wckWLdfDqsHMG7gMlhOxO7VH6rkDlJcNbZgT7OSfeuBLy6V+2PS
 NjUQ==
X-Gm-Message-State: AOAM533h/ZPqAuift+FwqCI7Lrlgy2jpp6vq9ISRhNgUeI5hL/Nw76Wj
 tIgiNRLHitBbBFaD4KNZmXchQIchl84QxzA6LCk=
X-Google-Smtp-Source: ABdhPJwUkgI7uNJHznuWErBihadiyt1QuS/RNwu0mLpjaFGIV2VbpJ9zerHKNL0/qFKMFgCv3rdxZ5tkUuJIiydwu7Q=
X-Received: by 2002:a17:90a:7c42:: with SMTP id
 e2mr7858534pjl.132.1631256604168; 
 Thu, 09 Sep 2021 23:50:04 -0700 (PDT)
MIME-Version: 1.0
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
 <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
 <87mtolviln.fsf@HIDDEN> <87y28554pi.fsf@HIDDEN>
In-Reply-To: <87y28554pi.fsf@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Fri, 10 Sep 2021 08:49:53 +0200
Message-ID: <CADwFkm=MzWSRdqSnHSuY0SYO562bao6FZw3KdxCe6kKRDWr8dA@HIDDEN>
Subject: Re: bug#50443: Fwd: Flyspell error traversal additions
To: Juri Linkov <juri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 50443
Cc: 50443 <at> debbugs.gnu.org, roni kallio <roni@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Juri Linkov <juri@HIDDEN> writes:

> Maybe we could add another standard keybinding localized for navigation
> in the current buffer only, e.g. 'M-g N' and 'M-g P' that could be used
> by flyspell, flymake, etc.

Works for me, but it seems unfortunate to put this on keys that are
somewhat inconvenient to type (switching between modifiers is rarely
fun).  What about 'M-g b' and 'M-g f'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.

Message received at 50443 <at> debbugs.gnu.org:


Received: (at 50443) by debbugs.gnu.org; 10 Sep 2021 06:44:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 10 02:44:38 2021
Received: from localhost ([127.0.0.1]:36728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOaH8-0001jV-Hl
	for submit <at> debbugs.gnu.org; Fri, 10 Sep 2021 02:44:38 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46471)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mOaH6-0001jF-IX
 for 50443 <at> debbugs.gnu.org; Fri, 10 Sep 2021 02:44:36 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id D426020002;
 Fri, 10 Sep 2021 06:44:29 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#50443: Fwd: Flyspell error traversal additions
Organization: LINKOV.NET
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
 <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
 <87mtolviln.fsf@HIDDEN>
Date: Fri, 10 Sep 2021 09:39:37 +0300
In-Reply-To: <87mtolviln.fsf@HIDDEN> (Juri Linkov's message of "Thu, 
 09 Sep 2021 20:24:44 +0300")
Message-ID: <87y28554pi.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50443
Cc: 50443 <at> debbugs.gnu.org, roni kallio <roni@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> Adding a negative argument to `flyspell-goto-next-error'
> is the most non-conflicting solution.  There was an idea
> to use 'M-g n' and 'M-g p' to navigate flyspell errors.
> But I don't believe this is workable since often 'M-g n'
> and 'M-g p' are needed to navigate errors or search hits
> displayed in another window with a list of results.

Maybe we could add another standard keybinding localized for navigation
in the current buffer only, e.g. 'M-g N' and 'M-g P' that could be used
by flyspell, flymake, etc.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.

Message received at 50443 <at> debbugs.gnu.org:


Received: (at 50443) by debbugs.gnu.org; 9 Sep 2021 21:58:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 17:58:44 2021
Received: from localhost ([127.0.0.1]:36365 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOS4C-00013r-Fk
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 17:58:44 -0400
Received: from mail-lj1-f171.google.com ([209.85.208.171]:37796)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <roni.jj.kallio@HIDDEN>) id 1mORPe-0008VO-JS
 for 50443 <at> debbugs.gnu.org; Thu, 09 Sep 2021 17:16:51 -0400
Received: by mail-lj1-f171.google.com with SMTP id r3so5168862ljc.4
 for <50443 <at> debbugs.gnu.org>; Thu, 09 Sep 2021 14:16:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject:date
 :in-reply-to:message-id:mime-version;
 bh=HIDMK9N1JFnuFlimxPT9UQar639yTZNCXkkmPPMQkGE=;
 b=tzY225NUSnLFa1EdPk3FcytM4KrM+d7AiKcNJsJcbE3dEu44AGb0WF29JyGUIUfbMo
 Ae15NUXzV0YFFM8CAdj9eXInTyTfj4s3Dg3V3h2lX3diKEH974+KvmHufdbB8Lwz+xEY
 Ph2r7HKQrINcQb88qIj7Zw9p5KQSTdC1uaizc7OtAFHRBCldwO3jPL3W3rzmHinC4xBB
 yc48+CPELDyhre9+vl01KZdaBDqlgtz7cy6HZMuEO+4ni4GOcURBHxsIMLW57vS3hRi9
 IsqYXI/kfLX0hLhQFFo6VVWkkG4UHz4SH+7wEPM7HSjXVFMY2JnDvV8ZjsZ9JBR1FNiX
 G10g==
X-Gm-Message-State: AOAM531CHrPYPYhMeYsV1BGB1CPg2WNOA0B20zYaRtk0/6OdUjghsZlP
 rlXJNqLxYmfsPk/i1eBV/wHMeeGHWGo=
X-Google-Smtp-Source: ABdhPJwP1uxYDjlR3SGFg3s0iOmGVheRgbcuWSVP+XhPAO1VH1eFXU4vcG24ecQ5gC5EEfNKj6bVXA==
X-Received: by 2002:a05:651c:503:: with SMTP id
 o3mr1486106ljp.528.1631222204281; 
 Thu, 09 Sep 2021 14:16:44 -0700 (PDT)
Received: from phobos.gmail.com (cable-hml-50dcf4-126.dhcp.inet.fi.
 [80.220.244.126])
 by smtp.gmail.com with ESMTPSA id m15sm313349lfg.59.2021.09.09.14.16.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Sep 2021 14:16:43 -0700 (PDT)
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
 <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
 <831r61q66n.fsf@HIDDEN>
User-agent: mu4e 1.6.0; emacs 28.0.50
From: Roni Kallio <roni@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50443: Fwd: Flyspell error traversal additions
Date: Thu, 09 Sep 2021 23:58:19 +0300
In-reply-to: <831r61q66n.fsf@HIDDEN>
Message-ID: <87a6kle9fp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 50443
X-Mailman-Approved-At: Thu, 09 Sep 2021 17:58:43 -0400
Cc: 50443 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

>> IMO the best course of action would be to modify
>> `flyspell-goto-next-error' to accept a prefix argument.  The prefix
>> would control the direction and number of jumps performed; negative
>> arguments would jump backwards -ARG errors (by calling
>> flyspell-goto-previous-error), while positive arguments would jump
>> forwards ARG errors.  This would be similar to how commands like
>> `forward-word' handle prefix arguments.  This would allow us to leave
>> the mode-map unchanged, but still distribute the improvement to all
>> users.
>
> Yes, I agree.  Can you change the patch to work this way?

I've been using this updated patch for a while now, hope it comes
through ok.

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 975f540936..b80626bb12 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1708,39 +1708,77 @@ flyspell-old-pos-error
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-goto-next-error ...                                     */
 ;;*---------------------------------------------------------------------*/
-(defun flyspell-goto-next-error ()
-  "Go to the next previously detected error.
-In general FLYSPELL-GOTO-NEXT-ERROR must be used after
-FLYSPELL-BUFFER."
-  (interactive)
-  (let ((pos (point))
-	(max (point-max)))
-    (if (and (eq (current-buffer) flyspell-old-buffer-error)
-	     (eq pos flyspell-old-pos-error))
-	(progn
-	  (if (= flyspell-old-pos-error max)
-	      ;; goto beginning of buffer
-	      (progn
-		(message "Restarting from beginning of buffer")
-		(goto-char (point-min)))
-	    (forward-word 1))
-	  (setq pos (point))))
-    ;; seek the next error
-    (while (and (< pos max)
-		(let ((ovs (overlays-at pos))
-		      (r '()))
-		  (while (and (not r) (consp ovs))
-		    (if (flyspell-overlay-p (car ovs))
-			(setq r t)
-		      (setq ovs (cdr ovs))))
-		  (not r)))
-      (setq pos (1+ pos)))
-    ;; save the current location for next invocation
-    (setq flyspell-old-pos-error pos)
-    (setq flyspell-old-buffer-error (current-buffer))
-    (goto-char pos)
-    (if (= pos max)
-	(message "No more miss-spelled word!"))))
+(defun flyspell-goto-next-error (&optional arg)
+  "Go to the detected error that is ARG errors forward.
+In general `flyspell-goto-next-error' must be used after
+`flyspell-buffer'."
+  (interactive "p")
+  (cond
+   ((= arg 0) nil)
+   ((< arg 0) (flyspell-goto-previous-error (abs arg)))
+   (t
+    (let ((pos (point))
+	  (max (point-max)))
+      (if (and (eq (current-buffer) flyspell-old-buffer-error)
+	       (eq pos flyspell-old-pos-error))
+	  (progn
+	    (if (= flyspell-old-pos-error max)
+	        ;; goto beginning of buffer
+	        (progn
+		  (message "Restarting from beginning of buffer")
+		  (goto-char (point-min)))
+	      (forward-word 1))
+	    (setq pos (point))))
+      ;; seek the next error
+      (while (and (< pos max)
+		  (let ((ovs (overlays-at pos))
+		        (r '()))
+		    (while (and (not r) (consp ovs))
+		      (if (flyspell-overlay-p (car ovs))
+			  (setq r t)
+		        (setq ovs (cdr ovs))))
+		    (not r)))
+        (setq pos (1+ pos)))
+      ;; save the current location for next invocation
+      (setq flyspell-old-pos-error pos)
+      (setq flyspell-old-buffer-error (current-buffer))
+      (goto-char pos)
+      (if (= pos max)
+	  (message "No more miss-spelled word!")))
+    (flyspell-goto-next-error (1- arg)))))
+
+(defun flyspell-goto-previous-error (&optional arg)
+  "Go to the detected error ARG errors backward.
+In general `flyspell-goto-previous-error' must be used after
+`flyspell-buffer'."
+  (interactive "p")
+  (cond
+   ((= arg 0) nil)
+   ((< arg 0) (flyspell-goto-next-error (abs arg)))
+   (t
+    (let ((min (point-min)))
+      (when (and (eq (current-buffer) flyspell-old-buffer-error)
+                 (eq (point) flyspell-old-pos-error))
+        (when (= (point) min)
+          (message "Restarting from end of buffer")
+          (goto-char (point-max)))
+        (backward-word 1))
+      (while (and (> (point) min)
+                  (let ((ovs (overlays-at (point)))
+                        (r nil))
+                    ;; look for a flyspell overlay
+                    (while (and (not r) (consp ovs))
+                      (if (flyspell-overlay-p (car ovs))
+                          (setq r t)
+                        (setq ovs (cdr ovs))))
+                    (not r)))
+        ;; go to previous word if no overlay was found
+        (backward-word 1))
+      (setq flyspell-old-pos-error (point))
+      (setq flyspell-old-buffer-error (current-buffer))
+      (when (= (point) min)
+        (message "No more miss-spelled word!")))
+    (flyspell-goto-previous-error (1- arg)))))

 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-overlay-p ...                                           */

> Also, the patch is long enough to require a copyright assignment from
> you.  Would you be willing to start your legal paperwork at this time,
> so we could accept your contribution when it is complete?

Sure, can you direct me to what I need to do to sign?
--
Roni Kallio




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.

Message received at 50443 <at> debbugs.gnu.org:


Received: (at 50443) by debbugs.gnu.org; 9 Sep 2021 17:58:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 09 13:58:18 2021
Received: from localhost ([127.0.0.1]:36158 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mOOJW-0007g7-Dw
	for submit <at> debbugs.gnu.org; Thu, 09 Sep 2021 13:58:18 -0400
Received: from relay12.mail.gandi.net ([217.70.178.232]:47923)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mOOJU-0007fd-MM
 for 50443 <at> debbugs.gnu.org; Thu, 09 Sep 2021 13:58:17 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay12.mail.gandi.net (Postfix) with ESMTPSA id 9C557200005;
 Thu,  9 Sep 2021 17:58:08 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#50443: Fwd: Flyspell error traversal additions
Organization: LINKOV.NET
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
 <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
Date: Thu, 09 Sep 2021 20:24:44 +0300
In-Reply-To: <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
 (Stefan Kangas's message of "Tue, 7 Sep 2021 02:22:29 +0200")
Message-ID: <87mtolviln.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50443
Cc: 50443 <at> debbugs.gnu.org, roni kallio <roni@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> IMO the best course of action would be to modify
> `flyspell-goto-next-error' to accept a prefix argument.  The prefix
> would control the direction and number of jumps performed; negative
> arguments would jump backwards -ARG errors (by calling
> flyspell-goto-previous-error), while positive arguments would jump
> forwards ARG errors.  This would be similar to how commands like
> `forward-word' handle prefix arguments.  This would allow us to leave
> the mode-map unchanged, but still distribute the improvement to all
> users.

Adding a negative argument to `flyspell-goto-next-error'
is the most non-conflicting solution.  There was an idea
to use 'M-g n' and 'M-g p' to navigate flyspell errors.
But I don't believe this is workable since often 'M-g n'
and 'M-g p' are needed to navigate errors or search hits
displayed in another window with a list of results.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.

Message received at 50443 <at> debbugs.gnu.org:


Received: (at 50443) by debbugs.gnu.org; 7 Sep 2021 05:57:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 07 01:57:07 2021
Received: from localhost ([127.0.0.1]:55224 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNU6V-0003wL-3E
	for submit <at> debbugs.gnu.org; Tue, 07 Sep 2021 01:57:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60360)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mNU6T-0003vr-AZ
 for 50443 <at> debbugs.gnu.org; Tue, 07 Sep 2021 01:57:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38190)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mNU6N-0007uW-EC; Tue, 07 Sep 2021 01:56:59 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2792
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mNU6N-00077q-0h; Tue, 07 Sep 2021 01:56:59 -0400
Date: Tue, 07 Sep 2021 08:57:04 +0300
Message-Id: <831r61q66n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
 (message from Stefan Kangas on Tue, 7 Sep 2021 02:22:29 +0200)
Subject: Re: bug#50443: Fwd: Flyspell error traversal additions
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
 <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50443
Cc: 50443 <at> debbugs.gnu.org, roni@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefan@HIDDEN>
> Date: Tue, 7 Sep 2021 02:22:29 +0200
> Cc: roni kallio <roni@HIDDEN>
> 
> This was sent to emacs-devel, but never followed up.  I'm forwarding
> to the bug tracker so that we don't lose track of it.

Thanks.

> Från: Roni Kallio <roni@HIDDEN>
> Date: tors 28 jan. 2021 kl 14:59
> Subject: Flyspell error traversal additions
> To: <emacs-devel@HIDDEN>
> 
> 
> While consolidating my spell/syntax checking setup, I noticed that
> flyspell lacks a command to jump to the nearest error that is before the
> point in a buffer.  There exists `flyspell-goto-next-error', which of
> course loops back to beginning when the end of the buffer is reached,
> but no equivalent command for going backwards.
> 
> I have attached a patch that implements backwards traversal, making sure
> it acts analogous to `flyspell-goto-next-error'.

Thanks.

> IMO the best course of action would be to modify
> `flyspell-goto-next-error' to accept a prefix argument.  The prefix
> would control the direction and number of jumps performed; negative
> arguments would jump backwards -ARG errors (by calling
> flyspell-goto-previous-error), while positive arguments would jump
> forwards ARG errors.  This would be similar to how commands like
> `forward-word' handle prefix arguments.  This would allow us to leave
> the mode-map unchanged, but still distribute the improvement to all
> users.

Yes, I agree.  Can you change the patch to work this way?

Also, the patch is long enough to require a copyright assignment from
you.  Would you be willing to start your legal paperwork at this time,
so we could accept your contribution when it is complete?

> I'd like to open a discussion on whether it would be feasible to
> have a key binding in `flyspell-mode-map' for this command.  For
> reference, the bindings currently are:
> 
> C-;   -- flyspell-auto-correct-previous-word
> C-,   -- flyspell-goto-next-error
> C-.   -- flyspell-auto-correct-word
> C-c $ -- flyspell-correct-word-before-point

I'm not sure these won't conflict with other minor modes.  And these
keys are not available on text-mode frames, which is a disadvantage.
But let's hear what others think.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Sep 2021 00:22:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 06 20:22:46 2021
Received: from localhost ([127.0.0.1]:54770 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mNOsw-0003Vn-BY
	for submit <at> debbugs.gnu.org; Mon, 06 Sep 2021 20:22:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:35560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1mNOsu-0003Vf-O5
 for submit <at> debbugs.gnu.org; Mon, 06 Sep 2021 20:22:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58750)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>)
 id 1mNOsu-00031H-I5
 for bug-gnu-emacs@HIDDEN; Mon, 06 Sep 2021 20:22:44 -0400
Received: from mail-pj1-f49.google.com ([209.85.216.49]:40723)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>)
 id 1mNOst-0003h3-3H
 for bug-gnu-emacs@HIDDEN; Mon, 06 Sep 2021 20:22:44 -0400
Received: by mail-pj1-f49.google.com with SMTP id
 n13-20020a17090a4e0d00b0017946980d8dso383730pjh.5
 for <bug-gnu-emacs@HIDDEN>; Mon, 06 Sep 2021 17:22:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to;
 bh=Y4Kz8aLmGS2+1cAkJw8iuuAo0VS2ubaIfJOrykNpHb0=;
 b=FMe69tJYQGXdD2/Pk8n2tE3bT1aMqOAgHp27/j1Y2sdRgU8uc/HXpwudROK64FVYmU
 BxPEWI7G7JR2+tpp7kDrL5iw2+3LAkyKvdh+60fl53IdjarFhXCdTwkC2JWLcCqVMBDr
 ZJnLjv9QowwCi50K6uRTU9Qz62msjoa6XVCza2dGAeI2KjYAdLrN6h7IqPj/dr7g+Feu
 8xIlfgJi1RzwEXo91T2SP7AYjvct1gVSxDlrlM5e7MD8wg2niRTO+/ms0sNSO9oN0Hs4
 Da4XEKa9/8PCXs1v8i5fKDVJ60GtFvdSmKVlcxyJZiMZtZmgwgwGcp82SuJWtvLTgBRc
 BGuA==
X-Gm-Message-State: AOAM532AH3Wd5jRtg/WULv6F3s8nrfZdzNPi3Sl9rumQMkQm4JVOtS8F
 Vk1gnr1kHi3WWTMhg5mvDlgVTIzCAm7Q7mC2+Pqw9zkRRCg=
X-Google-Smtp-Source: ABdhPJyUz3YDeTBJ4dDMhXh/xFY6OhVYaiK0z0KLPlxWurW4J/m73KR2jWGHUQL/cXNMCdj7LA9bzQIXMhccZ29IyC4=
X-Received: by 2002:a17:90b:3812:: with SMTP id
 mq18mr1552012pjb.143.1630974161318; 
 Mon, 06 Sep 2021 17:22:41 -0700 (PDT)
MIME-Version: 1.0
References: <87sg6lchgc.fsf@HIDDEN> <87r1m5ch9n.fsf@HIDDEN>
In-Reply-To: <87r1m5ch9n.fsf@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Tue, 7 Sep 2021 02:22:29 +0200
Message-ID: <CADwFkm==pCKz+0eirFtmcZr-fKx5m7cOKZYPRt1KGCTX5Bc8BA@HIDDEN>
Subject: Fwd: Flyspell error traversal additions
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary="00000000000086142105cb5cc38c"
Received-SPF: pass client-ip=209.85.216.49;
 envelope-from=stefankangas@HIDDEN; helo=mail-pj1-f49.google.com
X-Spam_score_int: -13
X-Spam_score: -1.4
X-Spam_bar: -
X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25,
 FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

--00000000000086142105cb5cc38c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

X-Debbugs-CC: Roni Kallio <roni@HIDDEN>

This was sent to emacs-devel, but never followed up.  I'm forwarding
to the bug tracker so that we don't lose track of it.

---------- Forwarded message ---------
Fr=C3=A5n: Roni Kallio <roni@HIDDEN>
Date: tors 28 jan. 2021 kl 14:59
Subject: Flyspell error traversal additions
To: <emacs-devel@HIDDEN>


While consolidating my spell/syntax checking setup, I noticed that
flyspell lacks a command to jump to the nearest error that is before the
point in a buffer.  There exists `flyspell-goto-next-error', which of
course loops back to beginning when the end of the buffer is reached,
but no equivalent command for going backwards.

I have attached a patch that implements backwards traversal, making sure
it acts analogous to `flyspell-goto-next-error'.  I'd like to open a
discussion on whether it would be feasible to have a key binding in
`flyspell-mode-map' for this command.  For reference, the bindings
currently are:

C-;   -- flyspell-auto-correct-previous-word
C-,   -- flyspell-goto-next-error
C-.   -- flyspell-auto-correct-word
C-c $ -- flyspell-correct-word-before-point

IMO the best course of action would be to modify
`flyspell-goto-next-error' to accept a prefix argument.  The prefix
would control the direction and number of jumps performed; negative
arguments would jump backwards -ARG errors (by calling
flyspell-goto-previous-error), while positive arguments would jump
forwards ARG errors.  This would be similar to how commands like
`forward-word' handle prefix arguments.  This would allow us to leave
the mode-map unchanged, but still distribute the improvement to all
users.

--
Roni Kallio

--00000000000086142105cb5cc38c
Content-Type: application/x-patch; 
	name="0001-Add-flyspell-goto-previous-error.patch"
Content-Disposition: attachment; 
	filename="0001-Add-flyspell-goto-previous-error.patch"
Content-Transfer-Encoding: base64
Content-ID: <17bbd9cdffb7c01d6161>
X-Attachment-Id: 17bbd9cdffb7c01d6161

RnJvbSA0YzY5ZDMyYzYxYmY5NDgwNGU0ZTdlZmFkMjVkY2UyNzlkY2I4MzY5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQ0KRnJvbTogUm9uaSBLYWxsaW8gPHJvbmlAa2FsbGlvLmFwcD4NCkRhdGU6
IFRodSwgMjggSmFuIDIwMjEgMTM6MjI6MDggKzAyMDANClN1YmplY3Q6IFtQQVRDSF0gQWRkIGZs
eXNwZWxsLWdvdG8tcHJldmlvdXMtZXJyb3INCg0KTm93IHBvc3NpYmxlIHRvIGdvIGJhY2t3YXJk
cyBkZXRlY3RlZCBmbHlzcGVsbCBlcnJvcnMuDQpVc2FnZTogTS14IGZseXNwZWxsLWdvdG8tcHJl
dmlvdXMtZXJyb3IgUkVULg0KDQpJbiB0aGUgZnV0dXJlIHRoaXMgd2lsbCBhbGxvdyB1cyB0byBp
bXBsZW1lbnQganVtcGluZyBiYWNrd2FyZCBhbmQNCmZvcndhcmQsIGFuZCBqdW1waW5nIG92ZXIg
bXVsdGlwbGUgZXJyb3JzIHVzaW5nIHByZWZpeC1hcmd1bWVudCBpbg0KYm90aCBmbHlzcGVsbC1n
b3RvLW5leHQtZXJyb3IgYW5kIGZseXNwZWxsLWdvdG8tcHJldmlvdXMtZXJyb3IuDQotLS0NCiBs
aXNwL3RleHRtb2Rlcy9mbHlzcGVsbC5lbCB8IDI4ICsrKysrKysrKysrKysrKysrKysrKysrKysr
KysNCiAxIGZpbGUgY2hhbmdlZCwgMjggaW5zZXJ0aW9ucygrKQ0KDQpkaWZmIC0tZ2l0IGEvbGlz
cC90ZXh0bW9kZXMvZmx5c3BlbGwuZWwgYi9saXNwL3RleHRtb2Rlcy9mbHlzcGVsbC5lbA0KaW5k
ZXggZDg1MDMxNjg4NC4uMTJmOWI3YTIwMyAxMDA2NDQNCi0tLSBhL2xpc3AvdGV4dG1vZGVzL2Zs
eXNwZWxsLmVsDQorKysgYi9saXNwL3RleHRtb2Rlcy9mbHlzcGVsbC5lbA0KQEAgLTE3NTcsNiAr
MTc1NywzNCBAQCBmbHlzcGVsbC1nb3RvLW5leHQtZXJyb3INCiAgICAgKGlmICg9IHBvcyBtYXgp
DQogCShtZXNzYWdlICJObyBtb3JlIG1pc3Mtc3BlbGxlZCB3b3JkISIpKSkpDQogDQorKGRlZnVu
IGZseXNwZWxsLWdvdG8tcHJldmlvdXMtZXJyb3IgKCkNCisgICJHbyB0byB0aGUgcHJldmlvdXMg
ZGV0ZWN0ZWQgZXJyb3IuDQorSW4gZ2VuZXJhbCBgZmx5c3BlbGwtZ290by1wcmV2aW91cy1lcnJv
cicgbXVzdCBiZSB1c2VkIGFmdGVyDQorYGZseXNwZWxsLWJ1ZmZlcicuIg0KKyAgKGludGVyYWN0
aXZlKQ0KKyAgKGxldCAoKG1pbiAocG9pbnQtbWluKSkpDQorICAgICh3aGVuIChhbmQgKGVxIChj
dXJyZW50LWJ1ZmZlcikgZmx5c3BlbGwtb2xkLWJ1ZmZlci1lcnJvcikNCisgICAgICAgICAgICAg
ICAoZXEgKHBvaW50KSBmbHlzcGVsbC1vbGQtcG9zLWVycm9yKSkNCisgICAgICAod2hlbiAoPSAo
cG9pbnQpIG1pbikNCisgICAgICAgIChtZXNzYWdlICJSZXN0YXJ0aW5nIGZyb20gZW5kIG9mIGJ1
ZmZlciIpDQorICAgICAgICAoZ290by1jaGFyIChwb2ludC1tYXgpKSkNCisgICAgICAoYmFja3dh
cmQtd29yZCAxKSkNCisgICAgKHdoaWxlIChhbmQgKD4gKHBvaW50KSBtaW4pDQorICAgICAgICAg
ICAgICAgIChsZXQgKChvdnMgKG92ZXJsYXlzLWF0IChwb2ludCkpKQ0KKyAgICAgICAgICAgICAg
ICAgICAgICAociBuaWwpKQ0KKyAgICAgICAgICAgICAgICAgIDs7IGxvb2sgZm9yIGEgZmx5c3Bl
bGwgb3ZlcmxheQ0KKyAgICAgICAgICAgICAgICAgICh3aGlsZSAoYW5kIChub3QgcikgKGNvbnNw
IG92cykpDQorICAgICAgICAgICAgICAgICAgICAoaWYgKGZseXNwZWxsLW92ZXJsYXktcCAoY2Fy
IG92cykpDQorICAgICAgICAgICAgICAgICAgICAgICAgKHNldHEgciB0KQ0KKyAgICAgICAgICAg
ICAgICAgICAgICAoc2V0cSBvdnMgKGNkciBvdnMpKSkpDQorICAgICAgICAgICAgICAgICAgKG5v
dCByKSkpDQorICAgICAgOzsgZ28gdG8gcHJldmlvdXMgd29yZCBpZiBubyBvdmVybGF5IHdhcyBm
b3VuZA0KKyAgICAgIChiYWNrd2FyZC13b3JkIDEpKQ0KKyAgICAoc2V0cSBmbHlzcGVsbC1vbGQt
cG9zLWVycm9yIChwb2ludCkpDQorICAgIChzZXRxIGZseXNwZWxsLW9sZC1idWZmZXItZXJyb3Ig
KGN1cnJlbnQtYnVmZmVyKSkNCisgICAgKHdoZW4gKD0gKHBvaW50KSBtaW4pDQorICAgICAgKG1l
c3NhZ2UgIk5vIG1vcmUgbWlzcy1zcGVsbGVkIHdvcmQhIikpKSkNCisNCiA7OyotLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0qLw0KIDs7KiAgICBmbHlzcGVsbC1vdmVybGF5LXAgLi4uICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICovDQogOzsqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8NCi0tIA0KMi4yOS4y
DQoNCg==
--00000000000086142105cb5cc38c--




Acknowledgement sent to Stefan Kangas <stefan@HIDDEN>:
New bug report received and forwarded. Copy sent to roni@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to roni@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#50443; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 10 Sep 2021 11:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.