diff options
| author | Juanma Barranquero | 2003-04-02 21:37:53 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-04-02 21:37:53 +0000 |
| commit | 9b3922840e9b617bed9dc5cad72bb9d7e387b34e (patch) | |
| tree | 26501bfcd20aa5e19b28cb935d52eb62a91126d6 | |
| parent | a5393da851536d7894f35821f2cb9a68ba80bbf6 (diff) | |
| download | emacs-9b3922840e9b617bed9dc5cad72bb9d7e387b34e.tar.gz emacs-9b3922840e9b617bed9dc5cad72bb9d7e387b34e.zip | |
(sort-reorder-buffer): Fix saving of markers at the end of the sorted region.
| -rw-r--r-- | lisp/sort.el | 15 |
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." | |||
| 192 | (set-buffer old-buffer) | 192 | (set-buffer old-buffer) |
| 193 | (let ((inhibit-quit t)) | 193 | (let ((inhibit-quit t)) |
| 194 | ;; Make sure insertions done for reordering | 194 | ;; Make sure insertions done for reordering |
| 195 | ;; do not go after any markers at the end of the sorted region, | 195 | ;; saves any markers at the end of the sorted region, |
| 196 | ;; by inserting a space to separate them. | 196 | ;; by leaving the last character of the region. |
| 197 | (goto-char max) | 197 | (delete-region min (1- max)) |
| 198 | (insert-before-markers " ") | 198 | ;; Now replace the one remaining old character with the sorted text. |
| 199 | ;; Delete the original copy of the text. | 199 | (goto-char (point-min)) |
| 200 | (delete-region min max) | ||
| 201 | ;; Now replace the separator " " with the sorted text. | ||
| 202 | (goto-char (point-max)) | ||
| 203 | (insert-buffer-substring temp-buffer) | 200 | (insert-buffer-substring temp-buffer) |
| 204 | (delete-region min (1+ min)))))) | 201 | (delete-region max (1+ max)))))) |
| 205 | 202 | ||
| 206 | ;;;###autoload | 203 | ;;;###autoload |
| 207 | (defun sort-lines (reverse beg end) | 204 | (defun sort-lines (reverse beg end) |