From unknown Wed Jun 18 00:10:20 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#44073 <44073@debbugs.gnu.org> To: bug#44073 <44073@debbugs.gnu.org> Subject: Status: cperl-mode: Cleanup - Delete a misleading comment [PATCH] Reply-To: bug#44073 <44073@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:10:20 +0000 retitle 44073 cperl-mode: Cleanup - Delete a misleading comment [PATCH] reassign 44073 emacs submitter 44073 Harald J=C3=B6rg severity 44073 minor tag 44073 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 18 19:56:00 2020 Received: (at submit) by debbugs.gnu.org; 18 Oct 2020 23:56:00 +0000 Received: from localhost ([127.0.0.1]:39377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUIWt-0004wK-So for submit@debbugs.gnu.org; Sun, 18 Oct 2020 19:56:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:60300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUIWs-0004wD-Hb for submit@debbugs.gnu.org; Sun, 18 Oct 2020 19:55:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUIWs-0002g2-5o for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:55:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:36476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUIWo-0006bj-5J for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:55:57 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 8847B16005C for ; Mon, 19 Oct 2020 01:55:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1603065349; bh=P5Wrs6htRvqh6PIAXA9ip9mzm9LfvYeJiQlmuk4gPfM=; h=To:From:Subject:Date:From; b=BDmKm/bV0RGhuZqmsQOIDgpW+lDwZmyKr6fh0rcF95jVlAD5IXCYx7nvUiXbUEGkc TwDgIeJd3sSZWjHXbCiekvhgNMO0y+6gkR7GWpHiFdk4hhTE7urqz8Q87/Vh6PJwos d+n6TlXwo3Xjey3B6m16ICB3EqmHkd2+Pyd1Bf/ejKHL070oYr5YaRyqAK5RAuVVqs xuKQ4kU9mHjKqbTLffjdnc89p4eDzp5w79Q3oO13lWSND2dWXQUCwZwPVuI4JeUI0L eu0FxGzwShBIwYa24dLcW+QbtcTTsiJsyq74ZuJVmzVxeW4HF3ZZpHCzBLdXe8nAKf cJv+jd1+ccsCA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4CDxbn07s0z9rxH for ; Mon, 19 Oct 2020 01:55:48 +0200 (CEST) To: bug-gnu-emacs@gnu.org From: =?UTF-8?Q?Harald_J=c3=b6rg?= Subject: cperl-mode: Cleanup - Delete a misleading comment [PATCH] Message-ID: Date: Mon, 19 Oct 2020 01:55:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A79EEE729D104198AD958974" Content-Language: en-US Received-SPF: pass client-ip=185.67.36.65; envelope-from=haj@posteo.de; helo=mout01.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/18 18:15:32 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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-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: -2.3 (--) This is a multi-part message in MIME format. --------------A79EEE729D104198AD958974 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Severity: minor With this patch, cperl-mode.el no longer informs the user about "Font lock bugs" which have been fixed - or worked around - long ago: Some of Perl's punctuation variables contain string delimiters ($`, $' and $") but they don't start strings. Fontification handles this correctly. The patch eliminates the comment, and it comes with a test to verify that cperl-mode gets it right in all cases which were listed in the comment, plus some more. --------------A79EEE729D104198AD958974 Content-Type: text/x-patch; charset=UTF-8; name="0001-cperl-mode-Delete-a-misleading-comment-add-tests-for.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-cperl-mode-Delete-a-misleading-comment-add-tests-for.pa"; filename*1="tch" >From d5cc24d57c2653f8c21c7bfe0bb75ff4b2df7ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Mon, 19 Oct 2020 01:34:20 +0200 Subject: [PATCH] cperl-mode: Delete a misleading comment, add tests for verification * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-fontify-punct-vars): Add regression tests to verify that fontification of punctuation variables doesn't start strings. * lisp/progmodes/cperl-mode.el: Delete a comment which explains a bug which has been fixed a long time ago. --- lisp/progmodes/cperl-mode.el | 7 ------ .../fontify-punctuation-vars.pl | 20 +++++++++++++++ test/lisp/progmodes/cperl-mode-tests.el | 25 +++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5b6e50c820..ebbea6bed9 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -71,13 +71,6 @@ ;; (define-key global-map [M-S-down-mouse-3] 'imenu) -;;;; Font lock bugs as of v4.32: - -;; The following kinds of Perl code erroneously start strings: -;; \$` \$' \$" -;; $opt::s $opt_s $opt{s} (s => ...) /\s+.../ -;; likewise with m, tr, y, q, qX instead of s - ;;; Code: ;;; Compatibility with older versions (for publishing on ELPA) diff --git a/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl new file mode 100644 index 0000000000..fa328438cb --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/fontify-punctuation-vars.pl @@ -0,0 +1,20 @@ +# The following Perl punctiation variables contain characters which +# are classified as string delimiters in the syntax table. The mode +# should not be confused by these. +# The corresponding tests check that two consecutive '#' characters +# are seen as comments, not as strings. +my $pre = $`; ## $PREMATCH, use another ` # to balance out +my $pos = $'; ## $POSTMATCH, use another ' # to balance out +my $lsp = $"; ## $LIST_SEPARATOR use another " # to balance out + +# In the second level, we use the reference constructor \ on these +# variables. The backslash is an escape character *only* in strings. +my $ref = \$`; ## \$PREMATCH, use another ` # to balance out +my $rif = \$'; ## \$POSTMATCH, use another ' # to balance out +my $raf = \$"; ## \$LIST_SEPARATOR use another " # to balance out + +my $opt::s = 0; ## s is no substitution here +my $opt_s = 0; ## s is no substitution here +my %opt = (s => 0); ## s is no substitution here +$opt{s} = 0; ## s is no substitution here +$opt_s =~ /\s+.../ ## s is no substitution here diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e2af2b5b8d..2a3a759093 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -196,4 +196,29 @@ cperl-mode-test-indent-styles (should (equal got expected))))) (cperl-set-style "CPerl")))) +(ert-deftest cperl-mode-fontify-punct-vars () + "Test fontification of Perl's punctiation variables. +Perl has variable names containing unbalanced quotes for the list +separator $\" and pre- and postmatch $` and $'. A reference to +these variables, for example \\$\", should not cause the dollar +to be escaped, which would then start a string beginning with the +quote character. This used to be broken in cperl-mode at some +point in the distant past, and is still broken in perl-mode. " + (skip-unless (eq cperl-test-mode #'cperl-mode)) + (let ((file (ert-resource-file "fontify-punctuation-vars.pl"))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-min)) + (funcall cperl-test-mode) + (while (search-forward "##" nil t) + ;; The third element of syntax-ppss is true if in a string, + ;; which would indicate bad interpretation of the quote. The + ;; fourth element is true if in a comment, which should be the + ;; case. + (should (equal (nth 3 (syntax-ppss)) nil)) + (should (equal (nth 4 (syntax-ppss)) t)) + ) + ))) + + ;;; cperl-mode-tests.el ends here -- 2.20.1 --------------A79EEE729D104198AD958974-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 04:58:35 2020 Received: (at 44073) by debbugs.gnu.org; 19 Oct 2020 08:58:35 +0000 Received: from localhost ([127.0.0.1]:40006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQzy-0006Mn-VU for submit@debbugs.gnu.org; Mon, 19 Oct 2020 04:58:35 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUQzw-0006MU-PR for 44073@debbugs.gnu.org; Mon, 19 Oct 2020 04:58:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=eAgyPE6taMT0nab6ce130hgEn/iNkLgm5dM7AldX56k=; b=uR5yi43Q4EYV73IlzPftF8Q0Iu Xwz/TeM27jmV3CwvcAIc2ihz8MSudmFMH4i0p7k+Y9oi9Ryk1BPR4tsKjqafHs8662UzjeB2CK/on 7831thCUC+13v0BQXZ4FZq/oT6I2uF8LAZS0vfLF88r6y7+tf+gYQFvXBYm700JBbPc8=; 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 1kUQzi-0005TC-JN; Mon, 19 Oct 2020 10:58:27 +0200 From: Lars Ingebrigtsen To: Harald =?utf-8?Q?J=C3=B6rg?= Subject: Re: bug#44073: cperl-mode: Cleanup - Delete a misleading comment [PATCH] References: X-Now-Playing: Elecktroids's _Elektroworld_: "Future Tone" Date: Mon, 19 Oct 2020 10:58:17 +0200 In-Reply-To: ("Harald =?utf-8?Q?J=C3=B6rg=22's?= message of "Mon, 19 Oct 2020 01:55:48 +0200") Message-ID: <87d01efv86.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; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Harald Jörg writes: > > With this patch, cperl-mode.el no longer informs the user about "Font > lock bugs" which have been fixed - or worked around - long ago: Some of > Perl's punctuation variables contain string delimi [...] 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-Debbugs-Envelope-To: 44073 Cc: 44073@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 (-) Harald J=C3=B6rg writes: > > With this patch, cperl-mode.el no longer informs the user about "Font > lock bugs" which have been fixed - or worked around - long ago: Some of > Perl's punctuation variables contain string delimiters ($`, $' and $") > but they don't start strings. Fontification handles this correctly. > > The patch eliminates the comment, and it comes with a test to verify > that cperl-mode gets it right in all cases which were listed in the > comment, plus some more. Thanks; applied to the trunk. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 19 04:58:40 2020 Received: (at control) by debbugs.gnu.org; 19 Oct 2020 08:58:40 +0000 Received: from localhost ([127.0.0.1]:40009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUR04-0006N6-6b for submit@debbugs.gnu.org; Mon, 19 Oct 2020 04:58:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:60532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUR02-0006Md-CL for control@debbugs.gnu.org; Mon, 19 Oct 2020 04:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gxb9FIUt/+fue64v9J17ZR3FId9yObKN74p35dUyNTo=; b=ejt7k7Ua76GBx0oO/t4rBlgnFS xIVHypoRoadn+CdOnQz96w6CJ+mjUfvNOMdwMvDeuso31mTLXRPrzpl0ttzAw3Vyg8Lt5eHDO2YFR 6U80CkWd54lw2rsVVd8XFBJH4cCE99FQwoy9puFxJ9j4Y8wGttQCSeTXcG1nlociaZ/M=; 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 1kUQzu-0005TJ-I2 for control@debbugs.gnu.org; Mon, 19 Oct 2020 10:58:32 +0200 Date: Mon, 19 Oct 2020 10:58:29 +0200 Message-Id: <87blgyfv7u.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #44073 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: tags 44073 fixed close 44073 28.1 quit 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-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.0 (-) tags 44073 fixed close 44073 28.1 quit From unknown Wed Jun 18 00:10:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 16 Nov 2020 12:24:09 +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