all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 49944@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT).
Date: Sun, 8 Aug 2021 18:51:27 +0000	[thread overview]
Message-ID: <YRAnrxyy0u6OndY4@ACM> (raw)
In-Reply-To: <87r1f36by6.fsf@gnus.org>

Hello, Lars.

On Sun, Aug 08, 2021 at 20:14:25 +0200, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > On calling
> >
> >     (parse-partial-sexp 19 18 nil nil s)

> (What's `s' here?)

Sorry, should have said.  It was a syntax state at position 19,
something like:

    (0 nil 8 34 nil nil 0 nil 13 nil nil)

representing a "normal" string starting at position 13.

> > Emacs surely ought to signal an error, since 18 < 19.

> It's common for Emacs functions that take a region to not care about
> whether to is larger than from or not.

parse-partial-sexp doesn't work on a region.  It works with a starting
position and ending position, which are not interchangeable.  For
example, the status s (above) is the status at 19, not at 18.

> The

>   validate_region (&from, &to);

> function fixes it up.

It doesn't fix it up, it messes it up.

> > It doesn't,
> > though.  It leaves point at a random position and returns
> >
> >     (0 nil nil nil nil nil 0 nil nil nil nil)

> For me it leaves point at 19.

I think it may have done that for me, too, though perhaps not every
time.

Getting back on topic, I think there are no legitimate uses for (> start
limit), and every such call is a bug.  It would seem such a call
discards the input state argument, which would be a bug in itself if the
whole thing weren't a bug.

It's obvious to me that Emacs should throw an error in these
circumstances.  You seem to be disagreeing, or at least to be unsure.
One data point is it took me over an hour's time to track it down, time
that could have been better spent if Emacs had thrown an error.

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

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2021-08-08 18:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08 18:01 bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT) Alan Mackenzie
2021-08-08 18:14 ` Lars Ingebrigtsen
2021-08-08 18:51   ` Alan Mackenzie [this message]
2021-08-09 12:42     ` Lars Ingebrigtsen
2021-08-09 16:50       ` Alan Mackenzie
2021-08-10 13:50         ` Lars Ingebrigtsen
2021-08-10 14:03           ` Eli Zaretskii
2021-08-10 14:41             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-10 14:54               ` Lars Ingebrigtsen
2021-08-10 15:07                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-10 15:36                 ` Eli Zaretskii
2021-08-10 15:44                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-10 16:38                     ` Eli Zaretskii
2021-08-11 11:04                       ` Lars Ingebrigtsen
2021-08-21 13:24 ` Lars Ingebrigtsen
2021-08-21 14:05   ` Alan Mackenzie
2021-08-21 22:11   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-22 10:50     ` Alan Mackenzie
2021-08-22 15:02     ` Lars Ingebrigtsen
2021-08-22 22:54       ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

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

  git send-email \
    --in-reply-to=YRAnrxyy0u6OndY4@ACM \
    --to=acm@muc.de \
    --cc=49944@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.