diff options
author | Michaël Cadilhac <michael.cadilhac@lrde.org> | 2007-09-10 17:25:58 +0000 |
---|---|---|
committer | Michaël Cadilhac <michael.cadilhac@lrde.org> | 2007-09-10 17:25:58 +0000 |
commit | ebd3fa6bc82283df585963007934b70993b50e05 (patch) | |
tree | b357307c7c98c9f9bc4b3b65e28be68a9ca19a18 /lisp/progmodes/meta-mode.el | |
parent | 89c19c1eb7315ee885add1c570ccfc84a74e396c (diff) | |
download | emacs-ebd3fa6bc82283df585963007934b70993b50e05.tar.gz |
(meta-indent-unfinished-line): Do not say that a `%' in a string is
a comment-start.
(meta-indent-previous-line): Fix style.
Diffstat (limited to 'lisp/progmodes/meta-mode.el')
-rw-r--r-- | lisp/progmodes/meta-mode.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 4d4ab2c8fbf..984856b6957 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) |