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 09:46:59 -0400 Message-ID: References: <86v81v98u0.fsf@gnu.org> 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="18223"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Gabriele Nicolardi , 71777@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 15:48:32 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 1sMT0i-0004UG-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 15:48:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMT0F-0004e5-Ne; Wed, 26 Jun 2024 09:48:03 -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 1sMT0D-0004aU-1X for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:48:01 -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 1sMT0C-00083d-Ot for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:48:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMT0F-0000ld-18 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:48:03 -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 13:48:02 +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.17194096312840 (code B ref 71777); Wed, 26 Jun 2024 13:48:02 +0000 Original-Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 13:47:11 +0000 Original-Received: from localhost ([127.0.0.1]:38833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMSzO-0000jk-Sc for submit@debbugs.gnu.org; Wed, 26 Jun 2024 09:47:11 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMSzN-0000jX-AQ for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 09:47:09 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6B06910006B; Wed, 26 Jun 2024 09:47:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719409620; bh=rtS7y2OHTrhlA2opha1zV3ZR3ZLfjCA0C1J84lYUZ7o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Hx34R2inQQNl8UW0FsqvRiE5N8YHecO5IkgURQQRFrq3rtPRKnTQ5QVIIrmSNW14f HFbdGUXLgsi8K/SNxy4App8o95r7HED+3CxSDzr4rOdVd1UQXw706RgF4UvO5YVFBR qAmi8xTJRY04m+C9bcQiL7msr9SCN2ZZGN0lj37Lv/0HJYzge4wWmCGPr8zt6kl0E/ uf1P0eHlUYrTH4Ylrh0OpKNQ4+rxZg+VCNPHts5Jin6ntB1XiNL1Jssv+jFzUwzKSd t+EFVGcqTRu3ucNLxm4Kc4Rz2sBqgK7Jpp2Dfmc7IxpWBuQNUdbQhDjQ6qEqknjRKG mZtA6yDeth6JA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 11818100035; Wed, 26 Jun 2024 09:47:00 -0400 (EDT) Original-Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DAE15120399; Wed, 26 Jun 2024 09:46:59 -0400 (EDT) In-Reply-To: <86v81v98u0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 26 Jun 2024 15:39:35 +0300") 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:287945 Archived-At: >> $K(U_1, V_1, x_1; t_2, x_2)$ >> >> If the pointer is located on the opened "(" and I run "forward-sexp" it >> works and the >> pointer goes after the closed ")". >> >> But if, again, the pointer is located on the opened "(" and I evaluate >> "(sexp-at-point)" it returns nil. >> >> If I remove the ";" symbol from the expression it works and returns the >> sexp-at-point: >> >> $K(U_1, V_1, x_1 t_2, x_2)$ >> >> Is it a bug? > > I don't think it's a bug. forward-sexp moves across balanced > expressions, so it is not specific to Lisp. By contrast, > sexp-at-point is specific to Lisp and Lisp-like syntax, and so it uses > the buffer's syntax. Which is why ';' affects the result. > > Adding Stefan in case he has comments for this. AFAICT, `sexp-at-point` correctly finds the parenthesized thingy, but it is asked to return the Lisp object it represents rather than a string, so it `read`s, which inevitably obeys the ELisp syntax. IOW, I suspect you want (thing-at-point 'sexp) rather than (sexp-at-point). Stefan