unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 43489@debbugs.gnu.org
Subject: bug#43489: [PATCH] Don't signal scan-error when moving by sexp interactively
Date: Mon, 21 Sep 2020 12:55:19 +0200	[thread overview]
Message-ID: <47564F1F-5826-43B1-A9F1-1F4440AF2A6A@acm.org> (raw)
In-Reply-To: <87tuvsjkax.fsf@gnus.org>

20 sep. 2020 kl. 21.54 skrev Lars Ingebrigtsen <larsi@gnus.org>:

> 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

That message reads either as an error in Emacs itself or in the user's code. There is typically no expression that ends prematurely when the command is invoked (there may be, but Emacs cannot know that). It seems that the message is not so much informative as outright misinforming.
The message from C-M-u, "Unbalanced parentheses", is an equally blatant lie.

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

Thank you for testing the patch. (Less confusing than Emacs master, I presume? Or if you mean compared with the no-message patch, what was confusing about it?)

> )()
> 
> 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 "(".

If I understand you properly, you say that "No next sexp" is an inappropriate message for C-M-f at

 ((A B_) C D)

where the underscore indicates point, since the expressions C and D follow? Editors differ in how they handle this case: some just continue up one level (in this case, past C) instead of stopping. There are merits to either behaviour and I'm not suggesting a change to Emacs in this respect.

What would a good message be then, if we insist on one? "No next sexp" is correct within the semantics of forward-sexp and to the point; a more detailed message might be something like

 "Past last element in expression"
 "No next subexpression"
 "Past last subexpression"

which may or may not be better. 'Sexp' is an Emacs-specific term which may still be appropriate in these messages since it figures prominently in the manual and the commands are defined around it. Suggestions are welcome!

Let's not forget that the empty string is also an alternative and should be compared with the verbal messages. Assuming that the user understands what C-M-f does, it seems clear enough.






  reply	other threads:[~2020-09-21 10:55 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
2020-09-21 10:55               ` Mattias Engdegård [this message]
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=47564F1F-5826-43B1-A9F1-1F4440AF2A6A@acm.org \
    --to=mattiase@acm.org \
    --cc=43489@debbugs.gnu.org \
    --cc=larsi@gnus.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).