summaryrefslogtreecommitdiff
path: root/lisp/sort.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/sort.el')
-rw-r--r--lisp/sort.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index 90eee01caf4..d04f075abd1 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -29,6 +29,8 @@
;;; Code:
+(eval-when-compile (require 'subr-x))
+
(defgroup sort nil
"Commands to sort text in an Emacs buffer."
:group 'data)
@@ -111,7 +113,8 @@ as start and end positions), and with `string<' otherwise."
(lambda (a b) (string< (car a) (car b)))))))
(if reverse (setq sort-lists (nreverse sort-lists)))
(if messages (message "Reordering buffer..."))
- (sort-reorder-buffer sort-lists old)))
+ (with-buffer-unmodified-if-unchanged
+ (sort-reorder-buffer sort-lists old))))
(if messages (message "Reordering buffer... Done"))))
nil)