From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ahmed Khaled Newsgroups: gmane.emacs.bugs Subject: bug#49080: 28.0.50; latex-forward-sexp scan error (unbalanced parens) when parens are balanced Date: Thu, 17 Jun 2021 22:12:14 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000db748305c4fbd4fb" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35196"; mail-complaints-to="usenet@ciao.gmane.io" To: 49080@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 18 01:21:16 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 1lu1Jy-00090j-VQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Jun 2021 01:21:15 +0200 Original-Received: from localhost ([::1]:34244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lu1Jy-0008Bs-1E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 19:21:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lu1Io-00074R-Ae for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 19:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lu1Io-0003kV-20 for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 19:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lu1In-0003Fg-Lb for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 19:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ahmed Khaled Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jun 2021 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49080 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162397197912463 (code B ref -1); Thu, 17 Jun 2021 23:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jun 2021 23:19:39 +0000 Original-Received: from localhost ([127.0.0.1]:55338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lu1IN-0003Et-6b for submit@debbugs.gnu.org; Thu, 17 Jun 2021 19:19:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:60712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltyNj-0007Kw-Vy for submit@debbugs.gnu.org; Thu, 17 Jun 2021 16:12:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltyNj-0008Va-Kw for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 16:12:55 -0400 Original-Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:44568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltyNh-00014A-4o for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 16:12:55 -0400 Original-Received: by mail-ot1-x334.google.com with SMTP id f3-20020a0568301c23b029044ce5da4794so788655ote.11 for ; Thu, 17 Jun 2021 13:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6FTB8bU5zLuk2pL73ahuQSbtLhzq4BD/Kd2bcpvxkPY=; b=du706frZK0rw7hfQPgwq1SgofoZHpv9ub07B8MMt3rHySKNFVmMiM+WYutOkBgKyhB ONmaC441rpdb2N3lgbs5Vf3TmR4Qwsd4RI8WUiZ8ZFFH/Dab2KyIHoui07+Tjg4zhmpm NN2OpeU0dZuzU7E8xVWhJH7q6iO0BkuqhqSlO+JEKNWyAi5CUM03wJodNYf/GUfE+/Zt MziEbvrmCEFME9rroEuYbrlbchpM8Q3Fl5DlA0iOGShsggId02nIL6d3BPxaWE4fh7kp 05em0l6woANsE8jTesEJGmTV6+GnMFwS8yTIj4V8xfl0kO+H7ByWtu07KSSGwe9L2i7f Gc6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6FTB8bU5zLuk2pL73ahuQSbtLhzq4BD/Kd2bcpvxkPY=; b=QuEV4bisOtFYrAe1zy7ct2EA0IWtHVy9gYVppr885lnuMCPq/zZ/RAIXsAYwBzojst tdAiWYRcMolbtlLd62yHCNcGhVhFZSlsUJ8zVCk1lJbunASjy/mdziGD9KqQsA23hu5A oqNRVNaliZz1Dmhvz5I5ultuMfd57H8X/7ArqdY2rIPokd83S+UTcW0qP8K4Xqtzm39T 1IzFolCWfLO3VSr7OnnRKLdc/lgqadCIG1rlfBCOPPlyuAa7GbegfNjXpX0eeZXZd5Mp t4kxgkXuKcamUOiZUL9AZddgwaMi6OMMjliL+TugAWlnmeIrIYNtMZSA+4ZMEiczfPs3 Z8dQ== X-Gm-Message-State: AOAM5320d/gTn188GmjxoXAwGWMV7y3G+hh5ZErzlLj3RN6FfMPLmNFw yozVxvfRPk9UgQHTZuAWUvlTBHIdY620XZUWiX+Xpc4xZ/8= X-Google-Smtp-Source: ABdhPJz/PzLhQKs3ivti1RFEsBBWd0PTFt8ru3Rxm3jDiJ4BS1btlg9NyGRg6EIy0owDJCwU9oBpDm/OQRq1+1s3Rnk= X-Received: by 2002:a05:6830:168e:: with SMTP id k14mr6358016otr.280.1623960770527; Thu, 17 Jun 2021 13:12:50 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::334; envelope-from=enrev91@gmail.com; helo=mail-ot1-x334.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 17 Jun 2021 19:19:34 -0400 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:208681 Archived-At: --000000000000db748305c4fbd4fb Content-Type: multipart/alternative; boundary="000000000000db748105c4fbd4f9" --000000000000db748105c4fbd4f9 Content-Type: text/plain; charset="UTF-8" In tex-mode, latex-forward-sexp does not correctly handle parentheses like this \[ \]. In particular, it says the expression is not balanced when it is. Steps to reproduce the bug: 1. Start with emacs -Q (with -nw or without doesn't make a difference) 2. Open any .tex file (I attached test.tex which I used). 3. Navigate to any LaTeX equation delimited by \[ and \], like this: \[ 1 + 1 = 2 \] 4. Put the cursor on the first [ in the line: 5. Call latex-forward-sexp That's it. On test.tex, the error I get is: Scan error: "Unbalanced parentheses", 126, 157 Note that if the cursor is on the backslash, rather than [, then there is no error. In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) System Description: Ubuntu 20.04.2 LTS Configured using: 'configure CONFIG_SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash SHELL=/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash --prefix=/gnu/store/xq1linh33h7icndhqwsxky0x6fmjqn11-emacs-pgtk-native-comp-28.0.50-194.1c0a7c3 --enable-fast-install --with-native-compilation --with-pgtk --with-xwidgets --with-modules --with-cairo --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM XWIDGETS GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/robo/.guix-profile/share/emacs/site-lisp:/home/robo/.guix-profile/share/emacs/site-lisp:/gnu/store/xq1linh33h7icndhqwsxky0x6fmjqn11-emacs-pgtk-native-comp-28.0.50-194.1c0a7c3/share/emacs/28.0.50/lisp value of $LANG: en_US.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 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 auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core eieio-loaddefs password-cache json map time-date subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-git diff-mode easy-mmode vc-dispatcher tex-mode compile text-property-search shell pcomplete comint ansi-color ring latexenc term/xterm xterm byte-opt bytecomp byte-compile cconv cl-macs cl-loaddefs cl-lib pcase gv jka-compr iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-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 cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit pgtk multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 97956 9073) (symbols 48 8246 0) (strings 32 24556 2414) (string-bytes 1 872307) (vectors 16 13770) (vector-slots 8 274177 6530) (floats 8 37 69) (intervals 56 410 0) (buffers 992 12)) --000000000000db748105c4fbd4f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In tex-mode, latex-forward-sexp does not correctly handle = parentheses
like this \[ \]. In particular, it says the expression is no= t balanced
when it is.

