From f68cfe84eb26b05a429e968c5c78aac868e1a0c7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 5 Jun 2008 05:06:58 +0000 Subject: [PATCH] (unexpand-abbrev): Better preserve markers. --- lisp/ChangeLog | 4 ++++ lisp/abbrev.el | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a36517e9cee..59600dd747f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-06-05 Stefan Monnier + + * abbrev.el (unexpand-abbrev): Better preserve markers. + 2008-06-05 Glenn Morris * emacs-lisp/autoload.el (autoload-rubric): New function, diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 22c9ff40e3d..e8e89e92f40 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -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) -- 2.39.2