bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21647: [Patch] Don't let perl indentation get fooled by =cut


From: Tom Willemse
Subject: bug#21647: [Patch] Don't let perl indentation get fooled by =cut
Date: Thu, 15 Oct 2015 00:05:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hey,

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


Cheers,

Tom

>From f9296dc710998577434959f7d5af30792cb2df26 Mon Sep 17 00:00:00 2001
From: Tom Willemse <tom@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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]