GNU bug report logs - #21647
24.5; Perl-mode indenting fooled by ...=cut region

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 8 Oct 2015 13:13:02 UTC

Severity: minor

Tags: patch

Found in version 24.5

Fixed in version 27.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21647 <at> debbugs.gnu.org (full text, mbox):

From: Tom Willemse <tom <at> ryuslash.org>
To: 21647 <at> debbugs.gnu.org
Subject: [Patch] Don't let perl indentation get fooled by =cut
Date: Thu, 15 Oct 2015 00:05:07 +0200
[Message part 1 (text/plain, inline)]
Hey,

The attached patch fixes indentation for the situation described above
in the master branch.


Cheers,

Tom

[0001-Fix-indenting-in-perl-functions-with-doc-comments.patch (text/x-diff, inline)]
From f9296dc710998577434959f7d5af30792cb2df26 Mon Sep 17 00:00:00 2001
From: Tom Willemse <tom <at> ryuslash.org>
Date: Mon, 12 Oct 2015 00:45:49 +0200
Subject: [PATCH] Fix indenting in perl functions with doc-comments

* lisp/progmodes/perl-mode.el (perl-calculate-indent): Skip doc-comments
as well as comments and skip the entire comment, not just the line.
---
 lisp/progmodes/perl-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 55d69bf..b4d7127 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -946,8 +946,8 @@ Returns (parse-state) if line starts inside a string."
            ;; Skip over comments and labels following openbrace.
            (while (progn
                     (skip-chars-forward " \t\f\n")
-                    (cond ((looking-at ";?#")
-                           (forward-line 1) t)
+                    (cond ((looking-at ";?#\\|^=\\w+")
+                           (forward-comment 1) t)
                           ((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
                            (setq colon-line-end (line-end-position))
                            (search-forward ":")))))
-- 
2.6.1


This bug report was last modified 5 years and 233 days ago.

Previous Next


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