[Top][All Lists]

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

[debbugs-tracker] bug#18756: closed (24.4; shell-script-mode does wrong

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18756: closed (24.4; shell-script-mode does wrong indentation)
Date: Tue, 06 Jan 2015 18:56:02 +0000

Your message dated Tue, 06 Jan 2015 13:55:17 -0500
with message-id <address@hidden>
and subject line Re: bug#18756: 24.4; shell-script-mode does wrong indentation
has caused the debbugs.gnu.org bug report #18756,
regarding 24.4; shell-script-mode does wrong indentation
to be marked as done.

(If you believe you have received this mail in error, please contact

18756: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18756
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.4; shell-script-mode does wrong indentation Date: Fri, 17 Oct 2014 22:36:03 +0300
M-x shell-script-mode<Enter>

With every <Enter> key-press the current line gets indeted, so that
the buffer looks like:

<Tab> also mis-behaves. Emacs 24.3.1, OTOH, works fine for me.

In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2014-10-17 on icsl5123
System Description:    SUSE Linux Enterprise Server 10 (x86_64)

Configured using:
 `configure --prefix=/nfs/iil/home/ddaboul/r/sles10 --with-gif=no
 --without-pop --without-sound --without-gpm --without-dbus

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ > 0 ; 2 0 8 ; 0 c ESC x s h e l l - s c r i p
t - m o d e RET # h i RET l s RET x = 3 RET ESC x r
e p o r t - e m a c s - b u g RET

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
No indentation for this shell type.

Load-path shadows:
None found.

(shadow sort gnus-util mail-extr emacsbug message 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 xterm
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 dynamic-setting x-toolkit x multi-tty

Memory information:
((conses 16 83253 3991)
 (symbols 48 18103 0)
 (miscs 40 31 113)
 (strings 32 12327 4537)
 (string-bytes 1 361598)
 (vectors 16 7894)
 (vector-slots 8 361363 27987)
 (floats 8 63 284)
 (intervals 56 186 0)
 (buffers 960 11)
 (heap 1024 8017 572))

--- End Message ---
--- Begin Message --- Subject: Re: bug#18756: 24.4; shell-script-mode does wrong indentation Date: Tue, 06 Jan 2015 13:55:17 -0500 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.5

Peter Oliver wrote:

> I can reproduce this when electric-indent-mode is on and sh-set-shell
> is run for a csh-family shell.

Thanks for this vital clue.
I installed the following, which seems to fix it.

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index d79b387..4700324 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2477,7 +2475,8 @@ Lines containing only comments are considered empty."
-      (indent-to (if (eq this-command 'newline-and-indent)
+      (indent-to (if (or (eq this-command 'newline-and-indent)
+                         (and electric-indent-mode (eq this-command 'newline)))
                   (if (< (current-column)
                          (setq current (progn (back-to-indentation)

--- End Message ---

reply via email to

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