summaryrefslogtreecommitdiff
path: root/helm-bookmark.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-07-03 07:08:22 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-07-03 07:17:19 +0200
commit151ae12d7048934b58cf3ff0afe2262208dbd07d (patch)
tree45adfa31d334b846ad8791475877fffe9b548a22 /helm-bookmark.el
parentac41a4755939ace3821d29138dc00e784bc52951 (diff)
Add binding for *browse-project in bookmarks.
* helm-bookmark.el (helm-bookmark-browse-project): Moved from lambda. (helm-bookmark-run-browse-project): New. (helm-bookmark-find-files-map): New keymap. * helm-types.el (helm--setup-source): Use the hff keymap when needed.
Diffstat (limited to 'helm-bookmark.el')
-rw-r--r--helm-bookmark.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/helm-bookmark.el b/helm-bookmark.el
index 84dfd138..dce15f91 100644
--- a/helm-bookmark.el
+++ b/helm-bookmark.el
@@ -30,6 +30,7 @@
(declare-function message-buffers "message.el")
(declare-function addressbook-set-mail-buffer-1 "ext:addressbook-bookmark.el"
(&optional bookmark-name append cc))
+(declare-function helm-browse-project "helm-files" (arg))
(defgroup helm-bookmark nil
@@ -459,6 +460,25 @@ than `w3m-browse-url' use it."
"Specialized filter function for `helm-find-files' bookmarks."
(helm-bookmark-filter-setup-alist 'helm-bookmark-helm-find-files-p))
+(defun helm-bookmark-browse-project (candidate)
+ "Run `helm-browse-project' from action."
+ (with-helm-default-directory
+ (bookmark-get-filename candidate)
+ (helm-browse-project nil)))
+
+(defun helm-bookmark-run-browse-project ()
+ "Run `helm-bookmark-browse-project' from keyboard."
+ (interactive)
+ (with-helm-alive-p
+ (helm-exit-and-execute-action 'helm-bookmark-browse-project)))
+(put 'helm-bookmark-run-browse-project 'helm-only t)
+
+(defvar helm-bookmark-find-files-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map helm-bookmark-map)
+ (define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project)
+ map))
+
(defvar helm-source-bookmark-helm-find-files
(helm-make-source "Bookmark helm-find-files sessions" 'helm-source-filtered-bookmarks
:init (lambda ()