GNU bug report logs - #18756
24.4; shell-script-mode does wrong indentation

Previous Next

Package: emacs;

Reported by: Daniel Daboul <danieldaboul <at> gmail.com>

Date: Fri, 17 Oct 2014 19:56:02 UTC

Severity: normal

Tags: confirmed

Found in version 24.4

Fixed in version 24.5

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #63 received at 18756-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Peter Oliver <lists.gnu.org <at> mavit.org.uk>
Cc: 18756-done <at> debbugs.gnu.org
Subject: Re: bug#18756: 24.4; shell-script-mode does wrong indentation
Date: Tue, 06 Jan 2015 13:55:17 -0500
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."
 		    (current-column)))
 	current)
     (save-excursion
-      (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)))
 		     previous
 		   (if (< (current-column)
 			  (setq current (progn (back-to-indentation)




This bug report was last modified 10 years and 139 days ago.

Previous Next


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