From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#49944: parse-partial-sexp fails to signal an error when (> START LIMIT). Date: Mon, 9 Aug 2021 16:50:42 +0000 Message-ID: References: <87r1f36by6.fsf@gnus.org> <87pmum4wnm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49944@debbugs.gnu.org, Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 09 18:52:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mD8VW-0006Cv-Cm for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 18:52:10 +0200 Original-Received: from localhost ([::1]:34230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD8VV-0006G4-4a for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 12:52:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD8VO-0006FP-Q7 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 12:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mD8VO-0006SE-J4 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 12:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mD8VO-0000tA-Hm for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 12:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2021 16:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49944 X-GNU-PR-Package: emacs Original-Received: via spool by 49944-submit@debbugs.gnu.org id=B49944.16285278633341 (code B ref 49944); Mon, 09 Aug 2021 16:52:02 +0000 Original-Received: (at 49944) by debbugs.gnu.org; 9 Aug 2021 16:51:03 +0000 Original-Received: from localhost ([127.0.0.1]:57659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD8UJ-0000rI-BW for submit@debbugs.gnu.org; Mon, 09 Aug 2021 12:51:03 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:59077 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1mD8UE-0000qy-29 for 49944@debbugs.gnu.org; Mon, 09 Aug 2021 12:50:54 -0400 Original-Received: (qmail 64732 invoked by uid 3782); 9 Aug 2021 16:50:42 -0000 Original-Received: from acm.muc.de (p4fe157e5.dip0.t-ipconnect.de [79.225.87.229]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 09 Aug 2021 18:50:42 +0200 Original-Received: (qmail 6699 invoked by uid 1000); 9 Aug 2021 16:50:42 -0000 Content-Disposition: inline In-Reply-To: <87pmum4wnm.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211455 Archived-At: Hello, Lars. On Mon, Aug 09, 2021 at 14:42:21 +0200, Lars Ingebrigtsen wrote: > Alan Mackenzie 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).