From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriele Nicolardi Newsgroups: gmane.emacs.bugs Subject: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" Date: Wed, 26 Jun 2024 21:43:34 +0200 Message-ID: <64981cd1-a74b-42ad-bedc-2e9cbf1e9ecd@medialab.sissa.it> References: <86v81v98u0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30465"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 71777@debbugs.gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 21:44:15 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 1sMYYx-0007gg-I4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 21:44:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMYYj-0006Yt-Na; Wed, 26 Jun 2024 15:44:01 -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 1sMYYh-0006Yk-RZ for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 15:43: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 1sMYYh-0001xb-K1 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 15:43:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMYYj-0007dr-Qn for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 15:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gabriele Nicolardi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2024 19:44: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.171943102829348 (code B ref 71777); Wed, 26 Jun 2024 19:44:01 +0000 Original-Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 19:43:48 +0000 Original-Received: from localhost ([127.0.0.1]:40380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYYV-0007dI-Ou for submit@debbugs.gnu.org; Wed, 26 Jun 2024 15:43:48 -0400 Original-Received: from smtp02.cbsolt.net ([185.97.217.41]:37904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYYT-0007d5-2D for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 15:43:46 -0400 Original-Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp02.cbsolt.net (Postfix) with ESMTPSA id 4W8XF31k0fz3wbg; Wed, 26 Jun 2024 21:43:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719431016; bh=3yN5sRhipI1ccgg2HZgWUtF2RLV7s7sXxSSDTZ2vw2E=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=beljtvV0ewTL4egNOzXvfYrMQ0COy/Syqs0GJqAPFv+JUygxCcFjJTTz+HBh3pNsd zBsd2AkYXVotR4mFnlBfLBv0D0fCXjGDjPQh/b3LHdLd3caWGv2fUfp/RkCAgPqV6Q tqVwJxWlQG6+geiYRHBbAjkMQ6Y0MOKKe/GpSxM8= Content-Language: en-US In-Reply-To: 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:287961 Archived-At: From the previous responses, I have understood that the sexp-at-point function is not suitable for my purpose. However, I suggest updating the documentation because the explanations you provided are not trivial, and the similarity in names with other functions (forward-sexp, etc.) creates misunderstandings. Lastly, I would like to point out an issue on Stack Exchange: https://emacs.stackexchange.com/q/81603/15606 where I asked for help with a function that fits my needs. Thank you! Gabriele Il 26/06/24 15:46, Stefan Monnier ha scritto: >>> $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 >