Thanks for the report! It looks like pascal-mode didn't obey the rules for completion functions: they mustn't move point. Would you try these patches? The first should fix your bug, and the second deals with an apparent bug in C-M-a in pascal-mode found when fixing the first one.