]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fexpand_abbrev): Insert before deleting.
authorRichard M. Stallman <rms@gnu.org>
Fri, 29 Aug 2003 16:14:26 +0000 (16:14 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 29 Aug 2003 16:14:26 +0000 (16:14 +0000)
src/abbrev.c

index dabc03b2a556f915693caf7971b4f19c39a77543..f6253f06ded6a9facd878dbc9641ec123fbfdedc 100644 (file)
@@ -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)