Mercurial > emacs
comparison lisp/progmodes/meta-mode.el @ 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 | 3258c63732d1 |
children | 9b686572bf3f |
comparison
equal
deleted
inserted
replaced
84452:81f5348502a3 | 84453:7fda06536470 |
---|---|
650 (skip-chars-backward "\n\t\f ") | 650 (skip-chars-backward "\n\t\f ") |
651 (move-to-column (current-indentation)) | 651 (move-to-column (current-indentation)) |
652 ;; Ignore comments. | 652 ;; Ignore comments. |
653 (while (and (looking-at comment-start) (not (bobp))) | 653 (while (and (looking-at comment-start) (not (bobp))) |
654 (skip-chars-backward "\n\t\f ") | 654 (skip-chars-backward "\n\t\f ") |
655 (if (not (bobp)) | 655 (when (not (bobp)) |
656 (move-to-column (current-indentation))))) | 656 (move-to-column (current-indentation))))) |
657 | 657 |
658 (defun meta-indent-unfinished-line () | 658 (defun meta-indent-unfinished-line () |
659 "Tell if the current line of code ends with an unfinished expression." | 659 "Tell if the current line of code ends with an unfinished expression." |
660 (save-excursion | 660 (save-excursion |
661 (end-of-line) | 661 (end-of-line) |
662 ;; Skip backward the comments. | 662 ;; Skip backward the comments. |
663 (while (search-backward comment-start (point-at-bol) t)) | 663 (let ((point-not-in-string (point))) |
664 (while (search-backward comment-start (point-at-bol) t) | |
665 (unless (meta-indent-in-string-p) | |
666 (setq point-not-in-string (point)))) | |
667 (goto-char point-not-in-string)) | |
664 ;; Search for the end of the previous expression. | 668 ;; Search for the end of the previous expression. |
665 (if (search-backward ";" (point-at-bol) t) | 669 (if (search-backward ";" (point-at-bol) t) |
666 (progn (while (and (meta-indent-in-string-p) | 670 (progn (while (and (meta-indent-in-string-p) |
667 (search-backward ";" (point-at-bol) t))) | 671 (search-backward ";" (point-at-bol) t))) |
668 (if (= (char-after) ?\;) | 672 (if (= (char-after) ?\;) |