# HG changeset patch # User Juanma Barranquero # Date 1049319473 0 # Node ID 180066f315b216ae180bb8097b852da8e0777e71 # Parent 9a2ca7beda84f4a2ad909d9c09b9c067d10c4ccc (sort-reorder-buffer): Fix saving of markers at the end of the sorted region. diff -r 9a2ca7beda84 -r 180066f315b2 lisp/sort.el --- a/lisp/sort.el Wed Apr 02 21:24:56 2003 +0000 +++ b/lisp/sort.el Wed Apr 02 21:37:53 2003 +0000 @@ -192,16 +192,13 @@ (set-buffer old-buffer) (let ((inhibit-quit t)) ;; Make sure insertions done for reordering - ;; do not go after any markers at the end of the sorted region, - ;; by inserting a space to separate them. - (goto-char max) - (insert-before-markers " ") - ;; Delete the original copy of the text. - (delete-region min max) - ;; Now replace the separator " " with the sorted text. - (goto-char (point-max)) + ;; saves any markers at the end of the sorted region, + ;; by leaving the last character of the region. + (delete-region min (1- max)) + ;; Now replace the one remaining old character with the sorted text. + (goto-char (point-min)) (insert-buffer-substring temp-buffer) - (delete-region min (1+ min)))))) + (delete-region max (1+ max)))))) ;;;###autoload (defun sort-lines (reverse beg end)