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: Alan Mackenzie
Subject: bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT).
Date: Mon, 9 Aug 2021 16:50:42 +0000

Hello, Lars.

On Mon, Aug 09, 2021 at 14:42:21 +0200, Lars Ingebrigtsen wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > parse-partial-sexp doesn't work on a region.  It works with a
> > starting position and ending position, which are not
> > interchangeable.

> Well...  they are interchangeable now, as they are in many functions
> in Emacs.

I can't see any use whatsoever for reversing START and LIMIT.  Can you?
I would be extremely surprised if any hacker had _ever_ intentionally
used this "facility".

We definitely have a bug here.  The documentation in the elisp manual
says that the scanning is done "starting at START".  You're saying it's
perfectly OK to start scanning at "LIMIT"?  This violates the doc.

In other words, you're sort of saying that it's the documentation at
fault, not the function.

> > 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.

> Making this signal an error wouldn't be backwards-compatible, so I
> think that's a no go.

Fixing _any_ bug leads to "backwards-incompatibility", that is, if one
is determined to regard buggy behaviour as something to be preserved.

This whole discussion feels a bit surrealistic.  Is it not obvious that
(parse-partial-sexp 19 18) ought to throw an error?

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

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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