emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5206596ea7 2/2: Make sorting not change buffer modification statu


From: Lars Ingebrigtsen
Subject: master 5206596ea7 2/2: Make sorting not change buffer modification status always
Date: Tue, 3 May 2022 15:26:35 -0400 (EDT)

branch: master
commit 5206596ea7b26e2e9705e4c94184f6d22687c385
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/sort.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/sort.el b/lisp/sort.el
index 90eee01caf..d04f075abd 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)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]