Next: , Previous: , Up: Customisation  

Q3.5.4: Globally binding Delete?

I cannot manage to globally bind my Delete key to something other than the default. How does one do this?

Answer: The problem is that many modes explicitly bind Delete. To get around this, try the following:

(defun foo ()
  (message "You hit DELETE"))

(define-key key-translation-map 'delete 'redirected-delete)
(global-set-key 'redirected-delete 'foo)

Also see Q3.5.10.