From 221f8f7fc314d5b19cf44266a92607a1154a7f00 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Tue, 25 Aug 2020 14:23:06 +0200 Subject: [PATCH] Move custom helm bindings to top-level db/run-init Configuring custom key bindings via use-package's :map keyword does seem to install autoloads for the bound functions into the main helm package. I.e., when binding `db/play-radio-stations' to # in `helm-command-map' via :map, use-package seems to install an autoload for `db/play-radio-stations' that requires `helm', instead of the correct `db-music' package. Additionally, defining key bindings somewhere in the init file is hard to manage, and they are thus now collected with other key bindings in `db/run-init'. --- init.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index ce8dc1c..fb8da3d 100644 --- a/init.el +++ b/init.el @@ -112,8 +112,6 @@ (with-demoted-errors "Cannot activate mode: %s" (funcall mode +1))) - (require 'helm) - (unless on-windows (with-demoted-errors "Cannot load `pdf-tools’: %s" (pdf-tools-install))) @@ -218,6 +216,12 @@ (bind-key [remap fill-paragraph] #'endless/fill-or-unfill) (unbind-key "C-x C-c" global-map) + ;; Custom helm bindings + + (require 'helm) + (bind-key "#" #'db/play-radio-stations helm-command-map) + (bind-key "P" #'helm-pages helm-command-map) + ;; Overwrite certain keybindings only if packages are avilable (when (package-installed-p 'counsel) @@ -1883,9 +1887,6 @@ With given ARG, display files in `db/important-document-path’." (use-package helm :ensure t :diminish helm-mode - :bind (:map helm-command-map - ("#" . db/play-radio-stations) - ("P" . helm-pages)) :init (setq helm-command-prefix-key "C-c h" helm-input-idle-delay 0.0 helm-buffers-fuzzy-matching t