* bug#4356: 23.1.50; expand-abbrev changes point erroneously
@ 2009-09-06 10:30 Vincent Belaïche
2009-09-16 2:46 ` Stefan Monnier
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Belaïche @ 2009-09-06 10:30 UTC (permalink / raw
To: emacs-pretest-bug
Here is the bug description. I found this editing some Visual Basic file
with using http://www.emacswiki.org/emacs/visual-basic-mode.el
If for instance I type <RET> after (--!-- showing point when I type <RET>):
MyVar = MyFun(1,True)--!--
Then in visual basic mode visual-basic-newline-and-indent is called,
which in turn calls (expand-abbrev). After (expand-abbrev) is called,
point will be moved as follows:
MyVar = MyFun(1,True--!--)
because `True' is one abbreviation. I have patched visual-basic mode, so
that a save-excursion encloses the call of expand-abbrev, otherwise I
would get:
MyVar = MyFun(1,True
--!--)
which is not wanted. Stefan Monnier (monnier@IRO.UMontreal.CA) confirmed
this is a bug of expand-abbrev, and asked me to repport it.
The wanted behaviour would be that after expanding `True', point would
come back to after the `)' where it originally was.
BR,
Vincent.
-----------------------------------------------------------------------
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
d:/Programme/GNU/Emacs/etc/DEBUG for instructions.
In GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195)
of 2009-07-25 on COCOTTE
Windowing system distributor `Microsoft Corp.', version 5.0.2195
configured using `configure --with-gcc (3.4)'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: FRA
value of $XMODIFIERS: nil
locale-coding-system: cp1252
default-enable-multibyte-characters: t
Major mode: Lisp Interaction
Minor modes in effect:
recentf-mode: t
mail-abbrevs-mode: t
iswitchb-mode: t
tooltip-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<left> <return> C-x 1 <down> <down> C-SPC <end> <left>
<C-insert> C-x b * s c <tab> ( r e q u i r e SPC '
c a l c - e x t ) <return> ( l a t SPC ( <backspace>
<backspace> <backspace> <backspace> e t SPC ( c a l
c - c o m m a n d ) <C-left> <C-left> C-h f C-g C-h
v c a l c - c <tab> o <tab> <backspace> <backspace>
<backspace> <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> C-g <end> <return> <tab> (
c a l c - r a d i x SPC 1 <backspace> 7 ) <return>
<tab> ( c a l c - e v a l SPC 1 0 à ) <backspace> <backspace>
) <left> <left> <left> " " SPC <left> <left> $ <end>
) M-x e v a l - b u f <tab> <return> C-x C-e <C-left>
<C-left> <C-left> C-h f <return> C-h i m d <backspace>
c a l <tab> <return> C-x 1 <C-end> <up> <up> <up> <up>
<up> <up> <right> <right> <right> <down> <return> C-s
c a l c <kp-subtract> e v <C-end> <up> <C-home> m e
v a l <return> C-x b <return> <end> <C-left> <C-left>
<C-right> <right> <right> <delete> <kp-1> <kp-0> <right>
<delete> <delete> <delete> <end> C-x C-e <up> <up>
<up> <down> <up> <return> C-y <up> <home> C-k C-k <down>
<up> <tab> <down> C-k C-k C-k C-k <tab> <end> <backspace>
<home> ( m e s s a g z e SPC <backspace> <backspace>
<backspace> e SPC " 1 0 SPC e n SPC b a s e SPC 7 =
% s " SPC <end> ) M-x <up> <return> <up> <up> <home>
C-SPC <C-end> <C-insert> <help-echo> M-x r e p o r
<tab> b <tab> <tab> e m <tab> <return>
Recent messages:
Composing main Info directory...done
Mark set
Mark saved where search started
Mark set [2 times]
Number radix is 7
"7#13"
Mark set
10 en base 7=7#13
Mark set
Making completion list...
Load-path shadows:
d:/Programme/GNU/emacs-extension/cedet/speedbar/speedbar hides d:/Programme/GNU/Emacs/lisp/speedbar
d:/Programme/GNU/emacs-extension/cedet/speedbar/sb-image hides d:/Programme/GNU/Emacs/lisp/sb-image
d:/Programme/GNU/emacs-extension/cedet/common/ezimage hides d:/Programme/GNU/Emacs/lisp/ezimage
d:/Programme/GNU/emacs-extension/cedet/speedbar/dframe hides d:/Programme/GNU/Emacs/lisp/dframe
c:/Documents and Settings/Vincent/Application Data/.emacs.d/etc/custom hides d:/Programme/GNU/Emacs/lisp/custom
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#4356: 23.1.50; expand-abbrev changes point erroneously
2009-09-06 10:30 bug#4356: 23.1.50; expand-abbrev changes point erroneously Vincent Belaïche
@ 2009-09-16 2:46 ` Stefan Monnier
2011-10-06 3:52 ` Glenn Morris
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2009-09-16 2:46 UTC (permalink / raw
To: Vincent Belaïche; +Cc: 4356
> Here is the bug description. I found this editing some Visual Basic file
> with using http://www.emacswiki.org/emacs/visual-basic-mode.el
> If for instance I type <RET> after (--!-- showing point when I type <RET>):
> MyVar = MyFun(1,True)--!--
> Then in visual basic mode visual-basic-newline-and-indent is called,
> which in turn calls (expand-abbrev). After (expand-abbrev) is called,
> point will be moved as follows:
> MyVar = MyFun(1,True--!--)
> because `True' is one abbreviation. I have patched visual-basic mode, so
> that a save-excursion encloses the call of expand-abbrev, otherwise I
> would get:
> MyVar = MyFun(1,True
> --!--)
> which is not wanted. Stefan Monnier (monnier@IRO.UMontreal.CA) confirmed
> this is a bug of expand-abbrev, and asked me to repport it.
> The wanted behaviour would be that after expanding `True', point would
> come back to after the `)' where it originally was.
Having looked into it some more, I'm not 100% convinced it's a bug
any more. Here's why:
`expand-abbrev' may run arbitrary code, and some abbrevs don't just
replace text with something else but also prompt and/or move point
(e.g. skeletons). So running expand-abbrev from
visual-basic-newline-and-indent just doesn't sound right since it may
conflict with user-defined abbreviations.
I.e. the problem you're seeing can also happen in Emacs-22 depending on
the user's own abbreviations. So the VBM code either needs
a save-excursion, or needs to refrain from calling expand-abbrev from
visual-basic-newline-and-indent.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#4356: 23.1.50; expand-abbrev changes point erroneously
2009-09-16 2:46 ` Stefan Monnier
@ 2011-10-06 3:52 ` Glenn Morris
0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2011-10-06 3:52 UTC (permalink / raw
To: 4356-done
tags 4356 wontfix
stop
Closing based on this:
> Having looked into it some more, I'm not 100% convinced it's a bug
> any more. Here's why:
>
> `expand-abbrev' may run arbitrary code, and some abbrevs don't just
> replace text with something else but also prompt and/or move point
> (e.g. skeletons). So running expand-abbrev from
> visual-basic-newline-and-indent just doesn't sound right since it may
> conflict with user-defined abbreviations.
>
> I.e. the problem you're seeing can also happen in Emacs-22 depending on
> the user's own abbreviations. So the VBM code either needs
> a save-excursion, or needs to refrain from calling expand-abbrev from
> visual-basic-newline-and-indent.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-06 3:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-06 10:30 bug#4356: 23.1.50; expand-abbrev changes point erroneously Vincent Belaïche
2009-09-16 2:46 ` Stefan Monnier
2011-10-06 3:52 ` Glenn Morris
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.