help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem rebinding the delete and backspace key for use in hungry-deletes


From: Nordlöw
Subject: Problem rebinding the delete and backspace key for use in hungry-deletes
Date: 7 May 2007 04:43:24 -0700
User-agent: G2/1.0

I would like to enable hungry-deletes in modes other than c,c++ such
as emacs-lisp-mode.

But I don't know how to redefine the delete and backspace key
correctly.
Could someone help me?

Here is my code-snippet so far:

(define-minor-mode hungry-mode
  "Toggle Hungry mode.
     With no argument, this command toggles the mode.
     Non-null prefix argument turns on the mode.
     Null prefix argument turns off the mode.

     When Hungry mode is enabled, the control delete key
     gobbles all preceding whitespace except the last.
     See the command \\[hungry-electric-delete]."
  ;; The initial value.
  nil
  ;; The indicator for the mode line.
  " Hungry"
  ;; The minor mode bindings.
  '(([<DEL>]. c-hungry-delete-backwards) ;backspace does backward
delete
    ([(delete)] . 'c-hungry-delete-forward))) ;delete does forward
delete

Thanks in advance,
Nordlöw



reply via email to

[Prev in Thread] Current Thread [Next in Thread]