all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acm@muc.de, Stefan Monnier <monnier@iro.umontreal.ca>,
	49944@debbugs.gnu.org
Subject: bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT).
Date: Wed, 11 Aug 2021 13:04:43 +0200	[thread overview]
Message-ID: <874kbwutro.fsf@gnus.org> (raw)
In-Reply-To: <83czqlfe5g.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Aug 2021 19:38:51 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

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

I think that sounds like a very complicated interface -- it would be
better if we didn't swap.

However, there may well be code out there today that calls the function
with OLDSTATE matching the point passed in by END, which is then swapped
with START (because it's smaller), and things work by accident.

Probably unlikely, but to detect this we'd have to signal an error, like
Alan suggested originally.  So...  perhaps we should just do that?
I.e., signal an error if END is smaller than START?  (And we could fix
up the swapping for clarity, but it wouldn't be necessary.)

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





  reply	other threads:[~2021-08-11 11:04 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
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 [this message]
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=874kbwutro.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=49944@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=eliz@gnu.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.