X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c3c51ec274f423cf8044cd5b9bc0bbc5bda1f6aa..4d36e5246e3d182b84f5d776e730a81e03fff06a:/lisp/progmodes/sh-script.el diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 524749d626..135f945dbb 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1,6 +1,6 @@ ;;; sh-script.el --- shell-script editing commands for Emacs -*- lexical-binding:t -*- -;; Copyright (C) 1993-1997, 1999, 2001-2014 Free Software Foundation, Inc. +;; Copyright (C) 1993-1997, 1999, 2001-2015 Free Software Foundation, Inc. ;; Author: Daniel Pfeiffer ;; Version: 2.0f @@ -1598,7 +1598,6 @@ buffer indents as it currently is indented. \\[backward-delete-char-untabify] Delete backward one position, even if it was a tab. -\\[newline-and-indent] Delete unquoted space and indent new line same as this one. \\[sh-end-of-command] Go to end of successive commands. \\[sh-beginning-of-command] Go to beginning of successive commands. \\[sh-set-shell] Set this buffer's shell, and maybe its magic number. @@ -2374,7 +2373,7 @@ Calls the value of `sh-set-shell-hook' if set." (sh-make-vars-local)) (message "Indentation setup for shell type %s" sh-shell)) (message "No indentation for this shell type.") - (setq indent-line-function 'sh-basic-indent-line)) + (setq-local indent-line-function 'sh-basic-indent-line)) (when font-lock-mode (setq font-lock-set-defaults nil) (font-lock-set-defaults) @@ -2500,7 +2499,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)