bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49944: parse-partial-sexp fails to signal an error when (> START LIM


From: Eli Zaretskii
Subject: bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT).
Date: Tue, 10 Aug 2021 19:38:51 +0300

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  acm@muc.de,  49944@debbugs.gnu.org
> Date: Tue, 10 Aug 2021 11:44:55 -0400
> 
> > The reordering is the side effect of calling validate_region, so we'd
> > need to expend extra effort NOT to reorder START and END.
> >
> > How about just documenting that OLDSTATE should be the state at START,
> > and that's it?
> 
> The current use of `validate_region` means that OLDSTATE will be used as
> the state at "either FROM or TO, whichever is smaller".
> 
> So I don't understand what it is you're proposing: if we document 
> that OLDSTATE should be the state at FROM, then we need to change the
> code so that it never swaps FROM and TO.  And if we don't want to change
> the code, then we should document that OLDSTATE will be used as the
> state at TO when TO is smaller than FROM.

The latter.  By documenting the expectations of the function, we leave
it to the callers to make sure their code works as intended.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]