diff --git a/layers/+completion/helm/packages.el b/layers/+completion/helm/packages.el index 310f83d0a93b..a7aa39e3c36c 100644 --- a/layers/+completion/helm/packages.el +++ b/layers/+completion/helm/packages.el @@ -132,7 +132,6 @@ (spacemacs||set-helm-key "sgG" spacemacs/helm-file-do-grep-region-or-symbol) ;; various key bindings (spacemacs||set-helm-key "fel" helm-locate-library) - (spacemacs||set-helm-key "hdm" describe-mode) (spacemacs||set-helm-key "hdx" spacemacs/describe-ex-command) (spacemacs||set-helm-key "swg" helm-google-suggest) (with-eval-after-load 'helm-files diff --git a/layers/+completion/ivy/funcs.el b/layers/+completion/ivy/funcs.el index 25468679115d..1f78606bcfbe 100644 --- a/layers/+completion/ivy/funcs.el +++ b/layers/+completion/ivy/funcs.el @@ -343,24 +343,6 @@ that directory." (ignore-errors (call-interactively 'counsel-up-directory))) -(when (configuration-layer/package-used-p 'counsel) - (with-eval-after-load 'counsel - (defun spacemacs/describe-mode () - "Dummy wrapper to prevent an key binding error from helm. - -By default the emacs leader is M-m, turns out that Helm does this: - (cl-dolist (k (where-is-internal 'describe-mode global-map)) - (define-key map k 'helm-help)) -after doing this: - (define-key map (kbd \"M-m\") 'helm-toggle-all-marks) -So when Helm is loaded we get the error: - Key sequence M-m h d m starts with non-prefix key M-m - -To prevent this error we just wrap `describe-mode' to defeat the - Helm hack." - (interactive) - (call-interactively 'describe-mode)))) - (defun spacemacs//counsel-with-git-grep (func x) "This function should be kept in sync with `counsel-git-grep-action'. diff --git a/layers/+completion/ivy/packages.el b/layers/+completion/ivy/packages.el index 8104b6c418f2..a1890d789c10 100644 --- a/layers/+completion/ivy/packages.el +++ b/layers/+completion/ivy/packages.el @@ -88,7 +88,6 @@ "hda" 'counsel-apropos "hdf" 'counsel-describe-function "hdF" 'counsel-describe-face - "hdm" 'spacemacs/describe-mode "hdv" 'counsel-describe-variable "hdx" 'spacemacs/describe-ex-command "hi" 'counsel-info-lookup-symbol diff --git a/layers/+spacemacs/spacemacs-defaults/funcs.el b/layers/+spacemacs/spacemacs-defaults/funcs.el index 647ac8721ad6..064de7747860 100644 --- a/layers/+spacemacs/spacemacs-defaults/funcs.el +++ b/layers/+spacemacs/spacemacs-defaults/funcs.el @@ -131,6 +131,17 @@ If not in such a search box, fall back on `Custom-newline'." (defalias 'spacemacs/display-buffer-other-frame 'display-buffer-other-frame) (defalias 'spacemacs/find-file-and-replace-buffer 'find-alternate-file) +;; By default the emacs leader is M-m, turns out that Helm does this: +;; (cl-dolist (k (where-is-internal 'describe-mode global-map)) +;; (define-key map k 'helm-help)) +;; after doing this: +;; (define-key map (kbd \"M-m\") 'helm-toggle-all-marks) +;; So when Helm is loaded we get the error: +;; Key sequence M-m h d m starts with non-prefix key M-m +;; To prevent this error we just alias `describe-mode' to defeat the Helm hack. +(when (configuration-layer/package-used-p 'helm) + (defalias 'spacemacs/describe-mode 'describe-mode)) + (defun spacemacs/indent-region-or-buffer () "Indent a region if selected, otherwise the whole buffer." (interactive) diff --git a/layers/+spacemacs/spacemacs-defaults/keybindings.el b/layers/+spacemacs/spacemacs-defaults/keybindings.el index 885c9f702d6e..275a8d680e15 100644 --- a/layers/+spacemacs/spacemacs-defaults/keybindings.el +++ b/layers/+spacemacs/spacemacs-defaults/keybindings.el @@ -424,7 +424,9 @@ "hdk" 'describe-key "hdK" 'describe-keymap "hdl" 'spacemacs/describe-last-keys - "hdm" 'describe-mode + "hdm" (if (configuration-layer/package-used-p 'helm) + 'spacemacs/describe-mode + 'describe-mode) "hdp" 'describe-package "hdP" 'configuration-layer/describe-package "hds" 'spacemacs/describe-system-info