all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Hungry delete in modes other than C, C++, Java, etc
@ 2007-04-26 13:43 Nordlöw
  0 siblings, 0 replies; only message in thread
From: Nordlöw @ 2007-04-26 13:43 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-26 13:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26 13:43 Hungry delete in modes other than C, C++, Java, etc Nordlöw

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.