diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-07-04 09:30:22 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-07-04 09:30:22 +0200 |
commit | a06c5bd489811993f85efbefc845499469b096fb (patch) | |
tree | a1771264e5bac38bb6047c87653bc7cfd843cdf7 /helm-bookmark.el | |
parent | 151ae12d7048934b58cf3ff0afe2262208dbd07d (diff) |
Modify helm-bookmark find-files in a different way.
* helm-bookmark.el (helm-bookmark-overwrite-inheritor): Fake class
used to overwrite type class.
(helm--setup-source): Setup here actions and keymap for ff.
(helm-bookmark-find-files-class): Inherit from helm-bookmark-overwrite-inheritor
to overwrite action and keymap.
(helm-source-bookmark-helm-find-files): Use new class.
* helm-types.el (helm--setup-source): Restore as before.
Diffstat (limited to 'helm-bookmark.el')
-rw-r--r-- | helm-bookmark.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/helm-bookmark.el b/helm-bookmark.el index dce15f91..125e615c 100644 --- a/helm-bookmark.el +++ b/helm-bookmark.el @@ -479,8 +479,21 @@ than `w3m-browse-url' use it." (define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project) map)) +(defclass helm-bookmark-overwrite-inheritor (helm-source) ()) + +(defmethod helm--setup-source ((source helm-bookmark-overwrite-inheritor)) + (setf (slot-value source 'action) + (helm-append-at-nth + helm-type-bookmark-actions + '(("Browse project" . helm-bookmark-browse-project)) 1)) + (setf (slot-value source 'keymap) helm-bookmark-find-files-map)) + +(defclass helm-bookmark-find-files-class (helm-source-filtered-bookmarks + helm-bookmark-overwrite-inheritor) + ()) + (defvar helm-source-bookmark-helm-find-files - (helm-make-source "Bookmark helm-find-files sessions" 'helm-source-filtered-bookmarks + (helm-make-source "Bookmark helm-find-files sessions" 'helm-bookmark-find-files-class :init (lambda () (bookmark-maybe-load-default-file) (helm-init-candidates-in-buffer |