unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 43489@debbugs.gnu.org
Subject: bug#43489: [PATCH] Don't signal scan-error when moving by sexp interactively
Date: Sun, 20 Sep 2020 21:54:30 +0200	[thread overview]
Message-ID: <87tuvsjkax.fsf@gnus.org> (raw)
In-Reply-To: <9852E6CA-1EB9-41B6-8B01-DAD627C2ED21@acm.org> ("Mattias Engdegård"'s message of "Sun, 20 Sep 2020 19:33:25 +0200")

Mattias Engdegård <mattiase@acm.org> writes:

> Well, but is that true? There is no evidence for it. Emacs currently
> gives no useful information in such situations and never has
> ('scan-error' indeed). The previously posted patch can only improve
> matters.

Even if the error looked like an internal error, the bit in the middle
is informative:

forward-sexp: Scan error: "Containing expression ends prematurely", 2076, 2077

> Of course we can put in messages for the at-bounds cases; it would
> look something like the patch below. While it would still be an
> improvement over what Emacs currently does, it is still a statement
> that we value tradition over usability. Try both!

OK, tried it now.  It's less confusing on the whole, except this bit:

> +  (if noerror
> +      (condition-case _
> +          (forward-sexp arg nil)
> +        (scan-error (user-error (if (> arg 0)
> +                                    "No next sexp"
> +                                  "No previous sexp"))))

Hitting `C-M-f' at the start of this line

)()

gives you that error, but there is indeed more sexps in the buffer.  The
error is that the we can't progress because we reached the ")" without
having a "(".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-09-20 19:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 11:31 bug#43489: [PATCH] Don't signal scan-error when moving by sexp interactively Mattias Engdegård
2020-09-18 13:13 ` Lars Ingebrigtsen
2020-09-18 13:18   ` Dmitry Gutov
2020-09-18 13:42     ` Lars Ingebrigtsen
2020-09-18 13:48       ` Dmitry Gutov
2020-09-18 15:13   ` Mattias Engdegård
2020-09-18 15:23     ` Lars Ingebrigtsen
2020-09-18 16:01       ` Mattias Engdegård
2020-09-19 14:13         ` Lars Ingebrigtsen
2020-09-20 17:33           ` Mattias Engdegård
2020-09-20 19:54             ` Lars Ingebrigtsen [this message]
2020-09-21 10:55               ` Mattias Engdegård
2020-09-21 14:47                 ` Lars Ingebrigtsen
2020-09-21 17:12                   ` Mattias Engdegård
2020-09-22 14:32                     ` Lars Ingebrigtsen
2020-09-23  9:17                       ` Mattias Engdegård
2020-09-23 13:40                         ` Lars Ingebrigtsen
2020-09-23 14:33                           ` Mattias Engdegård
2020-09-23 14:45                             ` João Távora
2020-09-23 16:24                               ` Mattias Engdegård
2020-09-23 16:37                                 ` João Távora
2020-09-24 15:50                                   ` Mattias Engdegård
2020-09-24 15:58                                     ` João Távora
2020-09-24 17:32                                       ` Stefan Monnier
2020-09-24 19:23                                         ` João Távora
2020-09-28 17:05                                           ` Stefan Monnier
2020-09-20 21:39             ` Dmitry Gutov
2020-09-21 11:21               ` Mattias Engdegård
2020-09-21 12:36                 ` Dmitry Gutov
2020-09-21 17:12                   ` Mattias Engdegård
2020-09-21 17:49                     ` Dmitry Gutov
2020-09-21  8:49   ` João Távora
2020-09-21 14:43     ` Lars Ingebrigtsen
2020-09-21 17:12     ` Mattias Engdegård
2020-09-21 17:25       ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuvsjkax.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43489@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).