aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaël Cadilhac2007-09-10 17:25:58 +0000
committerMichaël Cadilhac2007-09-10 17:25:58 +0000
commitebd3fa6bc82283df585963007934b70993b50e05 (patch)
treeb357307c7c98c9f9bc4b3b65e28be68a9ca19a18
parent89c19c1eb7315ee885add1c570ccfc84a74e396c (diff)
downloademacs-ebd3fa6bc82283df585963007934b70993b50e05.tar.gz
emacs-ebd3fa6bc82283df585963007934b70993b50e05.zip
(meta-indent-unfinished-line): Do not say that a `%' in a string is
a comment-start. (meta-indent-previous-line): Fix style.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/progmodes/meta-mode.el10
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bc915b8ee05..c4e6741e4f4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5,6 +5,8 @@
5 (meta-comment-indent, meta-indent-previous-line) 5 (meta-comment-indent, meta-indent-previous-line)
6 (meta-indent-unfinished-line, meta-beginning-of-defun) 6 (meta-indent-unfinished-line, meta-beginning-of-defun)
7 (meta-end-of-defun, meta-common-initialization): Handle \f. 7 (meta-end-of-defun, meta-common-initialization): Handle \f.
8 (meta-indent-unfinished-line): Do not handle a `%' in a string as
9 a comment-start.
8 10
9 * files.el (file-modes-char-to-who, file-modes-char-to-right) 11 * files.el (file-modes-char-to-who, file-modes-char-to-right)
10 (file-modes-rights-to-number): Auxiliary functions for symbolic to 12 (file-modes-rights-to-number): Auxiliary functions for symbolic to
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."
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)