diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-08-12 12:16:00 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-08-12 12:16:00 -0400 |
commit | c1677234a35ac49ac1dd4276a19e90ac8e62b6e6 (patch) | |
tree | a973894016804e89a6394a4a66f8f03e019c8ee0 /lisp/mpc.el | |
parent | 9e6adaec872fb8274619ae117213431c4ff300f2 (diff) | |
download | emacs-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.el | 12 |
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)) |