diff options
-rw-r--r-- | helm-bookmark.el | 15 | ||||
-rw-r--r-- | helm-types.el | 11 |
2 files changed, 16 insertions, 10 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 diff --git a/helm-types.el b/helm-types.el index 5b5fb4ee..fcf8f489 100644 --- a/helm-types.el +++ b/helm-types.el @@ -111,15 +111,8 @@ (defmethod helm--setup-source :primary ((_source helm-type-bookmark))) (defmethod helm--setup-source :before ((source helm-type-bookmark)) - (if (string= (slot-value source 'name) "Bookmark helm-find-files sessions") - (progn - (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)) - (setf (slot-value source 'action) 'helm-type-bookmark-actions) - (setf (slot-value source 'keymap) helm-bookmark-map)) + (setf (slot-value source 'action) 'helm-type-bookmark-actions) + (setf (slot-value source 'keymap) helm-bookmark-map) (setf (slot-value source 'mode-line) (list "Bookmark(s)" helm-mode-line-string)) (setf (slot-value source 'help-message) 'helm-bookmark-help-message) (setf (slot-value source 'migemo) t)) |