aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/meta-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/meta-mode.el')
-rw-r--r--lisp/progmodes/meta-mode.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el
index 4d4ab2c8fb..984856b695 100644
--- a/lisp/progmodes/meta-mode.el
+++ b/lisp/progmodes/meta-mode.el
@@ -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)