From unknown Sat Jun 14 19:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42867: 28.0.50; Wring pair-mode in m4 and similar modes Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Aug 2020 19:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42867 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 42867@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15974351116014 (code B ref -1); Fri, 14 Aug 2020 19:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Aug 2020 19:58:31 +0000 Received: from localhost ([127.0.0.1]:53943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6fqQ-0001Yv-Rc for submit@debbugs.gnu.org; Fri, 14 Aug 2020 15:58:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:41808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6fqO-0001Yn-Ik for submit@debbugs.gnu.org; Fri, 14 Aug 2020 15:58:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6fqN-00035O-IV for bug-gnu-emacs@gnu.org; Fri, 14 Aug 2020 15:58:28 -0400 Received: from sonic309-14.consmr.mail.bf2.yahoo.com ([74.6.129.124]:40008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6fqL-000874-7h for bug-gnu-emacs@gnu.org; Fri, 14 Aug 2020 15:58:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1597435103; bh=dy5n9sUyJutZvftqeWSaE42WA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U80A70GHIPKR6lpLgqjsSNLslvjgLoHc2XKNx2qehRCWjGtEP1sv4Or4uGk6jxL0ZxjLjmWdz_Bt wshBNmnvV1A4YrPsXmjj07PWKL4uk6Ab7SuF9hVSIVwSOaM1SLBBSPJvAE5lCnEged2LLOGhcLlV pO9BIewvWc4ZUJNbT2TkhQp07BE_Z58QEZREuNxs.ElYhcMyqSbn4rAUtjTzbQADITUiQE_AM_Eb NXSUQ07d1jYVbsk6CxtL0MqN_BLeuDpQXlgneczxnBUbg0Mk80IiUwxMJt.rq7.bsr.qwRPsxany BGftoZdJOcv4ZSH2O18RnykC.5Ba43MJeBRiOotK6pNO3B._7qwuspVqUuvJayM3l6Hb6R1aQsF2 fCPn3c7i1sl1NdSccMWAPXKNvL_KPslCe9vr7WtQ3oUtfV5V_8A6eQ_M3NIuj.6QzqJaK00bgR2H qsmkfSr_94d92UWviaVOvvKM01pIHhi.caE3dHaBVpSbfLoUel1SroDWsH.z6Fw7_AeWIT.h_KTu wi8peCjU3mjP_uu0NtIOx9FzhVAh7yf2vokq1GORC0r6kEuX6_kfbQaLXrZo.OkaJt_dbzjNzPY2 Qc6Fi4nP2kaOx.5Euc1MqA1Ou36OwsgJAzDoVE1rhQk8UJSe9cXwnXIbfaTjk4GIHZOEVa2Br3d0 EXV0QoUOtDbyCaK33ix6OK_EO5NVhgFQOyjwFXGYI82yCnkkOvInQjuANbWXHN5qD_YBl9Bt.TQk G82Jpkz1Pdh8IIcBoLXbPh88SoRU- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Fri, 14 Aug 2020 19:58:23 +0000 Received: by smtp401.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 78aea373aaade104c946a43ff255cebe; Fri, 14 Aug 2020 19:58:19 +0000 (UTC) Date: Fri, 14 Aug 2020 21:58:14 +0200 From: Ergus Message-ID: <20200814195814.kw6xfj6sfumt22bx@Ergus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline References: <20200814195814.kw6xfj6sfumt22bx.ref@Ergus> X-Mailer: WebService/1.1.16455 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Content-Length: 4030 Received-SPF: pass client-ip=74.6.129.124; envelope-from=spacibba@aol.com; helo=sonic309-14.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/14 15:58:23 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) --text follows this line-- Using emacs to edit an m4 file I see that there is an issue recognizing the corresponding pairs in some cases like when using "case". For example: ``` [ case $word in i?86) something ;; bla) bla ;; esac ] ``` all the commands like forward-list or modes like show-paren-mode highlight the parentesis after i?86 as the closing for the first one. While the really closing one looks unpaired. Try emacs -Q file.m4 M-x show-paren-mode yank the example code and go to [. And see In GNU Emacs 28.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-12 built on Ergus Repository revision: fd6058b8fb07329bdd7d36cd05f4be1c5c691f9f Repository branch: master System Description: Arch Linux Recent messages: next-line: End of buffer [6 times] Current locus from *grep* Mark saved where search started Show-Paren mode enabled Making completion list... Quit Type "q" in help window to restore its previous buffer. Making completion list... completing-read-default: Command attempted to use minibuffer while in minibuffer funcall-interactively: End of buffer Configured using: 'configure --prefix=/home/ergo/.local/ --with-mailutils --with-json' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: m4 Minor modes in effect: show-paren-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 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 rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra pp cl-print ibuf-ext ibuffer ibuffer-loaddefs help-fns radix-tree help-mode cus-start cus-load paren misearch multi-isearch find-dired dired dired-loaddefs ffap url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map seq url-vars thingatpt grep compile comint ansi-color ring vc-git diff-mode easymenu easy-mmode cl-loaddefs cl-lib m4-mode term/tmux term/xterm xterm byte-opt gv bytecomp byte-compile cconv tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu 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 loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 102679 15950) (symbols 48 9862 1) (strings 32 29160 1933) (string-bytes 1 868059) (vectors 16 13716) (vector-slots 8 153782 8256) (floats 8 36 675) (intervals 56 1332 0) (buffers 992 15)) From unknown Sat Jun 14 19:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#42867: 28.0.50; Wring pair-mode in m4 and similar modes Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Oct 2020 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42867 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ergus Cc: 42867@debbugs.gnu.org Received: via spool by 42867-submit@debbugs.gnu.org id=B42867.16028618781162 (code B ref 42867); Fri, 16 Oct 2020 15:25:02 +0000 Received: (at 42867) by debbugs.gnu.org; 16 Oct 2020 15:24:38 +0000 Received: from localhost ([127.0.0.1]:60536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTRaw-0000Ib-Ja for submit@debbugs.gnu.org; Fri, 16 Oct 2020 11:24:38 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTRav-0000IK-6F for 42867@debbugs.gnu.org; Fri, 16 Oct 2020 11:24:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fCvA0v0RPJ135U9CgGiiopPnzj98P6g6kJZFeuchpfE=; b=d3ffhy+1HYwlqmfdp90+75VDCP 9eT2gEugsOc5P+KZ51vwRoRvn3HwnxmOWygXzJ7vzwY+7Lp8faRijcc+rymR5UlT11rlhmTprIgCT oUSYUdrAZ7io/gI0ovdSsOOMzC6SI40zphN2gZPzJsMfgUSwW8kOWOYEv9SgJEGfTRYc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTRal-0004kx-1M; Fri, 16 Oct 2020 17:24:30 +0200 From: Lars Ingebrigtsen References: <20200814195814.kw6xfj6sfumt22bx.ref@Ergus> <20200814195814.kw6xfj6sfumt22bx@Ergus> X-Now-Playing: Krim U's _1981-83_: "3 lys" Date: Fri, 16 Oct 2020 17:24:25 +0200 In-Reply-To: <20200814195814.kw6xfj6sfumt22bx@Ergus> (Ergus's message of "Fri, 14 Aug 2020 21:58:14 +0200") Message-ID: <87362e42ja.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ergus writes: > Using emacs to edit an m4 file I see that there is an issue recognizing > the corresponding pairs in some cases like when using "case". > > For example: > > ``` > [ > case $word in > i?86) > somethi [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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 (-) Ergus writes: > Using emacs to edit an m4 file I see that there is an issue recognizing > the corresponding pairs in some cases like when using "case". > > For example: > > ``` > [ > case $word in > i?86) > something ;; > bla) > bla ;; > esac > ] > ``` The problem is that "bla)" has a closing-paren character, and the Emacs's sexp machinery doesn't seem to take into account what the closing paren character is in these circumstances -- just that there's a closing paren? You see this all over the place in Emacs, but fortunately not many languages use closing-parens like that. Does anybody know whether there's any convenient way to fix the problem here in m4-mode? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no