GNU bug report logs - #18985
24.3; cperl-mode misindents hash keys that start with an auto-quoted keyword

Previous Next

Package: emacs;

Reported by: avarab <at> gmail.com (Ævar Arnfjörð Bjarmason)

Date: Fri, 7 Nov 2014 16:44:01 UTC

Severity: normal

Tags: confirmed, fixed

Found in versions 24.3, 26.2

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: avarab <at> gmail.com
Cc: 18985 <at> debbugs.gnu.org
Subject: bug#18985: 24.3; cperl-mode misindents hash keys that start with an auto-quoted keyword
Date: Fri, 5 Jul 2019 22:04:03 +0200
avarab <at> gmail.com (Ævar Arnfjörð Bjarmason) writes:

> cperl-mode has a nasty bug in M-x indent-region, if you write this to a
> file:
>
>     my %x = (
>         for_me => "cookie",
>     );
>
> And indent it you end up with:
>
>     my %x = (
>      for _me => "cookie",
>     );
>
> Note the space between the "for" and "_me", the indenter falsely thought
> that "for" was a keyword and suffixed it with a space, changing the
> semantics of the code.
>
> The same issue happens with some other keywords, e.g. "if" and "until",
> but interestingly not "unless".

I can reproduce this on Emacs 26.2.

Best regards,
Stefan Kangas




This bug report was last modified 4 years and 267 days ago.

Previous Next


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