From 658e7731b7c8fa3d09c8176c005a4a246255f21a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 23 Mar 2016 11:52:55 -0400 Subject: [PATCH] helm: extract helm-descbinds defuns --- Cask | 2 +- core/core-helm.el | 23 ++++------------------- core/defuns/defuns-helm.el | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Cask b/Cask index 0357680c5..cd001dfe4 100644 --- a/Cask +++ b/Cask @@ -104,7 +104,7 @@ (depends-on "helm-css-scss") (depends-on "helm-projectile") (depends-on "helm-swoop") -; (depends-on "helm-descbinds") +(depends-on "helm-descbinds") (depends-on "projectile") (depends-on "helm-describe-modes" :git "https://github.com/emacs-helm/helm-describe-modes") diff --git a/core/core-helm.el b/core/core-helm.el index 7b6eff491..ef05cbb6b 100644 --- a/core/core-helm.el +++ b/core/core-helm.el @@ -146,26 +146,11 @@ helm-swoop-pre-input-function (lambda () ""))) (use-package helm-describe-modes :defer t) -(use-package helm-semantic :commands helm-semantic-or-imenu) -(use-package helm-elisp :commands helm-apropos) -(use-package helm-command :commands helm-M-x) +(use-package helm-semantic :commands helm-semantic-or-imenu) +(use-package helm-elisp :commands helm-apropos) +(use-package helm-command :commands helm-M-x) (use-package helm-descbinds :commands helm-descbinds - :config - (setq helm-descbinds-window-style 'split-window) - (defun narf/helm-descbinds-leader () - (interactive) - (narf-helm-descbinds "^,\\ ")) - (defun narf/helm-descbinds-localleader () - (interactive) - (narf-helm-descbinds "^\\\\\\ ")) - - (defun narf-helm-descbinds (&optional input buffer) - (let ((enable-recursive-minibuffers t)) - (helm :sources (helm-descbinds-sources (or buffer (current-buffer))) - :buffer "*helm-descbinds*" - :resume 'noresume - :allow-nest t - :input input)))) + :config (setq helm-descbinds-window-style 'split-window)) (provide 'core-helm) ;;; core-helm.el ends here diff --git a/core/defuns/defuns-helm.el b/core/defuns/defuns-helm.el index 22a3b02e8..84d3f5cfe 100644 --- a/core/defuns/defuns-helm.el +++ b/core/defuns/defuns-helm.el @@ -73,5 +73,24 @@ buffers." (let ((narf-helm-force-project-buffers (and (not all-p) (narf/project-p)))) (helm-buffers-list))) +;;;###autoload +(defun narf/helm-descbinds-leader () + (interactive) + (narf--helm-descbinds "^,\\ ")) + +;;;###autoload +(defun narf/helm-descbinds-localleader () + (interactive) + (narf--helm-descbinds "^\\\\\\ ")) + +(defun narf--helm-descbinds (&optional input buffer) + (let ((enable-recursive-minibuffers t)) + (require 'helm-descbinds) + (helm :sources (helm-descbinds-sources (or buffer (current-buffer))) + :buffer "*helm-descbinds*" + :resume 'noresume + :allow-nest t + :input input))) + (provide 'defuns-helm) ;;; defuns-helm.el ends here