Make sorting not change buffer modification status always
* lisp/sort.el (sort-subr): Don't mark buffer modified if the sorting didn't change anything (bug#4587).
This commit is contained in:
parent
59353ec7b5
commit
5206596ea7
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue