From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 16:40:16 2024 Received: (at submit) by debbugs.gnu.org; 25 Jun 2024 20:40:16 +0000 Received: from localhost ([127.0.0.1]:37682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMCxT-00062m-08 for submit@debbugs.gnu.org; Tue, 25 Jun 2024 16:40:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:51318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMCwU-00060s-4t for submit@debbugs.gnu.org; Tue, 25 Jun 2024 16:40:05 -0400 Received: from [2001:470:142:3::10] (helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMAXy-0002f8-HY for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 14:05:40 -0400 Received: from smtp01.cbsolt.net ([185.97.217.40]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMAXH-0001Ys-Au for bug-gnu-emacs@gnu.org; Tue, 25 Jun 2024 14:05:18 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp01.cbsolt.net (Postfix) with ESMTPSA id 4W7ss43fpTz3wbM for ; Tue, 25 Jun 2024 19:53:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719338042; bh=NGhT444E9f72cHagFormoxignfeTgj4iyhai+1M2JRs=; h=Date:To:Subject:From:From; b=DyyrhMt/3jNuoAKPDxbfqErM3709YwuC0yaYetgzfC2isEeO4pJi9OknQvnG/e9eF ODgqhXdoUDr4Lno6Gr5WgfMOV/ye2Ng+CX+QqzVNVSfU+ayq+wH8LsfnnM7WDlVhQa eHcjCtNL2v1scjA21tjLM+OBrIvyXTlh3IbMsOtE= Message-ID: Date: Tue, 25 Jun 2024 19:53:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org Subject: 29.4; sexp-at-point in latex-mode when sexp contains ";" Content-Language: en-US From: Gabriele Nicolardi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.97.217.40; envelope-from=gabriele@medialab.sissa.it; helo=smtp01.cbsolt.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, I have this string expression in latex-mode: $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? Best regards, Gabriele In GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2024-06-24 built on lcy02-amd64-050 Repository revision: 176061eb965cf945e7627ce87bb16ec5a03f8a4d Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.6 LTS Configured using: 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3 --without-xaw3d --with-modules --with-cairo --with-native-compilation=aot --without-pgtk --with-xinput2 --with-tree-sitter --with-json 'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem/build/emacs/stage/usr/include -O2' 'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem/build/emacs/stage/usr/include' 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib -L/build/emacs/parts/emacs/install/usr/lib -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu -L/build/emacs/stage/usr/lib'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: it_IT.UTF-8 locale-coding-system: utf-8-unix Major mode: LaTeX Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tex-mode compile text-property-search shell pcomplete comint ansi-osc ansi-color ring time-date cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 94745 6994) (symbols 48 8180 0) (strings 32 23981 1842) (string-bytes 1 748444) (vectors 16 18526) (vector-slots 8 362068 6080) (floats 8 40 162) (intervals 56 343 0) (buffers 984 12)) From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 17:54:17 2024 Received: (at 71777) by debbugs.gnu.org; 25 Jun 2024 21:54:17 +0000 Received: from localhost ([127.0.0.1]:37733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sME78-0007iL-8F for submit@debbugs.gnu.org; Tue, 25 Jun 2024 17:54:17 -0400 Received: from out-174.mta0.migadu.com ([91.218.175.174]:30364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sME6q-0007hP-0b for 71777@debbugs.gnu.org; Tue, 25 Jun 2024 17:54:08 -0400 X-Envelope-To: 71777@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1719352373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xcZTcO3O/+Eaja9b1JX+nfQ7E5FFSZc42mLN9QnoXG8=; b=QXnBYzKoi2/6oJEUhOmZbmVodO8V0Y+TUwxTSexVw8CZBvIfOlHgZF4OT3ByEu3b8X3KwI mvur5HXhjsai/WP2E+GEp7rWbNnkC3h/cubsKd8h6DdnqE6JWZe2xf7afCyNIcRQok6ZNc 9ksfe09FzInd1kmWCaJIgpls7S/cyy30+tBVjDsL+7QYXz1I7y1pMij+A1+loC8T2Y+agN MigntKoK5ceQvLEghrA2S84jVvCFYfJlIM2GOs7HFkYutsSuE9m1T9H3iA6FOzWEX9rvpy LbikyuQNazdFvFuCVNgsVF++uITpdwJaqYx8+Aon48CjSvW23++Wj0kspWMPnQ== X-Envelope-To: gabriele@medialab.sissa.it X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Jeremy Bryant To: Gabriele Nicolardi Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: (Gabriele Nicolardi's message of "Tue, 25 Jun 2024 19:53:59 +0200") References: Date: Tue, 25 Jun 2024 22:52:51 +0100 Message-ID: <87tthg1yh8.fsf@jeremybryant.net> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71777 Cc: 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gabriele Nicolardi writes: > Hi, > > I have this string expression in latex-mode: > > $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? > > Best regards, > > Gabriele > > > In GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, > cairo version 1.16.0) of 2024-06-24 built on lcy02-amd64-050 > Repository revision: 176061eb965cf945e7627ce87bb16ec5a03f8a4d > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 > System Description: Ubuntu 20.04.6 LTS > > Important settings: > value of $LANG: it_IT.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: LaTeX This suggests you are using the major mode from AUCTeX, rather than the built-in latex-mode? Is this right? From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 18:51:55 2024 Received: (at 71777) by debbugs.gnu.org; 25 Jun 2024 22:51:55 +0000 Received: from localhost ([127.0.0.1]:37738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMF0r-0000YF-5K for submit@debbugs.gnu.org; Tue, 25 Jun 2024 18:51:55 -0400 Received: from smtp01.cbsolt.net ([185.97.217.40]:51992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMF0X-0000Xe-A0 for 71777@debbugs.gnu.org; Tue, 25 Jun 2024 18:51:42 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp01.cbsolt.net (Postfix) with ESMTPSA id 4W80Rt5CqCz3wcR; Wed, 26 Jun 2024 00:51:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719355868; bh=Oz7Z+d7udRX3RLYie70/lZ6roH9S72f6KwZ/THxkQs4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=b7d6+iz8EdZzXZIN1xq5CoZTHuB+0HZpe9FMOOJJ4HsCUoqrijYD2TIlbXjt3gr5d dsiOeo4BnNCW1G9Ab03gZXIvVjytRvkHIqbb4el8/GXCCWMqrNHjeaudTcUcL9rYiF fgJcx79uxz5S0/owObk9939Fw5Z0CBCFrftRMd5g= Content-Type: multipart/alternative; boundary="------------WOljIzw4G00of0yRV0JcNVUz" Message-ID: <37a79184-c35f-4180-b3dc-e567272baee6@medialab.sissa.it> Date: Wed, 26 Jun 2024 00:51:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Jeremy Bryant References: <87tthg1yh8.fsf@jeremybryant.net> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: <87tthg1yh8.fsf@jeremybryant.net> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------WOljIzw4G00of0yRV0JcNVUz Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 25/06/24 23:52, Jeremy Bryant ha scritto: >> Important settings: >> value of $LANG: it_IT.UTF-8 >> locale-coding-system: utf-8-unix >> >> Major mode: LaTeX > This suggests you are using the major mode from AUCTeX, rather than the > built-in latex-mode? Is this right? No, I'm using the built-in latex-mode. AUCTeX is not installed on my machine. --------------WOljIzw4G00of0yRV0JcNVUz Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Il 25/06/24 23:52, Jeremy Bryant ha scritto:
Important settings:
value of $LANG: it_IT.UTF-8
locale-coding-system: utf-8-unix

Major mode: LaTeX
This suggests you are using the major mode from AUCTeX, rather than the
built-in latex-mode?  Is this right?
No, I'm using the built-in latex-mode. AUCTeX is not installed on my machine.
--------------WOljIzw4G00of0yRV0JcNVUz-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 08:39:52 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 12:39:52 +0000 Received: from localhost ([127.0.0.1]:38744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMRwF-0007L3-UV for submit@debbugs.gnu.org; Wed, 26 Jun 2024 08:39:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMRwD-0007Ko-7u for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 08:39:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMRw3-0008Ez-Ow; Wed, 26 Jun 2024 08:39:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yRPfesUmkITkRfwemHNvNRtMD3GmMYnV/tVsjkf/HtA=; b=NuBA4NVJ69uK q2/QnilJr18R850WTQL7gNmzPqrMbupvc9BKQvDbkh8KwtgaB/m31Ef9vw/J91lsPlxQA3Lxwt9/E 8quQxDRazvlbhb8n8CkNwGMoA1Nx6yQs7bz7/kPWS3HqYmHd7i1GfTM0RoCbqvDH4PJtzMhC1WP6V 56r3UTc27xkWFeWEeq81QlzTgurfuJwOVO15KZfzPRUn+eTbkmVUzxJUs/0MQvKUWPQfI8zAxlmGL 8OH+gyVi8XDNY5+f7snLR4zX76HJqq5rytNFEN4PLJ4yqL3T36n1seXel8z1DxgvWw4NSavd6g/qv 8Rbb37HC7pa6O/Apaz+Vfg==; Date: Wed, 26 Jun 2024 15:39:35 +0300 Message-Id: <86v81v98u0.fsf@gnu.org> From: Eli Zaretskii To: Gabriele Nicolardi , Stefan Monnier In-Reply-To: (message from Gabriele Nicolardi on Tue, 25 Jun 2024 19:53:59 +0200) Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains "; " References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 25 Jun 2024 19:53:59 +0200 > From: Gabriele Nicolardi > > I have this string expression in latex-mode: > > $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. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 09:47:11 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 13:47:11 +0000 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 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 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== 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) 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) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: <86v81v98u0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 26 Jun 2024 15:39:35 +0300") Message-ID: References: <86v81v98u0.fsf@gnu.org> Date: Wed, 26 Jun 2024 09:46:59 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.140 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: Gabriele Nicolardi , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> $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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 11:52:54 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 15:52:54 +0000 Received: from localhost ([127.0.0.1]:40137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMUx4-0001Yg-A7 for submit@debbugs.gnu.org; Wed, 26 Jun 2024 11:52:54 -0400 Received: from smtp02.cbsolt.net ([185.97.217.41]:43636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMUx2-0001YS-CB for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 11:52:52 -0400 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 4W8R6g1szvz3wbf; Wed, 26 Jun 2024 17:52:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719417164; bh=UAI3iu2/NhO6VQVtMYOzsY1LMWjqjWzx68p4Nq7S7pE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dbXzmWhJkZLCt/A7pUI/j7zAI5Fz5NEFxjjokdeuzGZLZIGbOoI0dFMZE6YjaUybR YfDaTCuwq9FEzsx8gY45SC4Y8AAUvulWusshclNWhEmZY5T1Eij27ERqkn83FRbDlM L615g/XAZtZk0aedLPihng1dm6QPsDOEcNYLPWBU= Message-ID: <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> Date: Wed, 26 Jun 2024 17:52:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier , Eli Zaretskii References: <86v81v98u0.fsf@gnu.org> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 I need to test if a parenthesis in LaTeX (latex-mode) starts a balanced expression. sexp-at-point: Return the sexp at point, or nil if none is found. This is not possible with (thing-at-point 'sexp) because it does no return nil in the case, e.g.: $K(U_1, V_1, x_1 t_2, x_2$ Gabriele From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 15:43:48 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 19:43:48 +0000 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 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 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= Message-ID: <64981cd1-a74b-42ad-bedc-2e9cbf1e9ecd@medialab.sissa.it> Date: Wed, 26 Jun 2024 21:43:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier , Eli Zaretskii References: <86v81v98u0.fsf@gnu.org> Content-Language: en-US From: Gabriele Nicolardi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 > From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 16:11:54 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 20:11:55 +0000 Received: from localhost ([127.0.0.1]:40408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYzi-0008Ii-KP for submit@debbugs.gnu.org; Wed, 26 Jun 2024 16:11:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMYzg-0008IR-T1 for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 16:11:53 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 58A8180C8E; Wed, 26 Jun 2024 16:11:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719432701; bh=Ek+iTXeMCdpEWW8xf3S+ZcdUAua/4vR/AVUoc+oOZVU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TSqSsxm2wQiKo0p6w8NR0Lbc1Al8ynnhQXKBYxkG9VIS5XFE41OyOZ/AyCrxJK9hI jtpBhSTW8XRtgKsVO2zeFyPwzSDVhCqFFkadgZQ5A8BnGhNStGgGpEqjKMeDN6WsuM c+GRsygjQeNdbb3ZKxTUVWiTd233BwJJ+RU5CkcJMj1CMoukJRm5E5k6Sqp3Fyabth XkVet2V+6amWpy6Ioe8fPonubV/eA0Q7osVYZUCFYYVbDMfYouAS3DVs8lBK1aY7oY 4x997GOChJmDPfhjuXX0Q5vxS7ymCNSqOScBD0qrw36FmUPXkTNE0CbMbvXHzsrOYs weFM25rUcPt0A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C272D80882; Wed, 26 Jun 2024 16:11:41 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 95B2F120409; Wed, 26 Jun 2024 16:11:41 -0400 (EDT) From: Stefan Monnier To: Gabriele Nicolardi Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> (Gabriele Nicolardi's message of "Wed, 26 Jun 2024 17:52:41 +0200") Message-ID: References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> Date: Wed, 26 Jun 2024 16:11:41 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I need to test if a parenthesis in LaTeX (latex-mode) starts > a balanced expression. You mentioned `forward-sexp` which should do the trick, so what made you try `sexp-at-point`? > sexp-at-point: Return the sexp at point, or nil if none is found. > > This is not possible with (thing-at-point 'sexp) because it does no return nil in the case, e.g.: > > $K(U_1, V_1, x_1; t_2, x_2$ The "-at-point" functions (by the very nature of the concept of "foo at point") are DWIMish functions. They're usually not appropriate for use from ELisp code unless that ELisp code itself wants to be DWIMish. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 16:18:22 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 20:18:22 +0000 Received: from localhost ([127.0.0.1]:40412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZ5y-0008SZ-Er for submit@debbugs.gnu.org; Wed, 26 Jun 2024 16:18:22 -0400 Received: from smtp05.cbsolt.net ([185.97.217.44]:33188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZ5x-0008SI-JT for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 16:18:22 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp05.cbsolt.net (Postfix) with ESMTPSA id 4W8Y0z5LqPz3wgb; Wed, 26 Jun 2024 22:18:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719433092; bh=/GY3XeIRUjmCE4vSn1PibxBs5ClBh9+m0Jz9HkWi/TA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=E5oaOZOdCOzcd4SkVCc/xnmNicmDvHJmxanSq05kqhAiYNhL879XBY4YAHnQ38fcY rVFQVxLyHmgEPzwXmFrCPRX69lKL/RN58oDzbLpJKA+XAe0WUb8pkOz4ej0mua+iPb jks87HeI2j2o8pHcpEXN5oTgVBIaqPv3jq5aA9NY= Content-Type: multipart/alternative; boundary="------------aQ5q4uGsnT8JvL9w5H0tvoAG" Message-ID: <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> Date: Wed, 26 Jun 2024 22:18:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------aQ5q4uGsnT8JvL9w5H0tvoAG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 26/06/24 22:11, Stefan Monnier ha scritto: >> I need to test if a parenthesis in LaTeX (latex-mode) starts >> a balanced expression. > You mentioned `forward-sexp` which should do the trick, so what made you > try `sexp-at-point`? Because `forward-sexp` does not return nil if the parenthesis does not start a balanced expression. Gabriele --------------aQ5q4uGsnT8JvL9w5H0tvoAG Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Il 26/06/24 22:11, Stefan Monnier ha scritto:
I need to test if a parenthesis in LaTeX (latex-mode) starts
a balanced expression.
You mentioned `forward-sexp` which should do the trick, so what made you
try `sexp-at-point`?
Because `forward-sexp` does not return nil if the parenthesis does not start a balanced expression.

Gabriele
--------------aQ5q4uGsnT8JvL9w5H0tvoAG-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 16:25:21 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 20:25:21 +0000 Received: from localhost ([127.0.0.1]:40417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZCj-0000CI-BG for submit@debbugs.gnu.org; Wed, 26 Jun 2024 16:25:21 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:48646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZCh-0000C5-Iq for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 16:25:19 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7D9B980C8E; Wed, 26 Jun 2024 16:25:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719433509; bh=GM1zuxdeMtQ6kUXz+ax6urbRG/cBQVlndwAbIHETtxs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MnqOM8NTvkITAUDElE8H9p1cUE0GX19QMkvTTDsMBD9S82arewJ7MiBJimSvsU5GM LFV0rrGrGtd2pLOs+1oAPcMBJdVaEUCSqPXj1Bw2hRwLuHmgGyYXj5XDYHfPEcHrL5 KpZVNGKhsdaay4WXABduBq3qdjjp/lRqaQgzZNN7PwgglyFnIreurOhbOtvzUKxwK2 boO16uQEmrgXy7fMG+r3sZs5K0ZuTJbeU6OP9Y6R49TMoVKywwLF4Rinycw1x91DW3 iSbINiCawaTmKhrsgYYPxHGs2x9vSl4c3q7LOxZL+c9uCrsWHkqLFh1+bQqyjuEUXZ ypnmJqNEvUIHQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E0328808A4; Wed, 26 Jun 2024 16:25:09 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B293B120916; Wed, 26 Jun 2024 16:25:09 -0400 (EDT) From: Stefan Monnier To: Gabriele Nicolardi Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> (Gabriele Nicolardi's message of "Wed, 26 Jun 2024 22:18:11 +0200") Message-ID: References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> Date: Wed, 26 Jun 2024 16:25:08 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> I need to test if a parenthesis in LaTeX (latex-mode) starts >>> a balanced expression. >> You mentioned `forward-sexp` which should do the trick, so what made you >> try `sexp-at-point`? > Because `forward-sexp` does not return nil if the parenthesis does not start > a balanced expression. There is no function that does just what you want; you need to make them do what you want. E.g. (save-excursion (condition-case nil (progn (forward-sexp 1) t) (scan-error nil))) Note that "test if a parenthesis in LaTeX (latex-mode) starts a balanced expression" is a kind of weird request, because it will only return nil if there's a missing close-paren but not if there are too many close-parens, i.e. it only detects one half of the imbalances. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 16:40:29 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 20:40:29 +0000 Received: from localhost ([127.0.0.1]:40422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZRM-0000Zx-TR for submit@debbugs.gnu.org; Wed, 26 Jun 2024 16:40:29 -0400 Received: from smtp01.cbsolt.net ([185.97.217.40]:35028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZRL-0000Zj-AD for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 16:40:28 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp01.cbsolt.net (Postfix) with ESMTPSA id 4W8YVT6J4mz3wcP; Wed, 26 Jun 2024 22:40:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719434418; bh=AUBck7iqXVjq7KmE84prolN/GO0Bq0eCGUwkLOZR8DA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CxR0FCh8fVmujAOXzwrRtSk40eNc7cq8PF4ixFpEQY4+4csssMeNJA8jPy3rLJTd6 jmRjfwHdjLA/mTcCgV9RXE2wFJmdZ/gv0e3831SgbLQIjVBljZUi0uDw7/gsrFRvsv bq2roAjgbHstxSErPRGxGc5pITKtX3RkZ2mixkCs= Content-Type: multipart/alternative; boundary="------------0oBxY7aB7kveqQJq0M3oO19k" Message-ID: Date: Wed, 26 Jun 2024 22:40:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------0oBxY7aB7kveqQJq0M3oO19k Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 26/06/24 22:25, Stefan Monnier ha scritto: > Note that "test if a parenthesis in LaTeX (latex-mode) starts a balanced > expression" is a kind of weird request, because it will only return nil > if there's a missing close-paren but not if there are too many > close-parens, i.e. it only detects one half of the imbalances. > > > Stefan For my purposes it is enough. I need to write a function to interactively resize mathematical parentheses based on their content, such as "\left( ... \right)". So far, I have successfully used `sexp-at-point`, but this function does not recognize balanced expressions that contain ";" and only works with "(" and "[" but not with < etc.. The `forward-sexp` function does not necessarily give an error if the parenthesis does not start a balanced expression. E.g. $( x + y ]$ here "(" does not start a balanced expression but `forward-sexp` does not return an error. Gabriele --------------0oBxY7aB7kveqQJq0M3oO19k Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Il 26/06/24 22:25, Stefan Monnier ha scritto:
Note that "test if a parenthesis in LaTeX (latex-mode) starts a balanced
expression" is a kind of weird request, because it will only return nil
if there's a missing close-paren but not if there are too many
close-parens, i.e. it only detects one half of the imbalances.


        Stefan
For my purposes it is enough.

I need to write a function to interactively resize mathematical parentheses based on their content, such as "\left( ... \right)". So far, I have successfully used `sexp-at-point`, but this function does not recognize balanced expressions that contain ";" and only works with "(" and "[" but not with < etc..

The `forward-sexp` function does not necessarily give an error if the parenthesis does not start a balanced expression. E.g.

$( x + y ]$

here "(" does not start a balanced expression but `forward-sexp` does not return an error.

Gabriele
--------------0oBxY7aB7kveqQJq0M3oO19k-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 17:04:59 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 21:04:59 +0000 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 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 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== 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) 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) From: Stefan Monnier To: Gabriele Nicolardi Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: (Gabriele Nicolardi's message of "Wed, 26 Jun 2024 22:40:17 +0200") Message-ID: References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> Date: Wed, 26 Jun 2024 17:04:46 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.053 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 17:14:43 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 21:14:43 +0000 Received: from localhost ([127.0.0.1]:40450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZyU-0001Om-SA for submit@debbugs.gnu.org; Wed, 26 Jun 2024 17:14:43 -0400 Received: from smtp01.cbsolt.net ([185.97.217.40]:46738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMZyS-0001OY-Ml for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 17:14:41 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp01.cbsolt.net (Postfix) with ESMTPSA id 4W8ZFy5BSvz3wcF; Wed, 26 Jun 2024 23:14:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719436471; bh=3g+Oc2WbOU6l8Ijmh/Tu7kHBNiC7Kg9JY2TFm20W4js=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=XUWLwjOFND6C0XDU4bH30XQCm8BJM3kP8o1e7PrEi/ZVLRIhaqY2vB7YGpqI5XW+K ki3nw+zXq/ZUow5UjbVg3OA/c7zvUwE/ruSGiYwH2umJ4XTL2iqg2u85coMdVtcwsc jZBIkowaaovr3YhoELwYyDpEbpWIWXSRuXq3h/Uo= Content-Type: multipart/alternative; boundary="------------XxeJ8CUXKRuoox1lukbyzuoH" Message-ID: <67b72e07-a9d2-4792-ac39-1a13f98e9035@medialab.sissa.it> Date: Wed, 26 Jun 2024 23:14:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------XxeJ8CUXKRuoox1lukbyzuoH Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > 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 Thank you very much! Gabriele --------------XxeJ8CUXKRuoox1lukbyzuoH Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
Thank you very much!

Gabriele
--------------XxeJ8CUXKRuoox1lukbyzuoH-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 17:26:21 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 21:26:21 +0000 Received: from localhost ([127.0.0.1]:40473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMa9l-0001jC-6c for submit@debbugs.gnu.org; Wed, 26 Jun 2024 17:26:21 -0400 Received: from smtp01.cbsolt.net ([185.97.217.40]:60094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMa9j-0001iz-Li for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 17:26:20 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp01.cbsolt.net (Postfix) with ESMTPSA id 4W8ZWP6kLyz3wcF; Wed, 26 Jun 2024 23:26:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719437171; bh=6pnesPKYFYQkDaQEJ2/T0gE7yTzN3xIsGmh8xaWoMWY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ogoZBCBopFOaGrT0qIrjMZCQphqDtgKG5Hear/J+HfY9eqZZogGrhnfUsVJQsERib wHLTP/JHgpBKTYdLBhxkUO3rG4xY9YscMrywgR5jSM4vxmSaQe5MOdJMqbNP/iduV9 bjQDl+w8+Ypv0Xln0oRjnbXSmsZPhfjc+tODvkWk= Content-Type: multipart/alternative; boundary="------------7D5X77vxm1mG0l2Lpqe877jj" Message-ID: <13320bc8-bc76-4204-94b6-e81dbf74ef35@medialab.sissa.it> Date: Wed, 26 Jun 2024 23:26:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> From: Gabriele Nicolardi Content-Language: en-US In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------7D5X77vxm1mG0l2Lpqe877jj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > 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 FYI. NickD offers me this code https://emacs.stackexchange.com/a/81604/15606: |(defun ndk/paren-match-p () (let ((mismatch (nth 4 (show-paren--default)))) (not mismatch))) It seems working. Gabriele | --------------7D5X77vxm1mG0l2Lpqe877jj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
FYI. NickD offers me this code https://emacs.stackexchange.com/a/81604/15606:

(defun ndk/paren-match-p ()
   (let ((mismatch (nth 4 (show-paren--default))))
      (not mismatch)))

It seems working.

Gabriele
--------------7D5X77vxm1mG0l2Lpqe877jj-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 18:19:39 2024 Received: (at 71777) by debbugs.gnu.org; 26 Jun 2024 22:19:39 +0000 Received: from localhost ([127.0.0.1]:40534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMazL-000348-8b for submit@debbugs.gnu.org; Wed, 26 Jun 2024 18:19:39 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMazK-00033s-84 for 71777@debbugs.gnu.org; Wed, 26 Jun 2024 18:19:38 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6AAAE808A4; Wed, 26 Jun 2024 18:19:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719440366; bh=4GjM6CcFID0OTHOPWu6q2BsVAwgVc/ht6eBEdtyjsX8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Z/v+gfpE/kSR1Q/gwleDBfE8N6bSlU6BY0MLMBDkbDsAS2yNoI0Lu2n7R3B/CHP2o 8PfjhQZnL+l15QTdxcoKfY8FDLI096gVfligpHTUFmE0sVv8CIIoZmoGeJb13KcZDj LgKrBsipPvef86xBU8BBaTter/pQjxIkcoEv+hqSCrCT1BRLxZYVpgwaeVYPHkjdsJ gy2HNVJPHNryXYmihqc4LXyGcNgx0fP5QTgTRLAvlgtA+08K9irhAF2kiokEKEa1o+ OWMRtMZ7ibc2Byzm/zGqJqYMHDY38U8oFw9PbT9botctcvdca/rqeAMRdIM2+ob8gH Yr0dQNXRc/WRA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 97570806EF; Wed, 26 Jun 2024 18:19:26 -0400 (EDT) Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 67012120478; Wed, 26 Jun 2024 18:19:26 -0400 (EDT) From: Stefan Monnier To: Gabriele Nicolardi Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" In-Reply-To: <13320bc8-bc76-4204-94b6-e81dbf74ef35@medialab.sissa.it> (Gabriele Nicolardi's message of "Wed, 26 Jun 2024 23:26:07 +0200") Message-ID: References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> <13320bc8-bc76-4204-94b6-e81dbf74ef35@medialab.sissa.it> Date: Wed, 26 Jun 2024 18:19:25 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.052 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > |(defun ndk/paren-match-p () (let ((mismatch (nth 4 (show-paren--default)))) > (not mismatch))) It seems working. Gabriele | AFAIK It only checks the outside pair of parens. E.g. it won't detect the problem in ((a + b]) - Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 27 02:01:25 2024 Received: (at 71777) by debbugs.gnu.org; 27 Jun 2024 06:01:25 +0000 Received: from localhost ([127.0.0.1]:40802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMiCD-0000nB-DE for submit@debbugs.gnu.org; Thu, 27 Jun 2024 02:01:25 -0400 Received: from smtp06.cbsolt.net ([185.97.217.45]:36288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMiCB-0000mz-UL for 71777@debbugs.gnu.org; Thu, 27 Jun 2024 02:01:24 -0400 Received: from [10.0.2.15] (host-79-44-242-88.retail.telecomitalia.it [79.44.242.88]) by smtp06.cbsolt.net (Postfix) with ESMTPSA id 4W8nxk5hG7z3wZJ; Thu, 27 Jun 2024 08:01:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cbsolt.net; s=201504-di4k2w; t=1719468075; bh=UgTcFnZZntGuqYkvWQxc4mP09CaxYvr+FgClJkNn/fQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AMRqY+V2N24NZzbh9SDt77VnCCqHW+ExXc6ZsSRMgXjiPyRB+8HzDkvzgcrqWY3x+ vn5+iQDq8JkNDposht45vxU3sNAIkp8j4BUYNJA/+jT85EUSYi6NWDUJImu44RHKp1 /EUTGY7nAoQzE3ms9O2QUx1Dbo+mP+2fqj8Ly1y4= Content-Type: multipart/alternative; boundary="------------3KyGwk1RMoLCXrWASk0ZtVnG" Message-ID: <41c8e679-3311-4b5f-9b39-d685eae7c8c8@medialab.sissa.it> Date: Thu, 27 Jun 2024 08:01:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" To: Stefan Monnier References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> <13320bc8-bc76-4204-94b6-e81dbf74ef35@medialab.sissa.it> Content-Language: en-US From: Gabriele Nicolardi In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71777 Cc: Eli Zaretskii , 71777@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------3KyGwk1RMoLCXrWASk0ZtVnG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit >> |(defun ndk/paren-match-p () (let ((mismatch (nth 4 (show-paren--default)))) >> (not mismatch))) It seems working. Gabriele | > AFAIK It only checks the outside pair of parens. > E.g. it won't detect the problem in > > ((a + b]) > > > - Stefan it is good for me because it cover the case, e.g.: B=((1,3)∪(2,5]) Gabriele --------------3KyGwk1RMoLCXrWASk0ZtVnG Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
|(defun ndk/paren-match-p () (let ((mismatch (nth 4 (show-paren--default))))
 (not mismatch))) It seems working. Gabriele |
AFAIK It only checks the outside pair of parens.
E.g. it won't detect the problem in

    ((a + b])


- Stefan
it is good for me because it cover the case, e.g.:

--------------3KyGwk1RMoLCXrWASk0ZtVnG-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:25:20 2024 Received: (at 71777-done) by debbugs.gnu.org; 29 Jun 2024 12:25:20 +0000 Received: from localhost ([127.0.0.1]:37328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX8p-0006TU-Qh for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:25:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX8o-0006TE-Py for 71777-done@debbugs.gnu.org; Sat, 29 Jun 2024 08:25:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNX8i-0008Hj-Ca; Sat, 29 Jun 2024 08:25:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oV7xx8PqAYqjXQq2Yv7QAqpn3tcROtOwl67vqE8DLZM=; b=JHloo7yKXadf0KfcV3sA PjRrogtPQThnljgie8x6+64PMbSVrhPVM4IBQzGN6drOwtUYXjy97RmcQbAKnGdXpAI+oXIDlY71d jVnAk46PqjjkPecwGrEhHD8Tr7KoEJs8WBNa4QY9XtYvThIhrYoFmlL36xSHrWGHflb6FB7ECTO3P GbE4FZvamJZQqQDYTMPOu7YgVo69i4i4L4P5Ot49EUL3ZA+T9BrWlsYSyoP9mQGNCv4nAdWHmaaTE wmfSYzQVd9+nqMtNmP29WO7oEo/ZPJz0A/b2lRu0bM0k9OWCguyld3N/I7ZZraK4O2orUTwqtFoNy eFWDL3e/WDhkBQ==; Date: Sat, 29 Jun 2024 15:25:04 +0300 Message-Id: <86zfr4hr6n.fsf@gnu.org> From: Eli Zaretskii To: Gabriele Nicolardi In-Reply-To: <41c8e679-3311-4b5f-9b39-d685eae7c8c8@medialab.sissa.it> (message from Gabriele Nicolardi on Thu, 27 Jun 2024 08:01:13 +0200) Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";" References: <86v81v98u0.fsf@gnu.org> <52e6657e-3cc4-4671-8676-86e9959d9bc1@medialab.sissa.it> <3ef0543b-8380-40b5-9bd1-949e24ca3c77@medialab.sissa.it> <13320bc8-bc76-4204-94b6-e81dbf74ef35@medialab.sissa.it> <41c8e679-3311-4b5f-9b39-d685eae7c8c8@medialab.sissa.it> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71777-done Cc: 71777-done@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 27 Jun 2024 08:01:13 +0200 > Cc: Eli Zaretskii , 71777@debbugs.gnu.org > From: Gabriele Nicolardi > > it is good for me because it cover the case, e.g.: > > B=((1,3)∪(2,5]) Thanks, I've now made clear in the doc string that sexp-at-point is for returning Lisp objects, and I'm therefore closing this bug. From unknown Tue Jun 24 10:31:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 28 Jul 2024 11:24:18 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator