unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Peter Oliver <lists.gnu.org@mavit.org.uk>
Cc: 18756-done@debbugs.gnu.org
Subject: bug#18756: 24.4; shell-script-mode does wrong indentation
Date: Tue, 06 Jan 2015 13:55:17 -0500	[thread overview]
Message-ID: <brfvbn91t6.fsf_-_@fencepost.gnu.org> (raw)
In-Reply-To: <CABmZtU4KZYSxY6HqP-UpLTHBO2NOGf75bd7Dr2dmxatn-P3FMQ@mail.gmail.com> (Peter Oliver's message of "Mon, 22 Dec 2014 20:34:49 +0000")

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)





      reply	other threads:[~2015-01-06 18:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 19:36 bug#18756: 24.4; shell-script-mode does wrong indentation Daniel Daboul
2014-10-17 22:35 ` Glenn Morris
2014-10-18 18:49   ` Daniel Daboul
2014-10-19 17:37     ` Glenn Morris
2014-10-19 18:35       ` Daniel Daboul
2014-10-20  5:35         ` Glenn Morris
2014-10-20 13:59           ` Alexis
2014-10-20 15:20             ` Eli Zaretskii
2014-10-20 16:13               ` Daniel Daboul
2014-10-22  1:01                 ` Alexis
2014-10-22  3:22                   ` Stefan Monnier
2014-10-22  3:37                     ` Alexis
2014-10-22 13:04                       ` Stefan Monnier
2014-10-25 19:20                         ` Daniel Daboul
2014-10-26  2:43                           ` Stefan Monnier
2014-12-04  8:06 ` Gilles Pion
2014-12-04 14:43   ` Stefan Monnier
2014-12-22 20:34 ` bug#18756: Peter Oliver
2015-01-06 18:55   ` Glenn Morris [this message]

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=brfvbn91t6.fsf_-_@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=18756-done@debbugs.gnu.org \
    --cc=lists.gnu.org@mavit.org.uk \
    /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).