summaryrefslogtreecommitdiff
path: root/src/abbrev.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2003-08-29 16:14:26 +0000
committerRichard M. Stallman <rms@gnu.org>2003-08-29 16:14:26 +0000
commitcc55c6fe79bf619c25bece59b4ee2cabb9f116e6 (patch)
treeb40c4756594dcffe5e599922a0f5556fdf29dd08 /src/abbrev.c
parenta175054da83c497edd882dacf7529890fa467b31 (diff)
downloademacs-cc55c6fe79bf619c25bece59b4ee2cabb9f116e6.tar.gz
(Fexpand_abbrev): Insert before deleting.
Diffstat (limited to 'src/abbrev.c')
-rw-r--r--src/abbrev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index dabc03b2a55..f6253f06ded 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -356,10 +356,13 @@ Returns the abbrev symbol, if expansion took place. */)
{
SET_PT (wordstart);
- del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1);
-
insert_from_string (expansion, 0, 0, SCHARS (expansion),
SBYTES (expansion), 1);
+ del_range_both (PT, PT_BYTE,
+ wordend + (PT - wordstart),
+ wordend_byte + (PT_BYTE - wordstart_byte),
+ 1);
+
SET_PT (PT + whitecnt);
if (uccount && !lccount)