Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix describe-mode keybinding breaking helm #16397

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion layers/+completion/helm/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 0 additions & 18 deletions layers/+completion/ivy/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'.

Expand Down
1 change: 0 additions & 1 deletion layers/+completion/ivy/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions layers/+spacemacs/spacemacs-defaults/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion layers/+spacemacs/spacemacs-defaults/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading