all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tom Willemse <tom@ryuslash.org>
To: 21647@debbugs.gnu.org
Subject: bug#21647: [Patch] Don't let perl indentation get fooled by =cut
Date: Thu, 15 Oct 2015 00:05:07 +0200	[thread overview]
Message-ID: <m3lhb5p0mk.fsf@ryuslash.org> (raw)
In-Reply-To: <87612ho671.fsf@jidanni.org>

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Hey,

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


Cheers,

Tom


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix perl indentation --]
[-- Type: text/x-diff, Size: 1238 bytes --]

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	other threads:[~2015-10-14 22:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 13:12 bug#21647: 24.5; Perl-mode indenting fooled by ...=cut region 積丹尼 Dan Jacobson
2015-10-14 22:05 ` Tom Willemse [this message]
2019-09-29 22:11 ` bug#21647: [Patch] Don't let perl indentation get fooled by =cut Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3lhb5p0mk.fsf@ryuslash.org \
    --to=tom@ryuslash.org \
    --cc=21647@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.