unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: haj@posteo.de (Harald Jörg)
To: 46024@debbugs.gnu.org
Cc: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Subject: bug#46024: Perl mode colors the word "argument" funny
Date: Fri, 22 Jan 2021 01:33:55 +0100	[thread overview]
Message-ID: <87pn1xu7ws.fsf@hajtower> (raw)
In-Reply-To: <87ft2uvyww.5.fsf@jidanni.org> ("積丹尼 Dan Jacobson"'s message of "Fri, 22 Jan 2021 04:05:19 +0800")

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> Perl mode colors the word "argument" funny:
> for ( $r[$v] ) {
>         $_->{argument}  = 0 + shift;
> }
> Cperl mode doesn't.
> emacs-version "27.1"

"argument" as a keyword in Perl mode came as a patch for Bug#27613 -
together with a couple of other keywords: anon, has, our, state,
supersede, let, and temp.

However, only 'our' and 'state' are part of Perl 5.  A keyword 'has' is
available with popular Perl extensions (Moose, Moo etc.), so arguably
fontification as a declarator is acceptable... though slightly
inaccurate.

The keywords 'anon', 'has', 'supersede', 'let' and 'temp' are part of
the Raku language, which started as "Perl 6", as described in the
language docs:
https://docs.raku.org/language/variables#Variable_declarators_and_scope.
'argument' apparently didn't make it into the language at all, but Raku
also has 'augment' and 'constant', and Perl's 'local' is called 'temp'
in Raku.

CPerl mode has caught only a few keywords from non-core Perl, these are
also available with popular extensions ('try','catch','finally').  Perl
mode seems to have adopted some more Raku-stuff (e.g. it registers
variable names like "my $amazing-variable" to imenu, but fontifies only
the $amazing-part).

So I wonder: What is the ambition of Emacs to support Raku?  The
languages Perl (Perl 5) and Raku (Perl 6) have diverged in their syntax,
so robably it is rather cumbersome to support both with any of the Perl
modes.  In my opionion, randomly adding Raku features to the modes
brings more confusion than productivity, and in any case keywords which
are no longer part of either language should be eliminated, in
particular: 'argument', which is the topic of this bug report.
-- 
Cheers,
haj





  reply	other threads:[~2021-01-22  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 20:05 bug#46024: Perl mode colors the word "argument" funny 積丹尼 Dan Jacobson
2021-01-22  0:33 ` Harald Jörg [this message]
2021-01-22 18:38   ` Lars Ingebrigtsen
2021-01-27 14:08     ` bug#46024: Perl mode colors the word "argument" funny [PATCH] Harald Jörg
2021-01-28  3:23       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn1xu7ws.fsf@hajtower \
    --to=haj@posteo.de \
    --cc=46024@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).