* Is that OK the way expand-abbrev moves point ?
@ 2009-07-25 11:15 Vincent Belaïche
2009-07-26 14:09 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Vincent Belaïche @ 2009-07-25 11:15 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]
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.
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
[-- Attachment #2: Type: text/html, Size: 1592 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is that OK the way expand-abbrev moves point ?
2009-07-25 11:15 Is that OK the way expand-abbrev moves point ? Vincent Belaïche
@ 2009-07-26 14:09 ` Stefan Monnier
2009-07-27 6:20 ` Vincent Belaïche
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2009-07-26 14:09 UTC (permalink / raw)
To: Vincent Belaïche; +Cc: emacs-devel
> 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:
This looks like a bug I fixed.
> My emacs version 23.0.60.1 (i386-mingw-nt5.0.2195)
This is ancient, please try the latest pretest to confirm it's fixed there,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Is that OK the way expand-abbrev moves point ?
2009-07-26 14:09 ` Stefan Monnier
@ 2009-07-27 6:20 ` Vincent Belaïche
2009-07-27 6:23 ` Vincent Belaïche
0 siblings, 1 reply; 5+ messages in thread
From: Vincent Belaïche @ 2009-07-27 6:20 UTC (permalink / raw)
To: monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
I tried with GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25
and it is still there.
Vincent.
PS: thanks again to Eli for assistance in building.
> From: monnier@iro.umontreal.ca
> To: vincent.b.1@hotmail.fr
> Date: Sun, 26 Jul 2009 10:09:20 -0400
> CC: emacs-devel@gnu.org
> Subject: Re: Is that OK the way expand-abbrev moves point ?
>
> > 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:
>
> This looks like a bug I fixed.
>
> > My emacs version 23.0.60.1 (i386-mingw-nt5.0.2195)
>
> This is ancient, please try the latest pretest to confirm it's fixed there,
>
>
> Stefan
>
>
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
[-- Attachment #2: Type: text/html, Size: 1425 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Is that OK the way expand-abbrev moves point ?
2009-07-27 6:20 ` Vincent Belaïche
@ 2009-07-27 6:23 ` Vincent Belaïche
2009-08-26 0:12 ` Vincent Belaïche
0 siblings, 1 reply; 5+ messages in thread
From: Vincent Belaïche @ 2009-07-27 6:23 UTC (permalink / raw)
To: monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]
FYI I have patched the visual-basic-mode.el that is on EmacsWiki to hide the problem (well I did not know whether it was a problem), to reproduce it you have to use this function:
(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))
From: vincent.b.1@hotmail.fr
To: monnier@iro.umontreal.ca
Date: Mon, 27 Jul 2009 08:20:27 +0200
CC: emacs-devel@gnu.org
Subject: RE: Is that OK the way expand-abbrev moves point ?
I tried with GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25
and it is still there.
Vincent.
PS: thanks again to Eli for assistance in building.
> From: monnier@iro.umontreal.ca
> To: vincent.b.1@hotmail.fr
> Date: Sun, 26 Jul 2009 10:09:20 -0400
> CC: emacs-devel@gnu.org
> Subject: Re: Is that OK the way expand-abbrev moves point ?
>
> > 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:
>
> This looks like a bug I fixed.
>
> > My emacs version 23.0.60.1 (i386-mingw-nt5.0.2195)
>
> This is ancient, please try the latest pretest to confirm it's fixed there,
>
>
> Stefan
>
>
Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement !
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
[-- Attachment #2: Type: text/html, Size: 2446 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Is that OK the way expand-abbrev moves point ?
2009-07-27 6:23 ` Vincent Belaïche
@ 2009-08-26 0:12 ` Vincent Belaïche
0 siblings, 0 replies; 5+ messages in thread
From: Vincent Belaïche @ 2009-08-26 0:12 UTC (permalink / raw)
To: monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2430 bytes --]
Hello Stefan,
By the way, as I already wrote: I tried with GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25
and the problem is still there.
Sorry if I missed your answer: what shall I do ? Do you want me to fill in a bug report ?
Vincent.
From: vincent.b.1@hotmail.fr
To: monnier@iro.umontreal.ca
Date: Mon, 27 Jul 2009 08:23:55 +0200
CC: emacs-devel@gnu.org
Subject: RE: Is that OK the way expand-abbrev moves point ?
FYI I have patched the visual-basic-mode.el that is on EmacsWiki to hide the problem (well I did not know whether it was a problem), to reproduce it you have to use this function:
(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))
From: vincent.b.1@hotmail.fr
To: monnier@iro.umontreal.ca
Date: Mon, 27 Jul 2009 08:20:27 +0200
CC: emacs-devel@gnu.org
Subject: RE: Is that OK the way expand-abbrev moves point ?
I tried with GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25
and it is still there.
Vincent.
PS: thanks again to Eli for assistance in building.
> From: monnier@iro.umontreal.ca
> To: vincent.b.1@hotmail.fr
> Date: Sun, 26 Jul 2009 10:09:20 -0400
> CC: emacs-devel@gnu.org
> Subject: Re: Is that OK the way expand-abbrev moves point ?
>
> > 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:
>
> This looks like a bug I fixed.
>
> > My emacs version 23.0.60.1 (i386-mingw-nt5.0.2195)
>
> This is ancient, please try the latest pretest to confirm it's fixed there,
>
>
> Stefan
>
>
Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement !
Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement !
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
[-- Attachment #2: Type: text/html, Size: 3308 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-26 0:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-25 11:15 Is that OK the way expand-abbrev moves point ? Vincent Belaïche
2009-07-26 14:09 ` Stefan Monnier
2009-07-27 6:20 ` Vincent Belaïche
2009-07-27 6:23 ` Vincent Belaïche
2009-08-26 0:12 ` Vincent Belaïche
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.