]> git.eshelyaron.com Git - emacs.git/commitdiff
(delphi-token-at): Give newlines precedence over literal tokens when
authorSimon South <ssouth@member.fsf.org>
Thu, 15 Jul 2010 02:34:47 +0000 (22:34 -0400)
committerSimon South <ssouth@member.fsf.org>
Thu, 15 Jul 2010 02:34:47 +0000 (22:34 -0400)
parsing so newlines aren't "absorbed" by single-line comments.
Corrects the indentation of case blocks that have a comment on the
first line.

lisp/ChangeLog
lisp/progmodes/delphi.el

index 13990c0320389cc82e9b54925ac8c0dcbd6f9626..32fa19c26a9618e08794716609d022539c24932f 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-15  Simon South  <ssouth@member.fsf.org>
+
+       * progmodes/delphi.el (delphi-token-at): Give newlines precedence
+       over literal tokens when parsing so newlines aren't "absorbed" by
+       single-line comments.  Corrects the indentation of case blocks
+       that have a comment on the first line.
+
 2010-07-14  Karl Fogel  <kfogel@red-bean.com>
 
        * bookmark.el (bookmark-load-hook): Fix doc string as suggested
index 1e5f1f506b3235806388ca1c55cbbfbbc282a304..03f74a42fd74628eae2af6f5fa9dbafc2f7db253 100644 (file)
@@ -628,7 +628,9 @@ routine.")
 (defun delphi-token-at (p)
   ;; Returns the token from parsing text at point p.
   (when (and (<= (point-min) p) (<= p (point-max)))
-     (cond ((delphi-literal-token-at p))
+     (cond ((delphi-char-token-at p ?\n 'newline))
+
+           ((delphi-literal-token-at p))
 
            ((delphi-space-token-at p))
 
@@ -638,7 +640,6 @@ routine.")
            ((delphi-char-token-at p ?\) 'close-group))
            ((delphi-char-token-at p ?\[ 'open-group))
            ((delphi-char-token-at p ?\] 'close-group))
-           ((delphi-char-token-at p ?\n 'newline))
            ((delphi-char-token-at p ?\; 'semicolon))
            ((delphi-char-token-at p ?. 'dot))
            ((delphi-char-token-at p ?, 'comma))