GNU bug report logs - #18029
24.4.50; bad shell-script-mode indentation due to ^[{([] in a here document

Previous Next

Package: emacs;

Reported by: Ian Kelling <ian <at> iankelling.org>

Date: Tue, 15 Jul 2014 22:21:02 UTC

Severity: minor

Tags: confirmed, moreinfo

Found in versions 24.4.50, 25.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18029 in the body.
You can then email your comments to 18029 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18029; Package emacs. (Tue, 15 Jul 2014 22:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ian Kelling <ian <at> iankelling.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 15 Jul 2014 22:21:02 GMT) Full text and rfc822 format available.

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

From: Ian Kelling <ian <at> iankelling.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50;
 bad shell-script-mode indentation due to ^[{([] in a here document
Date: Tue, 15 Jul 2014 15:20:29 -0700
emacs -Q the following files, then use indent region on the whole buffer:
(indent-region (point-min) (point-max)) Similar indent commands will work the
same. This is how they get indented:

#!/bin/bash
if true; then
    true <<'EOF'
[ line beginning with one of [{( 
EOF
fi

if true; then
    true
    # comment containing a single quote 'true
           fi
            true
            


The true commands could be other things, they are just an example. I assume the
if statements could be other things which create indents. The final fi and
anything beyond it get bad indenting that is determined by the quote in the
first quote from 'EOF' Another variation of this bug:


#!/bin/bash
if true; then
    true <<EOF
[ line beginning with one of [{( 
EOF
fi

if true; then
    true
    # comment containing a single quote 'true
                                        fi
                                         true
                                         

The final fi and beyond's indenting is determined by the quote in 'true.  





In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9)
 of 2014-07-14 on treetowl
Repository revision: 117533 eggert <at> cs.ucla.edu-20140714192318-v0rrw2b8evo2wue4
Windowing system distributor `Fedora Project', version 11.0.11404000
Configured using:
 `configure --enable-link-time-optimization 'CFLAGS=-std=gnu99 -g3 -O2''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Shell-script

Minor modes in effect:
  sh-electric-here-document-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
M-x r e p o r t - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
r has auto save data; consider M-x recover-this-file
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils sh-script smie
executable time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 83313 7281)
 (symbols 48 18389 0)
 (miscs 40 39 124)
 (strings 32 12921 4377)
 (string-bytes 1 335173)
 (vectors 16 10129)
 (vector-slots 8 404842 13811)
 (floats 8 68 68)
 (intervals 56 193 1)
 (buffers 960 12)
 (heap 1024 35157 980))




bug Marked as found in versions 25.2. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 01 Apr 2017 23:12:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 01 Apr 2017 23:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18029; Package emacs. (Sat, 29 May 2021 04:21:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ian Kelling <ian <at> iankelling.org>
Cc: 18029 <at> debbugs.gnu.org
Subject: Re: bug#18029: 24.4.50; bad shell-script-mode indentation due to
 ^[{([] in a here document
Date: Sat, 29 May 2021 06:19:56 +0200
Ian Kelling <ian <at> iankelling.org> writes:

> emacs -Q the following files, then use indent region on the whole buffer:
> (indent-region (point-min) (point-max)) Similar indent commands will work the
> same. This is how they get indented:
>
> #!/bin/bash
> if true; then
>     true <<'EOF'
> [ line beginning with one of [{( 
> EOF
> fi
>
> if true; then
>     true
>     # comment containing a single quote 'true
>            fi
>             true

(I'm going through old bug reports that unfortunately got no response at
the time.)

I'm unable to reproduce this in Emacs 28, and Emacs 25.1 is the oldest
one I have, and I can't reproduce it there, either.

But Noam tagged this as reproduced in Emacs 25.2.

Are you still seeing this problem in more recent Emacs versions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 29 May 2021 04:21:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18029; Package emacs. (Mon, 07 Jun 2021 18:00:01 GMT) Full text and rfc822 format available.

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

From: Ian Kelling <ian <at> iankelling.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 18029 <at> debbugs.gnu.org
Subject: Re: bug#18029: 24.4.50; bad shell-script-mode indentation due to
 ^[{([] in a here document
Date: Mon, 07 Jun 2021 13:57:57 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Ian Kelling <ian <at> iankelling.org> writes:
>
>> emacs -Q the following files, then use indent region on the whole buffer:
>> (indent-region (point-min) (point-max)) Similar indent commands will work the
>> same. This is how they get indented:
>>
>> #!/bin/bash
>> if true; then
>>     true <<'EOF'
>> [ line beginning with one of [{( 
>> EOF
>> fi
>>
>> if true; then
>>     true
>>     # comment containing a single quote 'true
>>            fi
>>             true
>
> (I'm going through old bug reports that unfortunately got no response at
> the time.)
>
> I'm unable to reproduce this in Emacs 28, and Emacs 25.1 is the oldest
> one I have, and I can't reproduce it there, either.
>
> But Noam tagged this as reproduced in Emacs 25.2.
>
> Are you still seeing this problem in more recent Emacs versions?

Originally reported in 24.4.50.1, but I'm in a much more recent version
and it doesn't repro. It's been fixed! Thank you for checking up on this
and please close this bug.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18029; Package emacs. (Mon, 07 Jun 2021 18:05:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ian Kelling <ian <at> iankelling.org>
Cc: 18029 <at> debbugs.gnu.org
Subject: Re: bug#18029: 24.4.50; bad shell-script-mode indentation due to
 ^[{([] in a here document
Date: Mon, 07 Jun 2021 20:04:47 +0200
Ian Kelling <ian <at> iankelling.org> writes:

> Originally reported in 24.4.50.1, but I'm in a much more recent version
> and it doesn't repro. It's been fixed! Thank you for checking up on this
> and please close this bug.

Thanks for checking; closing this bug report then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 18029 <at> debbugs.gnu.org and Ian Kelling <ian <at> iankelling.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 07 Jun 2021 18:06:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 265 days ago.

Previous Next


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