diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-07-03 13:48:20 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2018-07-03 13:48:20 +0200 |
commit | 0ddf76b8a080f9e2ce9e367bb3bcae4e742bffbb (patch) | |
tree | 060adcc38e08c19cab23670732ddc803ad7359e4 /helm.el | |
parent | 350ecaba61b9aedadf9eba4d46aac89f2aa6a76c (diff) |
Rename and rewrite helm--recent-push
* helm.el (helm-initialize): Use it.
(helm--push-and-remove-dups): Renamed from helm--recent-push, and rewrite.
Diffstat (limited to 'helm.el')
-rw-r--r-- | helm.el | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -2977,7 +2977,7 @@ For ANY-RESUME ANY-INPUT ANY-DEFAULT and ANY-SOURCES See `helm'." (helm-initial-setup any-default sources)) (setq helm-alive-p t) (unless (eq any-resume 'noresume) - (helm--recent-push helm-buffer 'helm-buffers) + (helm--push-and-remove-dups helm-buffer 'helm-buffers) (setq helm-last-buffer helm-buffer)) (when any-input (setq helm-input any-input @@ -3007,12 +3007,9 @@ For ANY-RESUME ANY-INPUT ANY-DEFAULT and ANY-SOURCES See `helm'." "Restore position in `helm-current-buffer' when quitting." (helm-current-position 'restore)) -(defun helm--recent-push (elm sym) +(defun helm--push-and-remove-dups (elm sym) "Move ELM of SYM value on top and set SYM to this new value." - (pcase (symbol-value sym) - ((and (pred (member elm)) l) - (set sym (delete elm l)))) - (push elm (symbol-value sym))) + (set sym (cons elm (delete elm (symbol-value sym))))) (defun helm--current-buffer () "[internal] Return `current-buffer' BEFORE `helm-buffer' is initialized. |