changeset 109996:d6074fc765a0

Avoid using font-lock properties to indent in sh-get-indent-info. * progmodes/sh-script.el (sh-get-indent-info): Use syntax-ppss instead of inspecting font-lock properties (Bug#6916).
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 26 Aug 2010 11:26:33 -0400
parents c3bbd8f2439e
children f583ffa8d0d6
files lisp/ChangeLog lisp/progmodes/sh-script.el
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Aug 26 09:46:19 2010 -0400
+++ b/lisp/ChangeLog	Thu Aug 26 11:26:33 2010 -0400
@@ -1,3 +1,8 @@
+2010-08-26  Daniel Colascione  <dan.colascione@gmail.com>
+
+	* progmodes/sh-script.el (sh-get-indent-info): Use syntax-ppss
+	instead of inspecting font-lock properties (Bug#6916).
+
 2010-08-26  David Reitter  <david.reitter@gmail.com>
 
 	* server.el (server-visit-files): Run pre-command-hook and
--- a/lisp/progmodes/sh-script.el	Thu Aug 26 09:46:19 2010 -0400
+++ b/lisp/progmodes/sh-script.el	Thu Aug 26 11:26:33 2010 -0400
@@ -2207,10 +2207,9 @@
       ;; 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)
 	(setq have-result t))
        ((looking-at "\\s-*#")		; was (equal this-kw "#")