emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117696: * lisp/mpc.el (mpc-reorder): Don't bother s


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117696: * lisp/mpc.el (mpc-reorder): Don't bother splitting the "active" elements
Date: Tue, 12 Aug 2014 16:16:06 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117696
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2014-08-12 12:16:00 -0400
message:
  * lisp/mpc.el (mpc-reorder): Don't bother splitting the "active" elements
  to the first part if they're the same as the selection.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/mpc.el                    mpc.el-20091201190351-ubdosyf8lle4bzd3-10
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-08-12 14:16:45 +0000
+++ b/lisp/ChangeLog    2014-08-12 16:16:00 +0000
@@ -1,3 +1,8 @@
+2014-08-12  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        * image-mode.el (image-transform-reset): New command and menu item.
@@ -2080,9 +2085,9 @@
 2014-05-30  Alan Mackenzie  <address@hidden>
 
        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  <address@hidden>  (tiny change)
+2014-05-30    Ken Olum  <address@hidden>
 
        * mail/rmail.el (rmail-delete-forward, rmail-delete-backward):
        The argument COUNT is now optional, to be more backward-compatible.

=== modified file 'lisp/mpc.el'
--- a/lisp/mpc.el       2014-05-12 13:25:53 +0000
+++ b/lisp/mpc.el       2014-08-12 16:16:00 +0000
@@ -1624,7 +1624,7 @@
           (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 @@
               (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))


reply via email to

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