From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Harald =?UTF-8?Q?J=C3=B6rg?= Newsgroups: gmane.emacs.bugs Subject: bug#42251: 28.0.50; [PATCH] cperl-mode: Regression in fontifying HERE-docs Date: Tue, 7 Jul 2020 22:07:14 +0200 Message-ID: <19ca77ef-738a-a8d2-8231-2d24d4e47fbd@posteo.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9C48C13E9017BF5872527BD1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20093"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: 42251@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 07 22:08:10 2020 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 1jstsw-000597-9h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 22:08:10 +0200 Original-Received: from localhost ([::1]:43886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jstsv-0004b3-Cr for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Jul 2020 16:08:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jstso-0004an-Lu for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 16:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jstso-0002yg-CT for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 16:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jstso-0007FY-7T for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 16:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Harald =?UTF-8?Q?J=C3=B6rg?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jul 2020 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159415244427817 (code B ref -1); Tue, 07 Jul 2020 20:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jul 2020 20:07:24 +0000 Original-Received: from localhost ([127.0.0.1]:36739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jstsC-0007EY-9c for submit@debbugs.gnu.org; Tue, 07 Jul 2020 16:07:24 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jsts9-0007EQ-JZ for submit@debbugs.gnu.org; Tue, 07 Jul 2020 16:07:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsts9-0004O3-Cr for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 16:07:21 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:51889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsts6-0002nu-EG for bug-gnu-emacs@gnu.org; Tue, 07 Jul 2020 16:07:21 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 1CC1C240100 for ; Tue, 7 Jul 2020 22:07:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1594152435; bh=WT8cpUSmar9x0QIoI+1HqALupBV/e9QTRE0Bj4HhIp4=; h=From:Subject:To:Autocrypt:Date:From; b=hmDXwO6XNxcyHrCpyHfEClnnNXkoPJbnckuFFEQuMA+IHulaJ4xNtsSHRKgPy6smB F4ekAh488LEUWCZlMX1WCH05sNK3e+6/o4WW1UUekHcpTXlTkStgqAT52DxzYts+oy 06BCuurrjcqD2WQ3g31NUjUF2PlNdSiv5+nL8Nnft551RhqkVHjlArIgeoeHDYkp8A kLSyOHSfoEGu2XmeI4fEZb73S+gr8acxdnHCj9g9G7zca+dQb19V2sCf73bO3k00jk n++pPIibfdWaFQXzuB/zuKzWcYGG2hSld9VR8sGrCCYmGR8WcdpmwuTm4ZjGM8kq1f l9Ec6JrJttM9Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4B1YPZ4wFmz9rxL for ; Tue, 7 Jul 2020 22:07:14 +0200 (CEST) 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 cmcgPGhhakBwb3N0ZW8uZGU+iQJOBBMBCAA4FiEEIpYEZLQynxF8Q17KN4XzzzqAcpsFAl0D VrICGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQN Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=haj@posteo.de; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/07 16:07:15 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:182812 Archived-At: This is a multi-part message in MIME format. --------------9C48C13E9017BF5872527BD1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In the master branch, insert the following code into a buffer and activate cperl-mode: # --- sub just_for_indenting { my $here = < Date: Tue, 7 Jul 2020 18:10:31 +0200 Subject: [PATCH] * lisp/progmodes/cperl-mode.el: Correctly terminate HERE= -docs This patch repairs a regression introduced by (Bug:#27254). --- lisp/progmodes/cperl-mode.el | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index cdbb59a5ad..5879ba7ed2 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3560,19 +3560,18 @@ cperl-find-pods-heres "\\(\\`\n?\\|^\n\\)=3D" ; POD "\\|" ;; One extra () before this: - "<<~?" ; HERE-DOC - "\\(" ; 1 + 1 + "<<\\(~?\\)" ; HERE-DOC, indented-p =3D capture 2 + "\\(" ; 2 + 1 ;; First variant "BLAH" or just ``. "[ \t]*" ; Yes, whitespace is allowed! - "\\([\"'`]\\)" ; 2 + 1 =3D 3 - "\\([^\"'`\n]*\\)" ; 3 + 1 - "\\3" + "\\([\"'`]\\)" ; 3 + 1 =3D 4 + "\\([^\"'`\n]*\\)" ; 4 + 1 + "\\4" "\\|" ;; Second variant: Identifier or \ID (same as 'ID') or empty - "\\\\?\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\)?\\)" ; 4 + 1, 5 + 1 + "\\\\?\\(\\([a-zA-Z_][a-zA-Z_0-9]*\\)?\\)" ; 5 + 1, 6 + 1 ;; Do not have <<=3D or << 30 or <<30 or << $blah. ;; "\\([^=3D \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1 - "\\(\\)" ; To preserve count of pars :-( 6 + 1 "\\)" "\\|" ;; 1+6 extra () before this: @@ -3762,11 +3761,11 @@ cperl-find-pods-heres ;; ;; "\\([^=3D \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + = 1 ;; "\\(\\)" ; To preserve count of pars :-( 6 + 1 ;; "\\)" - ((match-beginning 2) ; 1 + 1 + ((match-beginning 3) ; 2 + 1 (setq b (point) tb (match-beginning 0) c (and ; not HERE-DOC - (match-beginning 5) + (match-beginning 6) (save-match-data (or (looking-at "[ \t]*(") ; << function_call() (save-excursion ; 1 << func_name, or $foo << 10 @@ -3793,17 +3792,17 @@ cperl-find-pods-heres (looking-at "\\(printf?\\|say\\|system\\|exec\\|sort\\)\\>"))) (error t))))))) (error nil))) ; func(<