defining the delete key in emacs

Discussion in 'Mac Programming' started by mobilehaathi, Sep 25, 2008.

  1. mobilehaathi macrumors G3


    Aug 19, 2008
    The Anthropocene
    So I recently got myself an apple keyboard for when I'm doing programming at lab on my MBP. I usually code in emacs and compile with gnu make, etc. However, I've noticed that in emacs my delete key #2 works the same as my delete key #1. I'd like to change it such that it will delete to the right of the cursor instead of to the left. I did something like this to define the scroll wheel action by adding the following code to my .emacs file (found it on the web).

    (global-set-key [wheel-down] 'up-slightly)
    (global-set-key [wheel-up] 'down-slightly)
    (global-set-key [double-wheel-down] 'up-slightly)
    (global-set-key [double-wheel-up] 'down-slightly)
    (global-set-key [triple-wheel-down] 'up-slightly)
    (global-set-key [triple-wheel-up] 'down-slightly)
    Anyone know what to add to make my delete #2 work as I want?
  2. o.simon macrumors newbie

    Apr 16, 2011
    add this line to your .emacs file (or to your .emacs.d/init.el file)
    (normal-erase-is-backspace-mode 1)

Share This Page