GNU bug report logs - #64190
30.0.50; cperl-mode.el: bad recognition of multiline declarations

Previous Next

Package: emacs;

Reported by: Harald Jörg <haj <at> posteo.de>

Date: Tue, 20 Jun 2023 11:15:01 UTC

Owned by: haj <at> posteo.de

Severity: normal

Found in version 30.0.50

Done: Harald Jörg <haj <at> posteo.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Harald Jörg <haj <at> posteo.de>
To: 64190 <at> debbugs.gnu.org
Subject: bug#64190: 30.0.50; cperl-mode.el: bad recognition of multiline declarations
Date: Tue, 20 Jun 2023 11:13:37 +0000
Owner: haj <at> posteo.de

In CPerl mode, several constructs aren't recognized when they span
several lines, leading to bad fontification and indentation.  "Modern"
Perl declarations like subroutine signatures and class attributes are
more likely to span more than one line, so this should be fixed.

Example 1 (copy to a buffer and run M-x cperl-mode):
Only the first line is fontified here:
----------------------------------------------------------------------
my ($var1,
    $var2,
    $var3)
----------------------------------------------------------------------

Example 2 (copy to a buffer and run M-x cperl-mode):
The package name isn't fontified.
----------------------------------------------------------------------
package Foo
    0.1;
----------------------------------------------------------------------

Example 3 (this happens only while entering that code): When you type in
a subroutine like this, the subroutine name isn't fontified.
----------------------------------------------------------------------
sub do_stuff
{
    ...;
}
----------------------------------------------------------------------

Example 4 (this happens only while typing):  Put the cursor at the
beginning of the second line and enter a space.  The rest of the buffer
is fontified as string.
----------------------------------------------------------------------
sub do_stuff ($param1,
$param2)
{
   ...;
}

sub oops { ...; }
----------------------------------------------------------------------

Examples 3 and 4 can be recovered from by running M-x cperl-find-pods-heres
or by restarting M-x cperl-mode: They are caused by cperl-mode not
reacting correctly to calls from jit-lock.

-- 
Cheers,
haj




This bug report was last modified 2 years and 20 days ago.

Previous Next


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