|
From: | Vincent Belaïche |
Subject: | Is that OK the way expand-abbrev moves point ? |
Date: | Sat, 25 Jul 2009 13:15:38 +0200 |
Dear EMACS experts I am currently writing some _vbscript_ code with http://www.emacswiki.org/cgi-bin/wiki/visual-basic-mode.el I noticed that function visual-basic-newline-and-indent (mapped to <RET>) has a strange behaviour sometimes and this is due to the way expand-abbrev works. Here is the code: (defun visual-basic-newline-and-indent (&optional count) "Insert a newline, updating indentation." (interactive) (expand-abbrev) (save-excursion (visual-basic-indent-line)) (call-interactively 'newline-and-indent)) If for instance I type <RET> after (--!-- showing point when I type <RET>): MyVar = MyFun(1,True)--!-- Then just after (expand-abbrev), point will be moved as follows: MyVar = MyFun(1,True--!--) because `True' is one abbreviation, so as a result I get this: MyVar = MyFun(1,True ) Which is unwanted. I can solve this very easilly locally to visual-basic-mode.el, by pushing the (expand-abbrev) into the (save-excursion ...) but I was wondering whether this is an issue or not that expand-abbrev behave this way. My emacs version 23.0.60.1 (i386-mingw-nt5.0.2195) Best regards, Vincent. Discutez sur Messenger où que vous soyez ! Mettez Messenger sur votre mobile ! |
[Prev in Thread] | Current Thread | [Next in Thread] |