From b0c71c2492892c410fb9c5459129da39e6f26615 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 13 Aug 2018 01:51:34 +0200 Subject: [PATCH] Add +helm/workspace-mini command & bind to SPC b b + Rename +helm/persp-buffer-list to +helm/workspace-buffer-list + Silence compiler warnings when feature/workspaces is disabled + Throw error if feature/workspaces is disabled and these commands are called. --- modules/completion/helm/autoload/helm.el | 19 ++++++++++++++++--- modules/completion/helm/config.el | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/completion/helm/autoload/helm.el b/modules/completion/helm/autoload/helm.el index 655e635f3..7d0e31e85 100644 --- a/modules/completion/helm/autoload/helm.el +++ b/modules/completion/helm/autoload/helm.el @@ -19,11 +19,24 @@ #'helm-projectile-find-file))) ;;;###autoload -(defun +helm/persp-buffer-list () - "A version of `helm-buffers-list', but with its buffer list restricted to the +(defun +helm/workspace-buffer-list () + "A version of `helm-buffers-list' with its buffer list restricted to the current workspace." (interactive) - (with-persp-buffer-list nil (helm-buffers-list))) + (unless (featurep! :feature workspaces) + (user-error "This command requires the :feature workspaces module")) + (with-no-warnings + (with-persp-buffer-list nil (helm-buffers-list)))) + +;;;###autoload +(defun +helm/workspace-mini () + "A version of `helm-mini' with its buffer list restricted to the current +workspace." + (interactive) + (unless (featurep! :feature workspaces) + (user-error "This command requires the :feature workspaces module")) + (with-no-warnings + (with-persp-buffer-list nil (helm-mini)))) ;; diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 02159e05f..5ad874feb 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -49,7 +49,7 @@ be negative.") [remap imenu-anywhere] #'helm-imenu-anywhere [remap imenu] #'helm-semantic-or-imenu [remap noop-show-kill-ring] #'helm-show-kill-ring - [remap persp-switch-to-buffer] #'+helm/persp-buffer-list + [remap persp-switch-to-buffer] #'+helm/workspace-mini [remap switch-to-buffer] #'helm-buffers-list [remap projectile-find-file] #'+helm/projectile-find-file [remap projectile-recentf] #'helm-projectile-recentf