changeset 84453:7fda06536470

(meta-indent-unfinished-line): Do not say that a `%' in a string is a comment-start. (meta-indent-previous-line): Fix style.
author Michaël Cadilhac <michael.cadilhac@lrde.org>
date Mon, 10 Sep 2007 17:25:48 +0000
parents 81f5348502a3
children 371bf4ba333b
files lisp/progmodes/meta-mode.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/meta-mode.el	Mon Sep 10 14:21:31 2007 +0000
+++ b/lisp/progmodes/meta-mode.el	Mon Sep 10 17:25:48 2007 +0000
@@ -652,15 +652,19 @@
   ;; Ignore comments.
   (while (and (looking-at comment-start) (not (bobp)))
     (skip-chars-backward "\n\t\f ")
-    (if (not (bobp))
-	(move-to-column (current-indentation)))))
+    (when (not (bobp))
+      (move-to-column (current-indentation)))))
 
 (defun meta-indent-unfinished-line ()
   "Tell if the current line of code ends with an unfinished expression."
   (save-excursion
     (end-of-line)
     ;; Skip backward the comments.
-    (while (search-backward comment-start (point-at-bol) t))
+    (let ((point-not-in-string (point)))
+      (while (search-backward comment-start (point-at-bol) t)
+	(unless (meta-indent-in-string-p)
+	  (setq point-not-in-string (point))))
+      (goto-char point-not-in-string))
     ;; Search for the end of the previous expression.
     (if (search-backward ";" (point-at-bol) t)
 	(progn (while (and (meta-indent-in-string-p)