I wanted an alternative to the awful C-^
shortcut for moving up one directory so I added the following to init
file:
(defun dc/dired-mode-keys ()
"User defined keys for dired mode."
(interactive)
(local-set-key (kbd "s-m" 'dired-up-directory)))
(add-hook 'dired-mode-hook 'dc/dired-mode-keys)
However, when I open Emacs with this code enabled (i.e., uncommented in the init file), I lose basic dired functionality. For example, when I press a
to open a directory (in the same buffer), I get the following error in the mini-buffer.
Wrong number of arguments: (1 . 1), 2
I've confirmed that s-m
is not a native key-binding in dired-mode
(I believe very few if any super
key combos are natively bound), and I'm pretty sure my code doesn't unbind any of the native key-bindings in dired-mode.
What am I doing wrong in the function above?