From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#50443: Fwd: Flyspell error traversal additions Date: Tue, 7 Sep 2021 02:22:29 +0200 Message-ID: References: <87sg6lchgc.fsf@kallio.app> <87r1m5ch9n.fsf@kallio.app> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000086142105cb5cc38c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8750"; mail-complaints-to="usenet@ciao.gmane.io" Cc: roni kallio To: 50443@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 07 02:23:13 2021 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 1mNOtM-00024m-EZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Sep 2021 02:23:12 +0200 Original-Received: from localhost ([::1]:60402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNOtK-000343-09 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Sep 2021 20:23:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNOtD-00033e-86 for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2021 20:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNOtD-0003us-0a for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2021 20:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNOtC-0003WZ-D8; Mon, 06 Sep 2021 20:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: roni@kallio.app, bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Sep 2021 00:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50443 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: roni kallio Original-Received: via spool by submit@debbugs.gnu.org id=B.163097416613507 (code B ref -1); Tue, 07 Sep 2021 00:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2021 00:22:46 +0000 Original-Received: from localhost ([127.0.0.1]:54770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNOsw-0003Vn-BY for submit@debbugs.gnu.org; Mon, 06 Sep 2021 20:22:46 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNOsu-0003Vf-O5 for submit@debbugs.gnu.org; Mon, 06 Sep 2021 20:22:45 -0400 Original-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 ) id 1mNOsu-00031H-I5 for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2021 20:22:44 -0400 Original-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 ) id 1mNOst-0003h3-3H for bug-gnu-emacs@gnu.org; Mon, 06 Sep 2021 20:22:44 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso383730pjh.5 for ; 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) In-Reply-To: <87r1m5ch9n.fsf@kallio.app> Received-SPF: pass client-ip=209.85.216.49; envelope-from=stefankangas@gmail.com; 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-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:213652 Archived-At: --00000000000086142105cb5cc38c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Debbugs-CC: Roni Kallio 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 Date: tors 28 jan. 2021 kl 14:59 Subject: Flyspell error traversal additions To: 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 cC90ZXh0bW9kZXMvZmx5c3BlbGwuZWwgYi9saXNwL3RleHRtb2Rlcy9mb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wpKQ0KKyAgICAgICAgICAgICAgICAgIDs7IGxvb2sgZm9yIGEgZmx5c3Bl bGwgb3ZlcmxheQ0KKyAgICAgICAgICAgICAgICAgICh3aGlsZSAoYW5kIChub3QgcikgKGNvbnNw IG92cykpDQorICAgICAgICAgICAgICAgICAgICAoaWYgKGZseXNwZWxsLW92ZXJsYXktcCAoY2Fy IG92cykpDQorICAgICAgICAgICAgICAgICAgICAgICAgKHNldHEgciB0KQ0KKyAgICAgICAgICAg ICAgICAgICAgICAoc2V0cSBvdnMgKGNkciBvdnMpKSkpDQorICAgICAgICAgICAgICAgICAgKG5v dCByKSkpDQorICAgICAgOzsgZ28gdG8gcHJldmlvdXMgd29yZCBpZiBubyBvdmVybGF5IHdhcyBm b3VuZA0KKyAgICAgIChiYWNrd2FyZC13b3JkIDEpKQ0KKyAgICAoc2V0cSBmbHlzcGVsbC1vbGQt cG9zLWVycm9yIChwb2ludCkpDQorICAgIChzZXRxIGZseXNwZWxsLW9sZC1idWZmZXItZXJyb3Ig KGN1cnJlbnQtYnVmZmVyKSkNCisgICAgKHdoZW4gKD0gKHBvaW50KSBtaW4pDQorICAgICAgKG1l c3NhZ2UgIk5vIG1vcmUgbWlzcy1zcGVsbGVkIHdvcmQhIikpKSkNCisNCiA7OyotLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0qLw0KIDs7KiAgICBmbHlzcGVsbC1vdmVybGF5LXAgLi4uICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICovDQogOzsqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8NCi0tIA0KMi4yOS4y DQoNCg== --00000000000086142105cb5cc38c--