diff options
| author | Stefan Monnier | 2008-06-05 05:06:58 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-05 05:06:58 +0000 |
| commit | f68cfe84eb26b05a429e968c5c78aac868e1a0c7 (patch) | |
| tree | 1112f67769de0223e32da6b06aa3428e9e04d879 | |
| parent | ca2b2cde493cf4c23fc979345f9652c8a90add02 (diff) | |
| download | emacs-f68cfe84eb26b05a429e968c5c78aac868e1a0c7.tar.gz emacs-f68cfe84eb26b05a429e968c5c78aac868e1a0c7.zip | |
(unexpand-abbrev): Better preserve markers.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2008-06-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * abbrev.el (unexpand-abbrev): Better preserve markers. | ||
| 4 | |||
| 1 | 2008-06-05 Glenn Morris <rgm@gnu.org> | 5 | 2008-06-05 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * emacs-lisp/autoload.el (autoload-rubric): New function, | 7 | * 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." | |||
| 824 | ;; to do the expansion. | 824 | ;; to do the expansion. |
| 825 | (let ((val (symbol-value last-abbrev))) | 825 | (let ((val (symbol-value last-abbrev))) |
| 826 | (unless (stringp val) | 826 | (unless (stringp val) |
| 827 | (error "value of abbrev-symbol must be a string")) | 827 | (error "Value of abbrev-symbol must be a string")) |
| 828 | (delete-region (point) (+ (point) (length val))) | ||
| 829 | ;; Don't inherit properties here; just copy from old contents. | 828 | ;; Don't inherit properties here; just copy from old contents. |
| 830 | (insert last-abbrev-text) | 829 | (insert last-abbrev-text) |
| 830 | ;; Delete after inserting, to better preserve markers. | ||
| 831 | (delete-region (point) (+ (point) (length val))) | ||
| 831 | (setq last-abbrev-text nil)))))) | 832 | (setq last-abbrev-text nil)))))) |
| 832 | 833 | ||
| 833 | (defun abbrev--write (sym) | 834 | (defun abbrev--write (sym) |