unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Kelling <ian@iankelling.org>
To: 18029@debbugs.gnu.org
Subject: bug#18029: 24.4.50; bad shell-script-mode indentation due to ^[{([] in a here document
Date: Tue, 15 Jul 2014 15:20:29 -0700	[thread overview]
Message-ID: <87ha2i2riq.fsf@treetowl.lan> (raw)


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@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))





             reply	other threads:[~2014-07-15 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 22:20 Ian Kelling [this message]
2021-05-29  4:19 ` bug#18029: 24.4.50; bad shell-script-mode indentation due to ^[{([] in a here document Lars Ingebrigtsen
2021-06-07 17:57   ` Ian Kelling
2021-06-07 18:04     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87ha2i2riq.fsf@treetowl.lan \
    --to=ian@iankelling.org \
    --cc=18029@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 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).