summaryrefslogtreecommitdiff
path: root/lisp/mpc.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-08-12 12:16:00 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-08-12 12:16:00 -0400
commitc1677234a35ac49ac1dd4276a19e90ac8e62b6e6 (patch)
treea973894016804e89a6394a4a66f8f03e019c8ee0 /lisp/mpc.el
parent9e6adaec872fb8274619ae117213431c4ff300f2 (diff)
downloademacs-c1677234a35ac49ac1dd4276a19e90ac8e62b6e6.tar.gz
emacs-c1677234a35ac49ac1dd4276a19e90ac8e62b6e6.tar.bz2
emacs-c1677234a35ac49ac1dd4276a19e90ac8e62b6e6.zip
* lisp/mpc.el (mpc-reorder): Don't bother splitting the "active" elements
to the first part if they're the same as the selection.
Diffstat (limited to 'lisp/mpc.el')
-rw-r--r--lisp/mpc.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el
index d03edf86bba..ab3fd6e7518 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -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))