GNU bug report logs - #43489
[PATCH] Don't signal scan-error when moving by sexp interactively

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Fri, 18 Sep 2020 11:32:02 UTC

Severity: normal

Tags: patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 43489 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 43489 <at> debbugs.gnu.org
Subject: Re: bug#43489: [PATCH] Don't signal scan-error when moving by sexp
 interactively
Date: Sun, 20 Sep 2020 21:54:30 +0200
Mattias Engdegård <mattiase <at> 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




This bug report was last modified 4 years and 238 days ago.

Previous Next


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