diff lisp/abbrev.el @ 95571:49efb79bb63b

(unexpand-abbrev): Better preserve markers.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 05 Jun 2008 05:06:58 +0000
parents 67bcaf883753
children 8ed760341617
line wrap: on
line diff
--- a/lisp/abbrev.el	Thu Jun 05 04:56:02 2008 +0000
+++ b/lisp/abbrev.el	Thu Jun 05 05:06:58 2008 +0000
@@ -824,10 +824,11 @@
         ;; to do the expansion.
         (let ((val (symbol-value last-abbrev)))
           (unless (stringp val)
-            (error "value of abbrev-symbol must be a string"))
-          (delete-region (point) (+ (point) (length val)))
+            (error "Value of abbrev-symbol must be a string"))
           ;; Don't inherit properties here; just copy from old contents.
           (insert last-abbrev-text)
+          ;; Delete after inserting, to better preserve markers.
+          (delete-region (point) (+ (point) (length val)))
           (setq last-abbrev-text nil))))))
 
 (defun abbrev--write (sym)