unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21647: 24.5; Perl-mode indenting fooled by ...=cut region
@ 2015-10-08 13:12 積丹尼 Dan Jacobson
  2015-10-14 22:05 ` bug#21647: [Patch] Don't let perl indentation get fooled by =cut Tom Willemse
  2019-09-29 22:11 ` Stefan Kangas
  0 siblings, 2 replies; 3+ messages in thread
From: 積丹尼 Dan Jacobson @ 2015-10-08 13:12 UTC (permalink / raw)
  To: 21647

Perl-mode indents the %Y wrong, if %X is commented.
If %X is uncommented, then both will be indented correctly.

if ( $ARGV[0] eq "TAIWAN" ) {

#    my %X;

=zz
    my %points = (
        A => [ 25.08, 120.61 ],
        B => [ 25.08, 121.40 ],
    );

    use constant TAIWAN_MAP => '
_aBC
_dEF
_GH_
jKL_
MNO_
pQR_
_Tu_
_vW';
=cut

my %Y;
}

In GNU Emacs 24.5.1 (i586-pc-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-21 on binet, modified by Debian





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#21647: [Patch] Don't let perl indentation get fooled by =cut
  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
  2019-09-29 22:11 ` Stefan Kangas
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Willemse @ 2015-10-14 22:05 UTC (permalink / raw)
  To: 21647

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#21647: [Patch] Don't let perl indentation get fooled by =cut
  2015-10-08 13:12 bug#21647: 24.5; Perl-mode indenting fooled by ...=cut region 積丹尼 Dan Jacobson
  2015-10-14 22:05 ` bug#21647: [Patch] Don't let perl indentation get fooled by =cut Tom Willemse
@ 2019-09-29 22:11 ` Stefan Kangas
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2019-09-29 22:11 UTC (permalink / raw)
  To: Tom Willemse; +Cc: 21647

close 21647 27.1
thanks

Tom Willemse <tom@ryuslash.org> writes:

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

Thanks.  The patch looks reasonable to me, and also fixes the reported
problem.  I've therefore pushed it to master, and I'm closing this bug
report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-29 22:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08 13:12 bug#21647: 24.5; Perl-mode indenting fooled by ...=cut region 積丹尼 Dan Jacobson
2015-10-14 22:05 ` bug#21647: [Patch] Don't let perl indentation get fooled by =cut Tom Willemse
2019-09-29 22:11 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).