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

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

Hungry delete in modes other than C, C++, Java, etc


From: Nordlöw
Subject: Hungry delete in modes other than C, C++, Java, etc
Date: 26 Apr 2007 06:43:46 -0700
User-agent: G2/1.0

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

Is it ok to reuse c-hungry-delete-forwards and c-hungry-delete-
backwards?

I also 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



/Nordlöw



reply via email to

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