(unexpand-abbrev): Better preserve markers.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Jun 2008 05:06:58 +0000 (05:06 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 5 Jun 2008 05:06:58 +0000 (05:06 +0000)
lisp/ChangeLog
lisp/abbrev.el

index a36517e..59600dd 100644 (file)
@@ -1,3 +1,7 @@
+2008-06-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * abbrev.el (unexpand-abbrev): Better preserve markers.
+
 2008-06-05  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/autoload.el (autoload-rubric): New function,
index 22c9ff4..e8e89e9 100644 (file)
@@ -824,10 +824,11 @@ is not undone."
         ;; 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)