home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / emacs / help / 5458 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.5 KB  |  49 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!dplanet.ssf-sys.DHL.COM!ssf-sys.DHL.COM!mchen
  3. From: mchen@ssf-sys.DHL.COM (Mark Chen)
  4. Subject: Re: Remapping DEL key on a SUN4
  5. Reply-To: mchen@ssf-sys.DHL.COM (Mark Chen)
  6. Organization: DHL
  7. Date: Thu, 21 Jan 1993 19:30:24 GMT
  8. Message-ID: <1993Jan21.193024.18959@gateway.ssf-sys.DHL.COM>
  9. References:  <1ifcu5INNmn5@agate.berkeley.edu> <1993Jan21.160833.18126@kth.se>
  10. Sender: news@gateway.ssf-sys.DHL.COM (DHL Netnews)
  11. Lines: 36
  12.  
  13. In article <1ifcu5INNmn5@agate.berkeley.edu>, pedro@eerc.berkeley.edu
  14. (Peter Clark) writes:
  15. |> Hi all,
  16. |> 
  17. |> I am using emacs 18.58 on a SUN 4 (Sparc 1) with a type 4 keyboard.
  18. |> 
  19. |> I would like to remap the DEL key on the keypad from delete-backward-char
  20. |> to delete-char.  I have tried in my .emacs
  21. |> (global-set-key "DEL" 'delete-char)
  22. |> (global-set-key "\DEL" 'delete-char)
  23. |> etc. to no avail.
  24. |> 
  25. |> I did notice that I could do a 
  26. |> M-x local-set-key DEL delete-char
  27. |> while running emacs and this worked OK.
  28. |> 
  29. |> I've looked in the FAQ, I've tried everything, please help explain this!!!
  30. |> 
  31. |> Thanks for all hints and pointers!
  32. |> 
  33. |> Cheers, Peter Clark
  34. |> pedro@eerc.berkeley.edu
  35.  
  36.  
  37. The reason global-set-key doesn't work is that your DEL key (\C-?) is
  38. overridden locally by each of the modes.  If you want to change it,
  39. you have to do it with mode hooks.  For example:
  40.  
  41. (defun reset-del ()
  42.   (local-set-key "\C-?" 'delete-char))
  43.  
  44. (setq text-mode-hook 'reset-del)
  45.  
  46. -----
  47. Mark Chen
  48. mchen@ssf-sys.DHL.COM
  49.