From unknown Wed Jun 18 23:05:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16368 <16368@debbugs.gnu.org> To: bug#16368 <16368@debbugs.gnu.org> Subject: Status: 24.3; freeze in cperl mode when editing a regexp Reply-To: bug#16368 <16368@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:05:55 +0000 retitle 16368 24.3; freeze in cperl mode when editing a regexp reassign 16368 emacs submitter 16368 Vincent Lefevre severity 16368 normal tag 16368 patch confirmed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 05 20:29:02 2014 Received: (at submit) by debbugs.gnu.org; 6 Jan 2014 01:29:02 +0000 Received: from localhost ([127.0.0.1]:37418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vzz01-0000bj-Gh for submit@debbugs.gnu.org; Sun, 05 Jan 2014 20:29:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37297) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vzyzz-0000ba-CQ for submit@debbugs.gnu.org; Sun, 05 Jan 2014 20:29:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vzyzr-0002QO-RW for submit@debbugs.gnu.org; Sun, 05 Jan 2014 20:28:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vzyzr-0002QK-OA for submit@debbugs.gnu.org; Sun, 05 Jan 2014 20:28:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vzyzl-0002Sp-7W for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 20:28:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vzyze-0002PW-VF for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 20:28:45 -0500 Received: from ioooi.vinc17.net ([92.243.22.117]:52433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vzyze-0002PB-Iy for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2014 20:28:38 -0500 Received: from smtp-xvii.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 5035538F; Mon, 6 Jan 2014 02:28:30 +0100 (CET) Received: by xvii.vinc17.org (Postfix, from userid 1000) id B869B21A058; Mon, 6 Jan 2014 02:28:29 +0100 (CET) From: Vincent Lefevre To: bug-gnu-emacs@gnu.org Subject: 24.3; freeze in cperl mode when editing a regexp Date: Mon, 06 Jan 2014 02:28:29 +0100 Message-ID: <87iotxq4oy.fsf@xvii.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) Open a file in cperl mode containing the following line: /(\d{4})(?: +){2}/; e.g.: "emacs -Q file" then M-x cperl-mode Put the cursor over the second opening brace, and type several times to delete what is before "{2}". When one types at this point: /(\d{4})(?:{2}/; ^cursor Emacs freezes. One can type C-g to interrupt. One can also reproduce the bug by typing: /(\d{4})(?{2 Emacs freezes before the "2" appears. This bug is also present with Emacs 23. Bug also reported on: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734325 In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-22 on brahms, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11405000 System Description: Debian GNU/Linux unstable (sid) Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LC_COLLATE: POSIX value of $LC_CTYPE: en_US.UTF-8 value of $LC_TIME: en_DK value of $LANG: POSIX locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: display-time-mode: t show-paren-mode: t tooltip-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: x r e p o r t - e m Recent messages: Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)... Loading cjk-enc...done Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done Loading /etc/emacs/site-start.d/50psvn.el (source)...done Loading /etc/emacs/site-start.d/50rnc-mode.el (source)...done Loading /etc/emacs/site-start.d/50w3m-el.el (source)...done Loading /home/vinc17/share/emacs/site-lisp/mutteditor.el (source)...done Loading time...done For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: /usr/share/emacs24/site-lisp/css-mode/css-mode hides /usr/share/emacs/site-lisp/css-mode/css-mode /usr/share/emacs/site-lisp/autoconf/autotest-mode hides /usr/share/emacs/site-lisp/autotest-mode /usr/share/emacs24/site-lisp/html-helper-mode/tempo hides /usr/share/emacs/24.3/lisp/tempo /usr/share/emacs24/site-lisp/flim/hex-util hides /usr/share/emacs/24.3/lisp/hex-util /usr/share/emacs24/site-lisp/flim/md4 hides /usr/share/emacs/24.3/lisp/md4 /usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell /usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell /usr/share/emacs24/site-lisp/css-mode/css-mode hides /usr/share/emacs/24.3/lisp/textmodes/css-mode /usr/share/emacs24/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.3/lisp/net/hmac-md5 /usr/share/emacs24/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.3/lisp/net/sasl-ntlm /usr/share/emacs24/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.3/lisp/net/sasl-cram /usr/share/emacs24/site-lisp/flim/ntlm hides /usr/share/emacs/24.3/lisp/net/ntlm /usr/share/emacs24/site-lisp/flim/sasl hides /usr/share/emacs/24.3/lisp/net/sasl /usr/share/emacs24/site-lisp/flim/hmac-def hides /usr/share/emacs/24.3/lisp/net/hmac-def /usr/share/emacs24/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.3/lisp/net/sasl-digest /usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/24.3/lisp/language/thai-word /usr/share/emacs24/site-lisp/html-helper-mode/html-helper-mode hides /usr/share/emacs/site-lisp/html-helper-mode/html-helper-mode /usr/share/emacs24/site-lisp/html-helper-mode/hhm-config hides /usr/share/emacs/site-lisp/html-helper-mode/hhm-config /usr/share/emacs24/site-lisp/html-helper-mode/tempo hides /usr/share/emacs/site-lisp/html-helper-mode/tempo /usr/share/emacs24/site-lisp/html-helper-mode/visual-basic-mode hides /usr/share/emacs/site-lisp/html-helper-mode/visual-basic-mode Features: (shadow sort gnus-util mail-extr warnings emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time cus-start cus-load paren cc-styles cc-align cc-engine cc-vars cc-defs w3m-load jabber-autoloads time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 19:33:28 2019 Received: (at 16368) by debbugs.gnu.org; 20 Sep 2019 23:33:28 +0000 Received: from localhost ([127.0.0.1]:58775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBSP2-0004Hu-5K for submit@debbugs.gnu.org; Fri, 20 Sep 2019 19:33:28 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:41314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBSP0-0004Ha-0Z for 16368@debbugs.gnu.org; Fri, 20 Sep 2019 19:33:26 -0400 Received: by mail-pg1-f176.google.com with SMTP id s1so3578432pgv.8 for <16368@debbugs.gnu.org>; Fri, 20 Sep 2019 16:33:25 -0700 (PDT) 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:cc; bh=n+Sv5rda2RrFqEP8Gttkx6rUTlnD4nxChmV+VNZXzBI=; b=hQL60Cd4anGgQOn0ABT/m7gWxNc11LDGtlckk82rQPSOPeX4BVMIDf6vS+KXFOTjVB Tiy4T1X9H58AIu3Q5ajT8CdKM8xQz7/8O+VvLG6gi/fT7Z7sQSKz+LHkXgumFLLbXvdm KAAOEGiXyfLNU99dXOXPfOWJys4q03DS/ugU6Hk2qFQjFzIAHiOuYlbtt2xTG+13QQOy Y2Kr/aC2ngO1oxKTbWpPIa8fWTzAUQnLb9b1JerUCut1uuCio2ARl/TC6g5AZ2jzw9OT cskDLWz0F7cVL187coxSDl+MJNxyEhhL+NzVJbiN1vcYVqO3Vb5VbsrNo037Dwc+XYXw Nh2Q== X-Gm-Message-State: APjAAAVt6mTCdo5jOttrG8t8KEGik7WsQk97s7vNdAOjnmWUXIHa+0Gn DIQ5aIU0g10vRhneFepDUhBixzyciH8X2lEU2uNxHMyL X-Google-Smtp-Source: APXvYqy7Yr92KM32PrR4AKunskgSs4wddMOIBLqInLJNdz4fzh2u3rCZoexj0cUIWiRrOk99gXPY4tuKycg5Nm+57nI= X-Received: by 2002:a17:90a:1150:: with SMTP id d16mr7757264pje.2.1569022400102; Fri, 20 Sep 2019 16:33:20 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 21 Sep 2019 01:33:08 +0200 Message-ID: Subject: Re: bug#16368: 24.3; freeze in cperl mode when editing a regexp To: Vincent Lefevre Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 16368 Cc: 16368@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: -0.6 (/) Vincent Lefevre writes: > Open a file in cperl mode containing the following line: > > /(\d{4})(?: +){2}/; > > e.g.: "emacs -Q file" then M-x cperl-mode > > Put the cursor over the second opening brace, and type > several times to delete what is before "{2}". When one types > at this point: > > /(\d{4})(?:{2}/; > ^cursor > > Emacs freezes. One can type C-g to interrupt. I can confirm this is still an issue in Emacs 26.1 and on the current master branch. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 20 19:34:04 2019 Received: (at control) by debbugs.gnu.org; 20 Sep 2019 23:34:04 +0000 Received: from localhost ([127.0.0.1]:58779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBSPc-0004Jb-ER for submit@debbugs.gnu.org; Fri, 20 Sep 2019 19:34:04 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:35486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBSPa-0004Iw-LK for control@debbugs.gnu.org; Fri, 20 Sep 2019 19:34:02 -0400 Received: by mail-pg1-f176.google.com with SMTP id a24so4712438pgj.2 for ; Fri, 20 Sep 2019 16:34:02 -0700 (PDT) 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=ZXYM3UBQWX8NjntGRhRfXDEhSHZC4FoKTu2gqbcVFZY=; b=UzIFrmLFYQyq9SwP3/BfCVb+yk69nzEqLkRn2CvKBciRLLrzJfszro3Kyx1vR25rec DllDyB6lHBGKTze0AqaFnE+pmFdSclavKnCosVjhjGhmDUITU+/wj4GyPLRMM2pYBB4o /qxM/DT/WE6oP22TVfV5PqJq9IirrQRLOqxhU49L3nAD5T9v2cne+YsZPCnxUzrk8jel mQhyMwLx7w/ernDyow+nadc/es7hpb4TVjZjEts3xoeahZDFv5EkrVYbbutT5426Xw0Z AO3YF8EKNUNgfEvNR8McTGiAM/M9GzJ8xPxHNkyUy1jgkmms+yms5TS1Ziaicpcku9qv fk+g== X-Gm-Message-State: APjAAAW0ZTavlt939Kk7APziKT5l67s+tKheUS3JFXKZ9SGksoicSPI0 IbFr7/qtWpt76Z8FcqJ1v3FJzAaoyFiosHNcIKoZD5P1 X-Google-Smtp-Source: APXvYqxHaBdexNsVz8uj/8ncuMEBpE6F74urfnvKIaEyU77OwM7Q+UguUu60VUH7y/UucuaIR8DeetEvgDj5oUZc660= X-Received: by 2002:aa7:8750:: with SMTP id g16mr4725294pfo.190.1569022436939; Fri, 20 Sep 2019 16:33:56 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 21 Sep 2019 01:33:45 +0200 Message-ID: Subject: Re: bug#16368: 24.3; freeze in cperl mode when editing a regexp To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: control 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: -0.6 (/) tags 16368 + confirmed found 16368 26.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 02 16:06:52 2020 Received: (at 16368) by debbugs.gnu.org; 2 Sep 2020 20:06:52 +0000 Received: from localhost ([127.0.0.1]:60744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDZ1w-0008KZ-DG for submit@debbugs.gnu.org; Wed, 02 Sep 2020 16:06:52 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDZ1s-0008KK-6s for 16368@debbugs.gnu.org; Wed, 02 Sep 2020 16:06:51 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B6CC92400FE for <16368@debbugs.gnu.org>; Wed, 2 Sep 2020 22:06:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1599077201; bh=McpbLhPehdfH5RFimYeK67RDGJldaBMAwgdO0yu36b4=; h=To:From:Subject:Autocrypt:Date:From; b=Oiq3bfjvcul+Pk8UmHwmK79FgSxWUtPGGIvkTIifzXfOxRE+Kr1jWIVlWmUNu0jbx jh72a+KhEcomqv4A+ihe9CPcrQHscHxVjTOay/khYafzXJFKtBPH1fIVoOEHG82Ejj soWD3FvRoXiTKn/ep6bi9b6qks16Nc2g8FqFWfakXfiudfuFWjxj3tnmHPXFxDnOhw e5Sm8JgMy4i6+xfV7EovyDgdeqdjTSkuzV7Krxc4slZFgbd8nRHgzqqRd5r4oWYSkQ oZ8L4vGDCVgP1F7XME663AxWsqh3pZYtem8pBxcuXie3NxSJeZiLJINU5qWDhd+1kH 5HgTJwEKhJzhw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BhZhd15x2z9rxk for <16368@debbugs.gnu.org>; Wed, 2 Sep 2020 22:06:40 +0200 (CEST) To: 16368@debbugs.gnu.org From: =?UTF-8?Q?Harald_J=c3=b6rg?= Subject: [PATCH] cperl-mode: don't freeze over a cool regexp Autocrypt: addr=haj@posteo.de; keydata= mQINBF0DVrIBEAC7TRlIilBg/5Dx7R2rV4FBDEavbyMT2cS2wWyksh7JA8e17LNmTdakf+Bm u6C2m6+frolteYRlkreoyAg0fj/5tDw/s5dJDw3tM0b+m/pj2HcwTSRpQSEy5lBiCg11E6Mt F9UngCfkGtJzu8PBWXc1RDQVBwRn5MZbpMZZatE8NOq9AA3Yg6sY11Ez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H3NE7A/YIYcYno0gasjjOl9voOgF63gWq0rU9DXPYzAEo T0X5U61d1MieiGzszbnAiFjuiCPOgEAZ5UOG1jgk0brXOGXcB6uLUKXdHY/Hew2Qw2UN4jsF qgaVHmgokTr0ml7VVP2x/QTsFB7+mCbJvKIy7wuaRUN8/YELIrcBo9TlZbHFhQuF/nUloLFy qWfnjERPf3F15raGx0mGtxyYmgjRGAmtn11fNUrvrPxvbrVOWq7kcSukdtHavH3J6VBv+8kd YFQMaa1HVZ6Fhp50GYB+zZ29C7gtNIe0rn59xAcsBab/TyNjpG4BP4D0oGCl0+TTgzNIemji AsnleF4J+/xNczT+QQusHYtByZ6FRWqKPxLl3NE9h5e4Uy5QpwXCCI97ZA248Hmp Message-ID: Date: Wed, 2 Sep 2020 22:06:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8162899F26987C37CC20DE14" Content-Language: en-US X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16368 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 (-) This is a multi-part message in MIME format. --------------8162899F26987C37CC20DE14 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit That bug exists since 14 years, but only surfaces if the regexp has a closing brace in the wrong place (two characters before an unfinished group starts). The reason is that `cperl-forward-group-in-re' failed to report unbalanced parentheses: In the function, the error was too narrowly localized and gets lost before returning. Patch attached, including two test cases. -- Cheers, haj --------------8162899F26987C37CC20DE14 Content-Type: text/x-patch; charset=UTF-8; name="0001-2020-09-02-Harald-J-rg-haj-posteo.de.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-2020-09-02-Harald-J-rg-haj-posteo.de.patch" =46rom 3e513396340736dd182e5afa562abca5641ef300 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Harald=3D20J=3DC3=3DB6rg?=3D Date: Wed, 2 Sep 2020 21:47:10 +0200 Subject: [PATCH] =3D?UTF-8?q?2020-09-02=3D20=3D20Harald=3D20J=3DC3=3DB6rg= =3D20=3D20?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/progmodes/cperl-mode.el (cperl-forward-group-in-re): Make sure that an error is reported back to the caller (Bug#16368). * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-16368): Tests for balanced (no error) and unbalanced (caught exception) cases of `cperl-forward-group-in-re'. --- lisp/progmodes/cperl-mode.el | 9 +++++---- test/lisp/progmodes/cperl-mode-tests.el | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 44579cfd38..ac22218318 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3241,8 +3241,8 @@ cperl-forward-group-in-re Works before syntax recognition is done." ;; Works *before* syntax recognition is done (or st-l (setq st-l (list nil))) ; Avoid overwriting '() - (let (st b reset-st) - (condition-case b + (let (st result reset-st) + (condition-case err (progn (setq st (cperl-cached-syntax-table st-l)) (modify-syntax-entry ?\( "()" st) @@ -3251,7 +3251,8 @@ cperl-forward-group-in-re (set-syntax-table st) (forward-sexp 1)) (error (message - "cperl-forward-group-in-re: error %s" b))) + "cperl-forward-group-in-re: error %s" err) + (setq result err))) ;; now restore the initial state (if st (progn @@ -3259,7 +3260,7 @@ cperl-forward-group-in-re (modify-syntax-entry ?\) "." st))) (if reset-st (set-syntax-table reset-st)) - b)) + result)) =20 =20 (defvar font-lock-string-face) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmode= s/cperl-mode-tests.el index be8b42d99a..3a49b91ec2 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -48,4 +48,25 @@ cperl-mode-test-bug-42168 (let ((code "{ $a- / $b } # /")) (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) =20 +(ert-deftest cperl-mode-test-bug-16368 () + "Verify that `cperl-forward-group-in-re' doesn't hide errors." + (require 'cperl-mode) + (let ((code "/(\\d{4})(?{2}/;") ; the regex from the bug report + (result)) + (with-temp-buffer + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal (car result) 'scan-error)) + (should (equal (nth 1 result) "Unbalanced parentheses")) + (should (=3D (point) 9)))) ; point remains unchanged on err= or + (let ((code "/(\\d{4})(?{2})/;") ; here all parens are balanced + (result)) + (with-temp-buffer + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal result nil)) + (should (=3D (point) 15))))) ; point has skipped the group + ;;; cperl-mode-tests.el ends here --=20 2.20.1 --------------8162899F26987C37CC20DE14-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 02 18:19:35 2020 Received: (at 16368) by debbugs.gnu.org; 2 Sep 2020 22:19:35 +0000 Received: from localhost ([127.0.0.1]:32788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDb6M-0007WX-R5 for submit@debbugs.gnu.org; Wed, 02 Sep 2020 18:19:35 -0400 Received: from mail-ed1-f54.google.com ([209.85.208.54]:38601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDb6J-0007WI-RY for 16368@debbugs.gnu.org; Wed, 02 Sep 2020 18:19:33 -0400 Received: by mail-ed1-f54.google.com with SMTP id c8so591445edv.5 for <16368@debbugs.gnu.org>; Wed, 02 Sep 2020 15:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :content-transfer-encoding; bh=iiIx1igfbiupHRtjXhb2vM55jQGd0IZSlM14o0P95xA=; b=clgY3AFVIgA5V5ShygYpziAqynBDd9m8iKiRMW3FYHWpqg9YNC83tlLYcBAjTKBTY3 eUK5ap9JrXVuOOHeJXhddkJgY8RIg5SdOaLIW9q7UzhYAlIeeTJkxSDZ+a6O5HoJF3ig iK70d1g1C7Nn4HWTIh1w9/wHIXKvM0SgC8QMPxkh00ncs1p4UsZXixQmSL3p+edQsfFm qjSmYf9nlX6OnwAAYgkKBUELQLYq6OFx8169OvbBD1tm+eSheGRnOAm9jAj7nAJ+uL7l nZRWSUUi6iyZieGbQ9PawbHVOp6VnhmGWo01nXkg/4tmgyuIKXI4gNjRmiaPNrBqVA2Z b3sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:content-transfer-encoding; bh=iiIx1igfbiupHRtjXhb2vM55jQGd0IZSlM14o0P95xA=; b=A8EzPQPkL8w/w5a+3TaSnB7kEuqwIppT+5UtM/LtwQBGABPJ/2ngVbYTmrNy0zbm0L ZHQpOvALjam1PfW6spYuqo7Xi286ijFfUvIXZ5BIJK7cTKFmk1MSZQwuSMw3AnyoshQp GX6jM6FcBkiPj3GawopvYV2QmPAYZH0QmWejIGeTbzEEyaY8CEYLyuedWEnwR4rpGCw6 vwEZ/tyu7yBaEKR03XWMSzAg+LuPZYR138bypYVJGMEMwAUdipDuTwRqWGPBAFhzxbAk XNNKMvgqjG3qwG03sWhXhPVwzTdfolyPVagYlZfDjw0Zwfi7tSoZ831eaJAOH/cXwUDs C3Pg== X-Gm-Message-State: AOAM531l4oGexnOXmfTOhqpdOXcQ8zkUyFu6UyP/7/K1U+90UvBpIlbS BHfeCv/6XwGyn3kHcWZ+qxwiJeYGXkNkLZ//8bk= X-Google-Smtp-Source: ABdhPJyIPvH5XoSizhJU23OVCGdUfHG296ucy+KFKGhSJ1kiF7Tp18bxmpTdhz3Wlmq7KfrcdmpDInAecUwPi/MOTok= X-Received: by 2002:a50:cd08:: with SMTP id z8mr13289edi.185.1599085165979; Wed, 02 Sep 2020 15:19:25 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 2 Sep 2020 18:19:25 -0400 From: Stefan Kangas In-Reply-To: References: <87iotxq4oy.fsf@xvii.vinc17.org> MIME-Version: 1.0 Date: Wed, 2 Sep 2020 18:19:25 -0400 Message-ID: Subject: Re: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp To: =?UTF-8?B?SGFyYWxkIErDtnJn?= , 16368@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16368 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 (-) Harald J=C3=B6rg writes: > Patch attached, including two test cases. Thanks for working on cperl-mode bugs. Testing the original recipe with your patch it is already an improvement in that it avoids the freeze. But I see these messages: cperl-forward-group-in-re: error (scan-error Unbalanced parentheses 9 94) (scan-error Unbalanced parentheses 9 94) Is that the expected and desired behavior? --- Also, some minor nits: > Subject: [PATCH] =3D?UTF-8?q?2020-09-02=3D20=3D20Harald=3D20J=3DC3=3DB6rg= =3D20=3D20 =3D?UTF-8?q?steo.de>?=3D Better first line: Fix freeze in cperl-mode when editing a regexp > * lisp/progmodes/cperl-mode.el (cperl-forward-group-in-re): Make > sure that an error is reported back to the caller (Bug#16368). > > * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-16368): > Tests for balanced (no error) and unbalanced (caught exception) > cases of `cperl-forward-group-in-re'. Format these flush to the first column (no initial space). > --- a/test/lisp/progmodes/cperl-mode-tests.el > +++ b/test/lisp/progmodes/cperl-mode-tests.el I see this: ELC lisp/progmodes/cperl-mode-tests.elc In end of data: lisp/progmodes/cperl-mode-tests.el:73:1: Warning: the function `cperl-forward-group-in-re' is not known to be defined. You should add this line to the top: (require 'cperl-mode) Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 02 18:34:46 2020 Received: (at control) by debbugs.gnu.org; 2 Sep 2020 22:34:46 +0000 Received: from localhost ([127.0.0.1]:32796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDbL4-0007sk-IH for submit@debbugs.gnu.org; Wed, 02 Sep 2020 18:34:46 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:44607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDbL3-0007sX-FS for control@debbugs.gnu.org; Wed, 02 Sep 2020 18:34:45 -0400 Received: by mail-ej1-f42.google.com with SMTP id a15so896047ejf.11 for ; Wed, 02 Sep 2020 15:34:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=9z0/y5MdzgLIYBXVGv3t0OmaSt3Qek3Vb3w232vBO48=; b=MgvUPAF8X/fm3HpFcl9CgWZkCfgsMdR6c7iEUteGgMmat/jqi3lk44XyhlcSOSlIT4 pECl+KW33kNuAkl2iRoHPX3hupjDT6G2hERKqfJV9Y9CGQDYqJ9t/chgtb67MzcV6Wy9 K0pOYRo996fXxtoyEmdFoaB+n5dPn9pA9uUQonqgpmpQ2Q4SIDeDDZk50EkR9xDBKOFY lBa6VFsNfrCPJ8JMo9C5NAu26TzqJZFpXVWja9Cw2F19ub9FsXvFOEHSpAxcGWkk/2Ne +t8RgWEzCmwQLMUF+OC2bIPAjcAJNMkjL+S7IrRLjN4cdkx4Acpfar1onqd5n9+L5XhL 2Pfg== X-Gm-Message-State: AOAM531JEHfiStpqA8OtYSEmlttcLSIXLHIVAfrGhWN1qZkb9bMTYVMb J6YPQJQHF2+e9ScrmhCnI4HxzDun3VZiJcPsLLwg1OTy X-Google-Smtp-Source: ABdhPJx7H50zQky7sZ17pV/dxtPi/ZodECQX9bWdNLz+dOKjXnwhN6cvjOIrS5aX75mqvIoz9nCaA3yg4QtIgGYO3LU= X-Received: by 2002:a17:906:f2d3:: with SMTP id gz19mr291494ejb.377.1599086079701; Wed, 02 Sep 2020 15:34:39 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 2 Sep 2020 18:34:39 -0400 From: Stefan Kangas MIME-Version: 1.0 Date: Wed, 2 Sep 2020 18:34:39 -0400 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: tags 16368 + patch thanks Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.42 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.218.42 listed in list.dnswl.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.0 BLANK_SUBJECT Subject is present but empty 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-Debbugs-Envelope-To: control 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: tags 16368 + patch thanks Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.218.42 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.42 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.0 BLANK_SUBJECT Subject is present but empty 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different tags 16368 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 02 19:40:53 2020 Received: (at 16368) by debbugs.gnu.org; 2 Sep 2020 23:40:54 +0000 Received: from localhost ([127.0.0.1]:32859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDcN3-0003AD-Hu for submit@debbugs.gnu.org; Wed, 02 Sep 2020 19:40:53 -0400 Received: from mout01.posteo.de ([185.67.36.65]:59933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDcN1-0003A1-PX for 16368@debbugs.gnu.org; Wed, 02 Sep 2020 19:40:53 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 11CFA16005C for <16368@debbugs.gnu.org>; Thu, 3 Sep 2020 01:40:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1599090046; bh=mgOwSuZxai0YvELbyfhyMd0LNjpVuEi7JWt2juGgvWo=; h=Subject:To:From:Autocrypt:Date:From; b=Obaj+8WgFisPpINfoxZRI/4RCWSION8MHfbqp6HF5Fg1uGVyRrRfo6Gi/qXnafY07 vV71WaL/TN35kK3WJ2T0cVjPlM3GqFWuY4fdgFcT8c+h1cAZS0kbZB+60Vo+UuuI68 oH+mPT2U0hWzjAlNuwU6GkmBj4AXByUE6ZUsFmWdIucYkzqBQBZ/f8x6AkB5a4Xj7g K673G4pVF8Pee6WL3PXBGyuFe9ekzcrFC/H3IRCCZCBDBzZSfaEupnuSJTZP932F+A 1LzKY/C6TOIY3ezWCZdJq/WGxxS+ckwecRuh6FHd5Q5w59jEl1wiXmP+hFNvUTT/JQ ryWiMUner3Zaw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BhgRd33Gyz6tm6; Thu, 3 Sep 2020 01:40:45 +0200 (CEST) Subject: Re: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp To: Stefan Kangas , 16368@debbugs.gnu.org References: <87iotxq4oy.fsf@xvii.vinc17.org> From: =?UTF-8?Q?Harald_J=c3=b6rg?= Autocrypt: addr=haj@posteo.de; keydata= mQINBF0DVrIBEAC7TRlIilBg/5Dx7R2rV4FBDEavbyMT2cS2wWyksh7JA8e17LNmTdakf+Bm u6C2m6+frolteYRlkreoyAg0fj/5tDw/s5dJDw3tM0b+m/pj2HcwTSRpQSEy5lBiCg11E6Mt F9UngCfkGtJzu8PBWXc1RDQVBwRn5MZbpMZZatE8NOq9AA3Yg6s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GhjQuH3NE7A/YIYcYno0gasjjOl9voOgF63gWq0rU9DXPYzAEo T0X5U61d1MieiGzszbnAiFjuiCPOgEAZ5UOG1jgk0brXOGXcB6uLUKXdHY/Hew2Qw2UN4jsF qgaVHmgokTr0ml7VVP2x/QTsFB7+mCbJvKIy7wuaRUN8/YELIrcBo9TlZbHFhQuF/nUloLFy qWfnjERPf3F15raGx0mGtxyYmgjRGAmtn11fNUrvrPxvbrVOWq7kcSukdtHavH3J6VBv+8kd YFQMaa1HVZ6Fhp50GYB+zZ29C7gtNIe0rn59xAcsBab/TyNjpG4BP4D0oGCl0+TTgzNIemji AsnleF4J+/xNczT+QQusHYtByZ6FRWqKPxLl3NE9h5e4Uy5QpwXCCI97ZA248Hmp Message-ID: <1dce9689-f0ae-e066-bbf0-fb92f9b997ce@posteo.de> Date: Thu, 3 Sep 2020 01:40:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 16368 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.3 (-) On 9/3/20 12:19 AM, Stefan Kangas wrote: > Harald Jörg writes: > >> Patch attached, including two test cases. > > Thanks for working on cperl-mode bugs. > > Testing the original recipe with your patch it is already an improvement > in that it avoids the freeze. But I see these messages: > > cperl-forward-group-in-re: error (scan-error Unbalanced parentheses 9 94) > (scan-error Unbalanced parentheses 9 94) > > Is that the expected and desired behavior? Yes, it is, sort of. Maybe it should be fine-tuned. At this point we _have_ the situation of unbalanced parentheses, and cperl-mode rubs it in for every character you type. Just open a buffer in cperl-mode and start typing: $a =~ s/ At this point a message appears, with a different text when you open a parentheses, and will haunt you until you get everything closed properly. Given that regexps can be messy and heavy with punctuation, I'd say this is desired behavior. I can only guess that the first part of the message (which starts with "cperl-forward-group-in-re") was added out of frustration: The bug prevented the second part of the message (without "cperl-forward-group-in-re") from ever appearing. Only this wasn't fatal unless... there was this closing brace two characters before. I'll check that, and prepare an updated patch if that's true. > --- > > Also, some minor nits: > >> Subject: [PATCH] =?UTF-8?q?2020-09-02=20=20Harald=20J=C3=B6rg=20=20> =?UTF-8?q?steo.de>?= > > Better first line: > > Fix freeze in cperl-mode when editing a regexp > >> * lisp/progmodes/cperl-mode.el (cperl-forward-group-in-re): Make >> sure that an error is reported back to the caller (Bug#16368). >> >> * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-16368): >> Tests for balanced (no error) and unbalanced (caught exception) >> cases of `cperl-forward-group-in-re'. > > Format these flush to the first column (no initial space). No problem, I'll do so. I thought I was supposed to create the commit messages with C-x 4 a, but probably I misunderstood and should have post-processed that text in the first place. >> --- a/test/lisp/progmodes/cperl-mode-tests.el >> +++ b/test/lisp/progmodes/cperl-mode-tests.el > > I see this: > > ELC lisp/progmodes/cperl-mode-tests.elc > > In end of data: > lisp/progmodes/cperl-mode-tests.el:73:1: Warning: the function > `cperl-forward-group-in-re' is not known to be defined. > > You should add this line to the top: > > (require 'cperl-mode) Hm. That should rather be _moving_ that line to the top? The line is there, in the test which calls this function. For me this seemed to be enough to avoid that message when byte-compiling. But of course, moving the line to the top is fine, probably more tests will follow to exercise functions which aren't autoloaded. Give me a few hours for a nap: It's past midnight here :) -- Cheers, haj From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 03 05:58:48 2020 Received: (at 16368) by debbugs.gnu.org; 3 Sep 2020 09:58:48 +0000 Received: from localhost ([127.0.0.1]:33542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDm12-0006HN-29 for submit@debbugs.gnu.org; Thu, 03 Sep 2020 05:58:48 -0400 Received: from mail-ed1-f46.google.com ([209.85.208.46]:42511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDm11-0006HB-2A for 16368@debbugs.gnu.org; Thu, 03 Sep 2020 05:58:47 -0400 Received: by mail-ed1-f46.google.com with SMTP id l63so2018398edl.9 for <16368@debbugs.gnu.org>; Thu, 03 Sep 2020 02:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :content-transfer-encoding; bh=NXy9j+M7tuKJDGrPkUjoHGh8KWl0rjmSdAICXRlFT9Y=; b=tHxTHgqhI19+8hcQdQQJnEyBWNWKjsnRz//eMB9Y7pMX6hwDNh+dHmL/qcyPn76HIB CXZr/G56xNTz00Grdlf+Hpak7DCVG5KBrHQ6M1OXNudiHwBxpVwp0H6PWHOz3HW1+yMc QzXaXtVhDUMMru07oO2PwbYJprbrCqA04qHtVB18UfgXcieLh+OzJ06rrBniX6JgSJyg Tf1GxyZn7GaY3Ra/JMFh8Up2hiqpakzaexoSCm4DCa5kBNk+ZMRYfkzYj2AupTmwItPQ AuxfJsXdMU8DNFetadudJqJ9NznHZA3gm8TpBDIGON9U6X2KNfUfmRhONEYrpLcrZxUw wUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:content-transfer-encoding; bh=NXy9j+M7tuKJDGrPkUjoHGh8KWl0rjmSdAICXRlFT9Y=; b=ItE4NlOlITbP/UE3S2IZG3rGlgYENOF36wu3kunqn1gFYZPBeHA4ANgyXkJ7F7DCc0 5OSn7ZwI4GRGTWnpbnLSvAB5FDLD/hbFByP9pCzAynG9il4hyxEtaAiWctf+mZjb5PpV dAWeiczdhRg7Ixhu5mKzVfhDJe3eqHD61hAIB2Qzw3E4oomEWNbjS2rngIfWehTSdZFw kPyRPjJdY0BvYOYfbjXRQV7iEHd8leTbanHmwEjRAHh3ThH/x39vM/twoyzPE3Id2Ec3 8pVaBHVWeEC3tfVYBeNzXRyiIOtx/+ufadgtitkOTw+cnAgo7qhtRHIip91K2sAPOA0s EPRw== X-Gm-Message-State: AOAM530XmhyPsQMcyYXtcNzlrRVWXcdAFDrX/IvMkaZRD1OX+/d94CDC hjHDXMdKeNkTS/ror4XvXCnV5RS9kuiMKzHcSSE= X-Google-Smtp-Source: ABdhPJwYve3KMBfv42hnQThhZiVwD5z9itpT9dTmQsndaE9cFQRPOOOE25BtidjGMnqAY5PXqwhPnL8azRUjSB/nL0U= X-Received: by 2002:aa7:da09:: with SMTP id r9mr2228993eds.7.1599127121156; Thu, 03 Sep 2020 02:58:41 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 3 Sep 2020 02:58:40 -0700 From: Stefan Kangas In-Reply-To: <1dce9689-f0ae-e066-bbf0-fb92f9b997ce@posteo.de> References: <87iotxq4oy.fsf@xvii.vinc17.org> <1dce9689-f0ae-e066-bbf0-fb92f9b997ce@posteo.de> MIME-Version: 1.0 Date: Thu, 3 Sep 2020 02:58:40 -0700 Message-ID: Subject: Re: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp To: =?UTF-8?B?SGFyYWxkIErDtnJn?= , 16368@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16368 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 (-) Harald J=C3=B6rg writes: > I'd say this is desired behavior. OK, thanks. Your explanation sounds good to me. > I can only guess that the first part of the message (which starts with > "cperl-forward-group-in-re") was added out of frustration: The bug > prevented the second part of the message (without > "cperl-forward-group-in-re") from ever appearing. Only this wasn't > fatal unless... there was this closing brace two characters before. > I'll check that, and prepare an updated patch if that's true. Sounds good. > No problem, I'll do so. I thought I was supposed to create the commit > messages with C-x 4 a, but probably I misunderstood and should have > post-processed that text in the first place. I always use C-x 4 a, and then delete the spacing to the left. > Hm. That should rather be _moving_ that line to the top? Ah, right. Yup, that sounds good. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 03 16:27:23 2020 Received: (at 16368) by debbugs.gnu.org; 3 Sep 2020 20:27:23 +0000 Received: from localhost ([127.0.0.1]:36296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDvpK-0003QL-Sw for submit@debbugs.gnu.org; Thu, 03 Sep 2020 16:27:23 -0400 Received: from mout01.posteo.de ([185.67.36.65]:48903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDvpI-0003Py-4y for 16368@debbugs.gnu.org; Thu, 03 Sep 2020 16:27:21 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id AB6FF160061 for <16368@debbugs.gnu.org>; Thu, 3 Sep 2020 22:27:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1599164833; bh=2JmKqm8K0AMAV+0i41thWtxVdId3JNbXLDFF/RWDxQY=; h=Subject:To:From:Autocrypt:Date:From; b=fpPb3dYvWU0IXlKo8EQ4HCWTHitOZkUiZNZMeu1VOJEQMIYbtgWmrrQzPZ0n46120 kS4hiod3Xy/UdtZUILwZWMOn6TRpftqBCCBbFrxl8p1jQeFNM1i/x3ginf8QjOIZqV f2AiD0HaewzJfMpwAjVuU7iqtrCokkfcuFA2sUWaT643AkY6WExRP+eK6R2TK+gX+j 6DnMPatg7xbMA4qd6TKktYxGj1qiZZQGdApqms6BR/3XlMXvAnJT4w1zlO02d4T18q nPH/Zmx9W+Z4IWEXyv3RIa5NPVH/4PoH4zevSd+bRV/Qw6lJBd62H6SuqjEc+6U8iP ZmA6DA94ztmjA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BjC5s0Y36z9rxS; Thu, 3 Sep 2020 22:27:12 +0200 (CEST) Subject: Re: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp To: Stefan Kangas , 16368@debbugs.gnu.org References: <87iotxq4oy.fsf@xvii.vinc17.org> <1dce9689-f0ae-e066-bbf0-fb92f9b997ce@posteo.de> From: =?UTF-8?Q?Harald_J=c3=b6rg?= Autocrypt: addr=haj@posteo.de; keydata= mQINBF0DVrIBEAC7TRlIilBg/5Dx7R2rV4FBDEavbyMT2cS2wWyksh7JA8e17LNmTdakf+Bm u6C2m6+frolteYRlkreoyAg0fj/5tDw/s5dJDw3tM0b+m/pj2HcwTSRpQSEy5lBiCg11E6Mt F9UngCfkGtJzu8PBWXc1RDQVBwRn5MZbpMZZatE8NOq9AA3Yg6sY11Ez3xIvYU2R7a4OSxmc RJV2+dhdQ4oOTBIGQ2urQSU81kyRtkx+/Yh8WefMrk9nF3nzYziLS53euCAXyzklwYmD6Li3 XSu7wYp5fISky9DK6DPFK7h4RXEL4GFAhy31ehrVnNTcGRohM1Dm9BV9dwXkwlaeT3q0X+nE SXVqPDHtv748bXNIg2WVCZ0WgShcA46XVlSE9Fm+w0HI/1m1L4BaMmQ7gyK5dEchbhxohkk0 AqC3hEJ4ULRidrsCoCWGMFKiOIb9rjeC00vhrUkVJDkPWEGLXjhnRQykb6cESko0rPrSDLqX 9YqaNQ6KO9Un6uogE7YnXYg35EXJ8ORdX257IbXNbFVpgM8FFsl48WV3Pl9WNdADhnnOrz3O wzyK58i/BTsnjVX8ghbWkQcPQ2Kprt+4YR2trEi7TM5Uqzzrg0vp7Oe/9KZBxdxCE67thV7h ElW3CHb4q6o31b4cFmLbtFesSy+hnUU4UymgHgi/hvhxioBxIQARAQABtBxIYXJhbGQgSsO2 cmcgPGhhakB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69rbUddQSuLF7 A12LqPQjuK+ZeI9MHYEBIq8pRzUGJJmDmJ3cOf9GaF5esfweidTNo3CEiSKkB7ccBSoOWECm KTGKlsraFnpps68wlz8UMwNEvumG4JZwmTa10qj7PDu/W0H6nH3egWbrfqUh29kspVrlfoqE 20EPCcUtCaayB3lZdLsAEQEAAYkCNgQYAQgAIBYhBCKWBGS0Mp8RfENeyjeF8886gHKbBQJd A1ayAhsMAAoJEDeF8886gHKbPZ8QAI16XfXtSGcMDjm5/2M0qLNTpCcPCVGbKlWdshJPt9gH QcQKHXrHEl4kTdBFB15LzHIqfcjbhMxdxEPqU+3wpz9UVIEUHQ+9+sFMU79CXGCPMOz6bo44 UXo4bbe0AdX7pLmdZnYce+wAlUEYlzBgf+5tA62RqgB4/kDgk8TX9LZKpxUp5zUhUTac6o2b NVhf77jFz/gGSEdo9DFxXyZOnvW5sy71cSXaYvecCX4Zkt1PIt6Je8FPrZB18m7204/5abHA FcekJd+WfxbLBpiidIsPqEGhjQuH3NE7A/YIYcYno0gasjjOl9voOgF63gWq0rU9DXPYzAEo T0X5U61d1MieiGzszbnAiFjuiCPOgEAZ5UOG1jgk0brXOGXcB6uLUKXdHY/Hew2Qw2UN4jsF qgaVHmgokTr0ml7VVP2x/QTsFB7+mCbJvKIy7wuaRUN8/YELIrcBo9TlZbHFhQuF/nUloLFy qWfnjERPf3F15raGx0mGtxyYmgjRGAmtn11fNUrvrPxvbrVOWq7kcSukdtHavH3J6VBv+8kd YFQMaa1HVZ6Fhp50GYB+zZ29C7gtNIe0rn59xAcsBab/TyNjpG4BP4D0oGCl0+TTgzNIemji AsnleF4J+/xNczT+QQusHYtByZ6FRWqKPxLl3NE9h5e4Uy5QpwXCCI97ZA248Hmp Message-ID: Date: Thu, 3 Sep 2020 22:27:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------0AAFCCBF2E9EE097C1EABD02" Content-Language: en-US X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 16368 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.4 (---) This is a multi-part message in MIME format. --------------0AAFCCBF2E9EE097C1EABD02 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 9/3/20 11:58 AM, Stefan Kangas wrote: > Harald Jörg writes: > >> I'd say this is desired behavior. > > OK, thanks. Your explanation sounds good to me. It wasn't quite accurate, though. My explanation assumed that the regex as a whole wasn't terminated, but in fact it was. In fact, the message comes from the fact that (?{...}) introduces a block of code into the regexp. So, by removing the colon from (?:{...}), the semantics changed from "just another shy group" to "code", and for code cperl-mode applies stricter rules than for the contents of a capture group. I'd still say the message is ok. >> I can only guess that the first part of the message (which starts with >> "cperl-forward-group-in-re") was added out of frustration: The bug >> prevented the second part of the message (without >> "cperl-forward-group-in-re") from ever appearing. Only this wasn't >> fatal unless... there was this closing brace two characters before. >> I'll check that, and prepare an updated patch if that's true. > > Sounds good. ...And done. Now you get only one message, without the unnecessary "cperl-forward-group-in-re" prefix. >> No problem, I'll do so. I thought I was supposed to create the commit >> messages with C-x 4 a, but probably I misunderstood and should have >> post-processed that text in the first place. > > I always use C-x 4 a, and then delete the spacing to the left. Ok, adapted. I have also used your recommendation for the commit summary. >> Hm. That should rather be _moving_ that line to the top? > > Ah, right. Yup, that sounds good. When I did this, I stumbled over the purpose of Stefan Monniers change to the tests - this has been taken to emacs-devel. For now, moving the line to the top and skipping the test if called in a perl-mode environment, should do the trick. Patch, mark2, is attached! -- Cheers, haj --------------0AAFCCBF2E9EE097C1EABD02 Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-freeze-in-cperl-mode-when-editing-a-regexp.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Fix-freeze-in-cperl-mode-when-editing-a-regexp.patch" =46rom 2ae8d341de4cb9782241348b28e4f713c317925c Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Harald=3D20J=3DC3=3DB6rg?=3D Date: Thu, 3 Sep 2020 22:11:47 +0200 Subject: [PATCH] Fix freeze in cperl-mode when editing a regexp * lisp/progmodes/cperl-mode.el (cperl-forward-group-in-re): Make sure that an error is reported back to the caller (Bug#16368). * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-16368): Tests for balanced (no error) and unbalanced (caught exception) cases of `cperl-forward-group-in-re'. --- lisp/progmodes/cperl-mode.el | 9 ++++----- test/lisp/progmodes/cperl-mode-tests.el | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 44579cfd38..e2628c834c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3241,8 +3241,8 @@ cperl-forward-group-in-re Works before syntax recognition is done." ;; Works *before* syntax recognition is done (or st-l (setq st-l (list nil))) ; Avoid overwriting '() - (let (st b reset-st) - (condition-case b + (let (st result reset-st) + (condition-case err (progn (setq st (cperl-cached-syntax-table st-l)) (modify-syntax-entry ?\( "()" st) @@ -3250,8 +3250,7 @@ cperl-forward-group-in-re (setq reset-st (syntax-table)) (set-syntax-table st) (forward-sexp 1)) - (error (message - "cperl-forward-group-in-re: error %s" b))) + (error (setq result err))) ;; now restore the initial state (if st (progn @@ -3259,7 +3258,7 @@ cperl-forward-group-in-re (modify-syntax-entry ?\) "." st))) (if reset-st (set-syntax-table reset-st)) - b)) + result)) =20 =20 (defvar font-lock-string-face) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmode= s/cperl-mode-tests.el index be8b42d99a..e14ff98e3f 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -18,6 +18,8 @@ =20 (defvar cperl-test-mode #'cperl-mode) =20 +(require 'cperl-mode) + (defun cperl-test-ppss (text regexp) "Return the `syntax-ppss' of the first character matched by REGEXP in = TEXT." (interactive) @@ -48,4 +50,25 @@ cperl-mode-test-bug-42168 (let ((code "{ $a- / $b } # /")) (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) =20 +(ert-deftest cperl-mode-test-bug-16368 () + "Verify that `cperl-forward-group-in-re' doesn't hide errors." + (skip-unless (eq cperl-test-mode #'cperl-mode)) + (let ((code "/(\\d{4})(?{2}/;") ; the regex from the bug report + (result)) + (with-temp-buffer + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal (car result) 'scan-error)) + (should (equal (nth 1 result) "Unbalanced parentheses")) + (should (=3D (point) 9)))) ; point remains unchanged on err= or + (let ((code "/(\\d{4})(?{2})/;") ; here all parens are balanced + (result)) + (with-temp-buffer + (insert code) + (goto-char 9) + (setq result (cperl-forward-group-in-re)) + (should (equal result nil)) + (should (=3D (point) 15))))) ; point has skipped the group + ;;; cperl-mode-tests.el ends here --=20 2.20.1 --------------0AAFCCBF2E9EE097C1EABD02-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 03 17:12:38 2020 Received: (at 16368) by debbugs.gnu.org; 3 Sep 2020 21:12:38 +0000 Received: from localhost ([127.0.0.1]:36337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDwX8-0004UR-El for submit@debbugs.gnu.org; Thu, 03 Sep 2020 17:12:38 -0400 Received: from mail-ej1-f51.google.com ([209.85.218.51]:37666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDwX6-0004U8-1F for 16368@debbugs.gnu.org; Thu, 03 Sep 2020 17:12:36 -0400 Received: by mail-ej1-f51.google.com with SMTP id nw23so5814492ejb.4 for <16368@debbugs.gnu.org>; Thu, 03 Sep 2020 14:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :content-transfer-encoding; bh=ESTFz0UUFoS6CI0T9Hy6UWP+82hf4g474zl4VQIk4Uo=; b=VLMP9GvEwH3EFIl1IH8lHLjJyzv3XRmj+p2s8ZGc9e5vEo7ZchJt2bHKCzWMX2vmhe pGa2fgVU0eHxG7durs+1Ko9oS1fgtdqFvgyEuBVRPuDQ/5ZPYeomsO34sY+mHjsVzQaR 0lrmEEfWDUhaBoK9v/zigqisVTjnhBkWM+wYsVLpPiWCnINOCTJL9V5LS8ATCb912she YEuAlGOlxsFLedj47FGNIopzlC0UqrNzVuKqnb314Noav1K74B9bp6zCFMEuR1uE5SNY NE8/2SHuyx/85/h1s5MmzZWbaytC94AlUKDWmC4oBgKqVySjQvii+MMasSPK/r8Xa4y0 d2Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:content-transfer-encoding; bh=ESTFz0UUFoS6CI0T9Hy6UWP+82hf4g474zl4VQIk4Uo=; b=jBIH2nFtpfBrVXvDD08sEimlzyQ6wQOAPVXJO0hcU8zL9p8v/g6tKmnqszLBeph+yT cp1lGP1e4kFy1WOWJJjajNrKAo6YoXBS/zYkCQSlbWgXfMsaX+zrnPu5Fbseo4iXUrTo cUimHWgDg0+wNgJii2mcSDoeTBqUd5uvJWaDvkewvyQUvPveEGGhXoMxWp7pjfAozpm5 BDxNjorf3zxtro+lO0v5EB52JLOkDZZf5Ugv4TNadLsbeTFcVzBFiVkJWULo5NPJ91pb F1S/3/kItTIyfAxudVMRZxEFVhzNsmir2ORGV3am6fOFA/QPUHeuHwWxhi6/q6yuB6I1 6y3g== X-Gm-Message-State: AOAM531lphIL69uO5U/4waQzDOO3TAKbpTd69dcMDwI/6Wf8beMYz9+m CC8aipB4qMShaW5kzP3T5t1RG/0l7HTFZV0MP+g= X-Google-Smtp-Source: ABdhPJyPUci+9hrMTU2+c1L1zA99oUHX4AMVcDC9AZSh6+X3Qu+lEufzB2ySHaXIPeHG7GQ79IlglNSPpI+2Iqa/nGI= X-Received: by 2002:a17:906:3a02:: with SMTP id z2mr4084700eje.287.1599167550277; Thu, 03 Sep 2020 14:12:30 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 3 Sep 2020 21:12:29 +0000 From: Stefan Kangas In-Reply-To: References: <87iotxq4oy.fsf@xvii.vinc17.org> <1dce9689-f0ae-e066-bbf0-fb92f9b997ce@posteo.de> MIME-Version: 1.0 Date: Thu, 3 Sep 2020 21:12:29 +0000 Message-ID: Subject: Re: bug#16368: [PATCH] cperl-mode: don't freeze over a cool regexp To: =?UTF-8?B?SGFyYWxkIErDtnJn?= , 16368@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16368 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 (-) close 16368 28.1 thanks Harald J=C3=B6rg writes: > Patch, mark2, is attached! LGTM, tested and works as far as I can tell. Pushed to master as commit 7921b5db10. Thanks! From unknown Wed Jun 18 23:05:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 02 Oct 2020 11:24:07 +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