]> code.delx.au - gnu-emacs/commitdiff
* lisp/mpc.el (mpc-reorder): Don't bother splitting the "active" elements
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Aug 2014 16:16:00 +0000 (12:16 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Aug 2014 16:16:00 +0000 (12:16 -0400)
to the first part if they're the same as the selection.

lisp/ChangeLog
lisp/mpc.el

index 10b17d63119a120dc3cdc8b8252132fa10a60aeb..7bb7415bc9c1d2bb7d56275581eaeff9ab640a2a 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * mpc.el (mpc-reorder): Don't bother splitting the "active"s elements
+       to the first part if they're the same as the selection.
+
 2014-08-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * image-mode.el (image-transform-reset): New command and menu item.
 2014-05-30  Alan Mackenzie  <acm@muc.de>
 
        Guard (looking-at "\\s!") from XEmacs.
-       * progmodes/cc-engine.el (c-state-pp-to-literal): add guard form.
+       * progmodes/cc-engine.el (c-state-pp-to-literal): Add guard form.
 
-2014-05-30    Ken Olum  <kdo@cosmos.phy.tufts.edu>  (tiny change)
+2014-05-30    Ken Olum  <kdo@cosmos.phy.tufts.edu>
 
        * mail/rmail.el (rmail-delete-forward, rmail-delete-backward):
        The argument COUNT is now optional, to be more backward-compatible.
index d03edf86bbac88098a658d429c0d9d43832f46a3..ab3fd6e7518e8dcf4c797a5251580bc0db7dffeb 100644 (file)
@@ -1624,7 +1624,7 @@ Return non-nil if a selection was deactivated."
           (setq active
                 (if (listp active) (mpc-intersection active vals) vals))))
 
-      (when (and (listp active))
+      (when (listp active)
         ;; Remove the selections if they are all in conflict with
         ;; other constraints.
         (let ((deactivate t))
@@ -1638,8 +1638,14 @@ Return non-nil if a selection was deactivated."
               (setq selection nil)
               (mapc 'delete-overlay mpc-select)
               (setq mpc-select nil)
-              (mpc-tagbrowser-all-select)))))
-
+              (mpc-tagbrowser-all-select))))
+
+        ;; Don't bother splitting the "active" elements to the first part if
+        ;; they're the same as the selection.
+        (when (equal (sort (copy-sequence active) #'string-lessp)
+                     (sort (copy-sequence selection) #'string-lessp))
+          (setq active 'all)))
+      
       ;; FIXME: This `mpc-sort' takes a lot of time.  Maybe we should
       ;; be more clever and presume the buffer is mostly sorted already.
       (mpc-sort (if (listp active) active))