]> git.eshelyaron.com Git - emacs.git/commitdiff
(meta-indent-unfinished-line): Do not say that a `%' in a string is
authorMichaël Cadilhac <michael.cadilhac@lrde.org>
Mon, 10 Sep 2007 17:25:58 +0000 (17:25 +0000)
committerMichaël Cadilhac <michael.cadilhac@lrde.org>
Mon, 10 Sep 2007 17:25:58 +0000 (17:25 +0000)
a comment-start.
(meta-indent-previous-line): Fix style.

lisp/ChangeLog
lisp/progmodes/meta-mode.el

index bc915b8ee0594f5375d918b3dd4fceafdd7f4ff2..c4e6741e4f41e992241354269d7db0456b981f5e 100644 (file)
@@ -5,6 +5,8 @@
        (meta-comment-indent, meta-indent-previous-line)
        (meta-indent-unfinished-line, meta-beginning-of-defun)
        (meta-end-of-defun, meta-common-initialization): Handle \f.
+       (meta-indent-unfinished-line): Do not handle a `%' in a string as
+       a comment-start.
 
        * files.el (file-modes-char-to-who, file-modes-char-to-right)
        (file-modes-rights-to-number): Auxiliary functions for symbolic to
index 4d4ab2c8fbf9840bbfb4152a163a96c470ca6d17..984856b6957b86186a72c25b71bec553cda87a3d 100644 (file)
@@ -652,15 +652,19 @@ If the list was changed, sort the list and remove duplicates first."
   ;; 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)