From a11b38eea2c4a15ecdaa29dcb66161e9d1143c05 Mon Sep 17 00:00:00 2001 From: Simon South Date: Wed, 14 Jul 2010 22:34:47 -0400 Subject: [PATCH] (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. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/delphi.el | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 13990c03203..32fa19c26a9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2010-07-15 Simon South + + * 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 * bookmark.el (bookmark-load-hook): Fix doc string as suggested diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index 1e5f1f506b3..03f74a42fd7 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el @@ -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)) -- 2.39.2