From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" Date: Wed, 26 Jun 2024 17:04:46 -0400 Message-ID: References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30766"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 71777@debbugs.gnu.org To: Gabriele Nicolardi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 23:05:38 2024 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 1sMZpi-0007kC-4s for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 23:05:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMZpF-00079u-9e; Wed, 26 Jun 2024 17:05:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMZp5-00079R-QO for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 17:04:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMZp5-0007xf-Ii for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 17:04:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMZp7-0001B4-Rs for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 17:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2024 21:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71777 X-GNU-PR-Package: emacs Original-Received: via spool by 71777-submit@debbugs.gnu.org id=B71777.17194358994514 (code B ref 71777); Wed, 26 Jun 2024 21:05:01 +0000 Original-Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 21:04:59 +0000 Original-Received: from localhost ([127.0.0.1]:40438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZp5-0001Ak-Dh for submit@debbugs.gnu.org; Wed, 26 Jun 2024 17:04:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZp3-0001AR-Cm for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 17:04:57 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C16C3806EF; Wed, 26 Jun 2024 17:04:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719435887; bh=fsvsM/9D03uwHa9sxg9KpK+S3+4W0lQ5E4JLGIEWsRM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pQtb0rGs0cyWiH116UDIu5/H6j6nPpQOxJO8tVVehiGQ9G/rSTMCDviT2YqqeuY0f cFvsp+HdgF7c1/FyMqwGGYA0eG5a08Q2lxRa8qHoZyUuGQx6tnuSaaQW8VbAhLTYZM WjumQZQGDPtYm07K0QW5V2JKpIIXBYyd8DNXuunJn1rY+YtxO7BZdBD1ArslKWvRvF xyB0YFG3JsgeezAj4SAzBmRuspuqTFr3/kiivktapAGWVQg4F5KnE/SnamnliJ/cFl PE+i8CbXUUpfKPkmJMJTyxfRBAYHvxJIOwsdUNFYcRxMjY98qevveqHFcFgoO8k/eS v8n06wYpnr4vA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2007780882; Wed, 26 Jun 2024 17:04:47 -0400 (EDT) Original-Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E54F8120352; Wed, 26 Jun 2024 17:04:46 -0400 (EDT) In-Reply-To: (Gabriele Nicolardi's message of "Wed, 26 Jun 2024 22:40:17 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287967 Archived-At: > The `forward-sexp` function does not necessarily give an error if the > parenthesis does not start a balanced expression. E.g. > > $( x + y ]$ Yup. Most of the functions that are meant to be used to parse code while it's being edited don't check validity. Basically they try to find "what is the meaning of this text" rather than "does this text have meaning". That's on purpose, because it makes them more usable even when the text is not 100% valid. `read` (which parses an ELisp s-exp and is used in `sexp-at-point` to try and turn the string "( x + y ]" (found by `forward-sexp) into a Lisp value) is one of the rare exceptions because that one is not meant to parse text as you type it but rather to parse text in order to process it (typically, to execute it). But it obeys the ELisp syntax rather than the LaTeX syntax. > here "(" does not start a balanced expression but `forward-sexp` does not > return an error. I don't think there's code in Emacs which does what you want, so if you really need to check proper pairing you're going to have to write the code. Stefan