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

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

[debbugs-tracker] bug#17262: closed (In Perl mode, TAB zaps EOF marker a


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17262: closed (In Perl mode, TAB zaps EOF marker alignment)
Date: Wed, 16 Apr 2014 14:15:02 +0000

Your message dated Wed, 16 Apr 2014 10:13:59 -0400
with message-id <address@hidden>
and subject line Re: bug#17262: In Perl mode, TAB zaps EOF marker alignment
has caused the debbugs.gnu.org bug report #17262,
regarding In Perl mode, TAB zaps EOF marker alignment
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17262: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17262
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: In Perl mode, TAB zaps EOF marker alignment Date: Mon, 14 Apr 2014 01:30:06 +0800
In Perl mode, TAB zaps EOF marker alignment.
$ cat p.pl
print <<\EOF;
        <ol>
EOF
$ emacs p.pl
now do
C-x h runs the command mark-whole-buffer
TAB (translated from <tab>) runs the command indent-for-tab-command

The result is the EOF is no longer hugging the left margin!
Any following code will be printed out rather than executed, if indeed
the program's syntax is still valid.




--- End Message ---
--- Begin Message --- Subject: Re: bug#17262: In Perl mode, TAB zaps EOF marker alignment Date: Wed, 16 Apr 2014 10:13:59 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> In Perl mode, TAB zaps EOF marker alignment.
> $ cat p.pl
> print <<\EOF;
>       <ol>
> EOF
> $ emacs p.pl
> now do
> C-x h runs the command mark-whole-buffer
> TAB (translated from <tab>) runs the command indent-for-tab-command

> The result is the EOF is no longer hugging the left margin!

Indeed, thanks.

I've installed the patch below which should fix it,


        Stefan


=== modified file 'lisp/progmodes/perl-mode.el'
--- lisp/progmodes/perl-mode.el 2014-04-03 00:41:09 +0000
+++ lisp/progmodes/perl-mode.el 2014-04-16 14:11:39 +0000
@@ -903,7 +903,9 @@
        ;;          following_quotep minimum_paren-depth_this_scan)
        ;; Parsing stops if depth in parentheses becomes equal to third arg.
        (setq containing-sexp (nth 1 state)))
-      (cond ((nth 3 state) 'noindent)  ; In a quoted string?
+      (cond
+       ;; Don't auto-indent in a quoted string or a here-document.
+       ((or (nth 3 state) (eq 2 (nth 7 state))) 'noindent)
            ((null containing-sexp)     ; Line is at top level.
             (skip-chars-forward " \t\f")
             (if (memq (following-char)



--- End Message ---

reply via email to

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