GNU bug report logs - #49906
perl-mode: variables that conflict with keywords aren't fontified properly

Previous Next

Package: emacs;

Reported by: Tomasz Konojacki <me <at> xenu.pl>

Date: Fri, 6 Aug 2021 06:24:02 UTC

Severity: normal

Tags: moreinfo, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49906 in the body.
You can then email your comments to 49906 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Fri, 06 Aug 2021 06:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomasz Konojacki <me <at> xenu.pl>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 06 Aug 2021 06:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: bug-gnu-emacs <at> gnu.org
Subject: perl-mode: variables that conflict with keywords aren't fontified
 properly
Date: Fri, 06 Aug 2021 05:25:30 +0200
For example, "$package" is fontified like a keyword.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Fri, 06 Aug 2021 06:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Fri, 06 Aug 2021 08:37:19 +0200
[Message part 1 (text/plain, inline)]
On Fri, 06 Aug 2021 05:25:30 +0200
Tomasz Konojacki <me <at> xenu.pl> wrote:

> For example, "$package" is fontified like a keyword.

The attached patch fixes the problem.
[0001-perl-mode-fix-variable-fontification.patch (application/octet-stream, attachment)]

Added tag(s) patch. Request was from Tomasz Konojacki <me <at> xenu.pl> to control <at> debbugs.gnu.org. (Fri, 06 Aug 2021 06:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Fri, 06 Aug 2021 11:01:02 GMT) Full text and rfc822 format available.

Message #13 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tomasz Konojacki <me <at> xenu.pl>
Cc: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Fri, 06 Aug 2021 13:00:30 +0200
Tomasz Konojacki <me <at> xenu.pl> writes:

>> For example, "$package" is fontified like a keyword.

In what context, and in which Emacs version?

$package = foo;

is fontified like a variable in Emacs 28.

>  (defconst perl-font-lock-keywords-2
> -  (append
> +  (cl-concatenate
> +   'list

Any particular reason to change from append to cl-concatenate here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 06 Aug 2021 11:01:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Fri, 06 Aug 2021 12:07:01 GMT) Full text and rfc822 format available.

Message #18 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Fri, 06 Aug 2021 14:06:33 +0200
[Message part 1 (text/plain, inline)]
On Fri, 06 Aug 2021 13:00:30 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Tomasz Konojacki <me <at> xenu.pl> writes:
> 
> >> For example, "$package" is fontified like a keyword.
> 
> In what context, and in which Emacs version?
> 
> $package = foo;
> 
> is fontified like a variable in Emacs 28.

See the attached screenshot. Are you sure you aren't using cperl-mode?

> >  (defconst perl-font-lock-keywords-2
> > -  (append
> > +  (cl-concatenate
> > +   'list
> 
> Any particular reason to change from append to cl-concatenate here?

Because I'm concatenating three lists.
[screenshot.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Fri, 06 Aug 2021 12:11:01 GMT) Full text and rfc822 format available.

Message #21 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Fri, 06 Aug 2021 14:10:29 +0200
[Message part 1 (text/plain, inline)]
On Fri, 06 Aug 2021 14:06:33 +0200
Tomasz Konojacki <me <at> xenu.pl> wrote:

> See the attached screenshot. Are you sure you aren't using cperl-mode?

Oops, a corrected screenshot is attached to this post.
[screenshot2.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 09:11:02 GMT) Full text and rfc822 format available.

Message #24 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tomasz Konojacki <me <at> xenu.pl>
Cc: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 11:10:43 +0200
[Message part 1 (text/plain, inline)]
Tomasz Konojacki <me <at> xenu.pl> writes:

> See the attached screenshot. Are you sure you aren't using cperl-mode?

Yup:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
What Emacs version are you using?

>> Any particular reason to change from append to cl-concatenate here?
>
> Because I'm concatenating three lists.

You can concatenate any number of lists with append, so I don't quite
understand what you mean here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 09:14:02 GMT) Full text and rfc822 format available.

Message #27 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tomasz Konojacki <me <at> xenu.pl>
Cc: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 11:13:32 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> See the attached screenshot. Are you sure you aren't using cperl-mode?
>
> Yup:

Oops.  That sure wasn't cperl-mode -- it was python mode instead.  :-/

Yes, with perl-mode I'm able to reproduce the problem.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 09:34:02 GMT) Full text and rfc822 format available.

Message #30 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 11:33:24 +0200
[Message part 1 (text/plain, inline)]
On Sat, 07 Aug 2021 11:10:43 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> You can concatenate any number of lists with append, so I don't quite
> understand what you mean here.

You're right, I was confused. I was under the wrong impression that
append takes only two arguments. It was probably caused by the combination
of reading a tutorial[1] instead of the real documentation and
struggling with unrelated syntax errors. Obviously, I'm an elisp
beginner.

A revised patch is attached.

[1] - https://www.gnu.org/software/emacs/manual/html_node/eintr/append.html
[0001-perl-mode-fix-variable-fontification.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 10:38:02 GMT) Full text and rfc822 format available.

Message #33 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tomasz Konojacki <me <at> xenu.pl>
Cc: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 12:37:00 +0200
Tomasz Konojacki <me <at> xenu.pl> writes:

> A revised patch is attached.

Thanks; looks good to me (and the test cases seem to work fine), so I've
pushed it to Emacs 28.

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 49906 <at> debbugs.gnu.org and Tomasz Konojacki <me <at> xenu.pl> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 Aug 2021 10:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 11:10:01 GMT) Full text and rfc822 format available.

Message #38 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 13:09:33 +0200
On Sat, 07 Aug 2021 12:37:00 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> This change was small enough to apply without assigning copyright to the
> FSF, but for future patches you want to submit, it might make sense to
> get the paperwork started now, so that subsequent patches can be applied
> speedily. Would you be willing to sign such paperwork?

Sure, I'd appreciate it if you could send me the forms.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 11:17:02 GMT) Full text and rfc822 format available.

Message #41 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Tomasz Konojacki <me <at> xenu.pl>
Cc: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 13:16:09 +0200
Tomasz Konojacki <me <at> xenu.pl> writes:

> Sure, I'd appreciate it if you could send me the forms.

Great; here's the form to get started:

Please email the following information to assign <at> gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49906; Package emacs. (Sat, 07 Aug 2021 11:34:02 GMT) Full text and rfc822 format available.

Message #44 received at 49906 <at> debbugs.gnu.org (full text, mbox):

From: Tomasz Konojacki <me <at> xenu.pl>
To: 49906 <at> debbugs.gnu.org
Subject: Re: bug#49906: perl-mode: variables that conflict with keywords
 aren't fontified properly
Date: Sat, 07 Aug 2021 13:33:14 +0200
On Sat, 07 Aug 2021 13:16:09 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Great; here's the form to get started:
> 
> Please email the following information to assign <at> gnu.org, and we
> will send you the assignment form for your past and future changes.

Done, thank you!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 05 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.