summaryrefslogtreecommitdiff
path: root/lisp/sort.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2003-04-02 21:37:53 +0000
committerJuanma Barranquero <lekktu@gmail.com>2003-04-02 21:37:53 +0000
commit9b3922840e9b617bed9dc5cad72bb9d7e387b34e (patch)
tree26501bfcd20aa5e19b28cb935d52eb62a91126d6 /lisp/sort.el
parenta5393da851536d7894f35821f2cb9a68ba80bbf6 (diff)
downloademacs-9b3922840e9b617bed9dc5cad72bb9d7e387b34e.tar.gz
(sort-reorder-buffer): Fix saving of markers at the end of the sorted region.
Diffstat (limited to 'lisp/sort.el')
-rw-r--r--lisp/sort.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index 84a2f9eec81..f0b21cadaa4 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -192,16 +192,13 @@ same as ENDRECFUN."
(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)