GNU bug report logs - #11733
24.1; cperl indentation bugs

Previous Next

Package: emacs;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Mon, 18 Jun 2012 10:49:02 UTC

Severity: minor

Tags: confirmed

Found in versions 26.1, 24.1

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

Bug is archived. No further changes may be made.

Full log


Message #22 received at 11733-done <at> debbugs.gnu.org (full text, mbox):

From: Harald Jörg <haj <at> posteo.de>
To: 11733-done <at> debbugs.gnu.org
Subject: Indentation has been fixed in the master branch.
Date: Sat, 01 Jul 2023 22:50:07 +0000
Eventually, the reworking of the indentation code allows to fix these
bugs (again, thanks for the clear recipes).

The first example will now be indented like this:
--------------------------------------------------
#!/usr/bin/env perl
# -*- mode: cperl -*-

sub foo
{
}

sub bar
{
}
--------------------------------------------------

This is in line with the Perl style guide
https://perldoc.perl.org/perlstyle.

The second example is a masterpiece of edge cases:
--------------------------------------------------
#!/usr/bin/env perl
# -*- mode: cperl -*-

while (<>)
  {
    m:^  \d+ p:
      or die;
    m:^  \d+ :
      or die;
  }
--------------------------------------------------
The strings 'm:' and 'p:' look like labels, and cperl-mode must take
extra measures to detect these situations.  This is now done.  When
indented line-by-line, cperl-mode will now the leave the indentation
unchanged.

cperl-mode.el from the repository works with Emacs versions 27 and
newer.

Therefore, I am declaring this bug "done".

-- 
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.