Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Refactor] Move smex-sort-according-to-cache to the appropriate section

  • Loading branch information...
commit c05ec70cfb60f689ea0acd224bef575fb9ce5b7d 1 parent 3481b72
@nonsequitur authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 smex.el
View
18 smex.el
@@ -182,6 +182,15 @@ Must be set before initializing Smex."
(setq smex-cache command-cell))))))
(reverse smex-history)))
+(defun smex-sort-according-to-cache (list)
+ (let (sorted)
+ (dolist (command-item smex-cache)
+ (let ((command (car command-item)))
+ (when (memq command list)
+ (setq sorted (cons command sorted))
+ (setq list (delq command list)))))
+ (nreverse (append list sorted))))
+
(defun smex-update ()
(interactive)
(smex-save-history)
@@ -437,15 +446,6 @@ Returns nil when reaching the end of the list."
(setq commands (append commands (list function))))))))))
commands))
-(defun smex-sort-according-to-cache (list)
- (let (sorted)
- (dolist (command-item smex-cache)
- (let ((command (car command-item)))
- (when (memq command list)
- (setq sorted (cons command sorted))
- (setq list (delq command list)))))
- (nreverse (append list sorted))))
-
(defun smex-show-unbound-commands ()
"Shows unbound commands in a new buffer,
sorted by frequency of use."
Please sign in to comment.
Something went wrong with that request. Please try again.