Subject: Fwd: [PATCH] fix indent bug in sh-script

From: Daniel Colascione <[email-masked]>
Date: Wed, 25 Aug 2010 22:16:55 -0700

Modes should not inspect font-lock-controlled properties to control
indentation. This patch fixes one such problem in sh-script that caused
newline-and-indent to malfunction when invoked at the end of a line
ending in a string delimiter.

diff --git a/override/sh-script.el b/override/sh-script.el
index 610fa14..94973f0 100644
--- a/override/sh-script.el
+++ b/override/sh-script.el
@@ -2233,10 +2233,9 @@ STRING        This is ignored for the purposes of
calculating
       ;; Note: setting result to t means we are done and will return nil.
       ;;(This function never returns just t.)
       (cond
-       ((or (and (boundp 'font-lock-string-face) (not (bobp))
-                (eq (get-text-property (1- (point)) 'face)
-                    font-lock-string-face))
+       ((or (nth 3 (syntax-ppss (point)))
            (eq (get-text-property (point) 'face) sh-heredoc-face))
+        ;; String continuation -- don't indent
        (setq result t)