Steps to reproduce the bug:
1. Start wi= th emacs -Q (with -nw or without doesn't make a difference)
2. Open = any .tex file (I attached test.tex which I used).
3. Navigate to any LaT= eX equation delimited by \[ and \], like this:
\[ 1 + 1 =3D 2 \]
4. P= ut the cursor on the first [ in the line:
5. Call latex-forward-sexp
=
That's it. On test.tex, the error I get is:
=C2=A0 =C2=A0 =C2=A0= =C2=A0Scan error: "Unbalanced parentheses", 126, 157
Note tha= t if the cursor is on the backslash, rather than [, then there
is no err= or.

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version= 3.24.24, cairo version 1.16.0)
System Description: Ubuntu 20.04.2 LTS
Configured using:
=C2=A0'configure
=C2=A0CONFIG_SHELL=3D/gn= u/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash
= =C2=A0SHELL=3D/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.= 16/bin/bash
=C2=A0--prefix=3D/gnu/store/xq1linh33h7icndhqwsxky0x6fmjqn11= -emacs-pgtk-native-comp-28.0.50-194.1c0a7c3
=C2=A0--enable-fast-install = --with-native-compilation --with-pgtk
=C2=A0--with-xwidgets --with-modul= es --with-cairo --disable-build-details'

Configured features:ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEGJSON LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMP= ER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM
XWID= GETS GTK3 ZLIB

Important settings:
=C2=A0 value of $EMACSLOADPATH= : /home/robo/.guix-profile/share/emacs/site-lisp:/home/robo/.guix-profile/s= hare/emacs/site-lisp:/gnu/store/xq1linh33h7icndhqwsxky0x6fmjqn11-emacs-pgtk= -native-comp-28.0.50-194.1c0a7c3/share/emacs/28.0.50/lisp
=C2=A0 value o= f $LANG: en_US.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Majo= r mode: LaTeX

Minor modes in effect:
=C2=A0 shell-dirtrack-mode: = t
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electr= ic-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t<= br>=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 glo= bal-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mo= de: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t<= br>=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 = transient-mark-mode: t

Load-path shadows:
None found.

Feat= ures:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loadd= efs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rma= il-loaddefs auth-source cl-seq eieio eieio-core eieio-loaddefs
password-= cache json map time-date subr-x seq mm-decode mm-bodies
mm-encode mail-p= arse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ie= tf-drums mm-util mail-prsvr mail-utils vc-git
diff-mode easy-mmode vc-di= spatcher tex-mode compile text-property-search
shell pcomplete comint an= si-color ring latexenc term/xterm xterm
byte-opt bytecomp byte-compile c= conv cl-macs cl-loaddefs cl-lib pcase gv
jka-compr iso-transl tooltip el= doc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/pg= tk-win pgtk-win term/common-win tool-bar
dnd fontset image regexp-opt fr= inge tabulated-list replace newcomment
text-mode elisp-mode lisp-mode pr= og-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu time= r select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-c= olors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vie= tnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebre= w greek romanian slovak czech
european ethiopic indian cyrillic chinese = composite charscript charprop
case-table epa-hook jka-cmpr-hook help sim= ple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face m= acroexp files
window text-properties overlay sha1 md5 base64 format env = code-pages
mule custom widget hashtable-print-readable backquote threads=
xwidget-internal dbusbind inotify dynamic-setting system-font-settingfont-render-setting cairo move-toolbar gtk x-toolkit pgtk multi-tty
ma= ke-network-process native-compile emacs)

Memory information:
((co= nses 16 97956 9073)
=C2=A0(symbols 48 8246 0)
=C2=A0(strings 32 24556= 2414)
=C2=A0(string-bytes 1 872307)
=C2=A0(vectors 16 13770)
=C2= =A0(vector-slots 8 274177 6530)
=C2=A0(floats 8 37 69)
=C2=A0(interva= ls 56 410 0)
=C2=A0(buffers 992 12))
--000000000000db748105c4fbd4f9-- --000000000000db748305c4fbd4fb Content-Type: text/x-tex; charset="US-ASCII"; name="test.tex" Content-Disposition: attachment; filename="test.tex" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kq1ca9hf0 XGRvY3VtZW50Y2xhc3NbMTBwdF17YXJ0aWNsZX0KXGJlZ2lue2RvY3VtZW50fQpcdGl0bGV7VGVz dH0KXGF1dGhvcnt9ClxtYWtldGl0bGUKXHRhYmxlb2Zjb250ZW50cwpUaGlzIGlzIGEgc2ltcGxl IGVxdWF0aW9uClxbIDEgKyAxID0gMi4gXF0KXGVuZHtkb2N1bWVudH0K --000000000000db748305c4fbd4fb--