0

Is there a way to easily disable all Emacs commands? I'm trying to remap some commands I commonly use.

; Delete line
(global-set-key "\C-d" 'kill-whole-line)

In some contexts this doesn't always delete the whole line. I assume it's the underlying default commands.

KeyHeart
  • 163
  • 2
  • 6
  • 17
  • 2
    I'm not sure it makes any sense. – Basile Starynkevitch Jan 15 '15 at 09:13
  • 1
    Globally `C-d` may be bound to something, but major & minor modes may well have their own implementation of `C-d` (like `org-mode` which binds `C-d` to `org-delete-char`), and major and minor mode key maps take precedence over global bindings. – Squidly Jan 15 '15 at 10:50
  • 3
    Disabling all commands means disabling Emacs. The question is unclear as to what is really needed (i.e., what the problem really is) - should be closed unless improved. Seems to be an [X Y problem](http://meta.stackexchange.com/q/66377/231821). – Drew Jan 15 '15 at 14:28

1 Answers1

0

Why not just use the default where C-d deletes a character and C-k kills the line to the right of the cursor?

Regardless, I ran into this problem when I wanted to map C-h to backward delete char and M-h to backward delete word. I did it using global-set-key but it would be overridden by some minor modes. There are longer ways to do it, but the best I found is simply to download the use-package package and use the bind-key* command. It forces your set key to override all other minor modes.

goodepic
  • 196
  • 5