GNU bug report logs - #66050
Making perl-mode.el obsolete

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 17 Sep 2023 12:49:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Harald Jörg <haj <at> posteo.de>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Corwin Brust <corwin <at> bru.st>, 66050 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>, monnier <at> iro.umontreal.ca, rms <at> gnu.org
Subject: bug#66050: Making perl-mode.el obsolete
Date: Sun, 24 Sep 2023 22:21:55 +0000
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> In addition to what Jens Schmidt said, I can add that:
>
> 1. If I have something like:
> my $some_code = "";
> $some_code.= q(
> my $counter = 0;
> );
>
> If I put point at column 0 of the line "my $counter", and hit TAB, I get
> indentation in perl-mode.  I don't in cperl-mode.  I tried to look into
> options for making this work but I couldn't find anything.

I consider the behavior of perl-mode to be a bug.

Whatever is within the parens of  q(...) is a string, and will be
assigned to the variable $some_code.  By "indenting", perl-mode changes
the value of $some_code by adding spaces.  In my opinion, indenting
should change the optical layout, but not the code!

> 2. While I'm typing the above string, I get messages about string/RE not
> found:
> End of ‘q( ... )’ string/RE not found: (scan-error Unbalanced
> parentheses 1092 1874)
> End of ‘q( ... )’ string/RE not found: (scan-error Unbalanced
> parentheses 1092 1918) [2 times]
> End of ‘q( ... )’ string/RE not found: (scan-error Unbalanced
> parentheses 1092 1962) [2 times]
>
> That's annoying.

The message is technically correct, and generally I consider the ability
of cperl-mode to locate syntax errors useful.  But I understand that it
can be annoying while you're typing (I myself don't see these messages
because I use paredit-mode, but I understand that not everyone wants
this electricity).  I guess that a way to optionally suppress these
messages can be found.

The frequency of this error message exploded with the introduction of
jit-lock-mode - before that cperl-mode didn't scan the code for every
character you type.  I think that backing out of jit-lock-mode would not
be wise.

> So far, my settings for getting a perl-mode experience in cperl-mode,
> with emacs -Q: (taken from a custom file):
> '(cperl-highlight-variables-indiscriminately t)
> '(cperl-indent-level 4)
> '(cperl-indent-parens-as-block t)
> '(cperl-invalid-face 'default)
,>
> '(cperl-array-face ((t (:inherit cperl-hash-face))))
> '(cperl-hash-face ((t (:underline t :inherit
> font-lock-variable-name-face))))
> '(cperl-nonoverridable-face ((t (:inherit default))))

Thanks for collecting this!

-- 
Cheers,
haj




This bug report was last modified 1 year and 264 days ago.

Previous Next


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