unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* hungry-delete in other modes
@ 2011-02-23  1:21 Christoph
  2011-02-23  1:48 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph @ 2011-02-23  1:21 UTC (permalink / raw)
  To: emacs-devel

I really like the hungry-delete minor mode that cc-mode provides, so I
would like to have it in other modes, specifically Python mode.

Right now, this does not seem to possible easily, because python-mode
does not inherit from cc-mode, correct?

I can do 

(require 'cc-mode)
(global-set-key (kbd "C-<delete>") 'c-hungry-delete-forward)
(global-set-key (kbd "C-<backspace>") 'c-hungry-delete-backwards)

which enables the hungry-delete globally, but I would like to have some
more finer control over the behavior and set it up in a mode-hook, like
python-mode-hook.

Is there any reason why hungry-delete mode (or subword mode or
auto-newline mode for that matter) is so tightly coupled with cc-mode?
Would it be possible to decouple them and make the functionality
available to other modes as a minor mode instead of them being just
"minor-mode-like features" in cc-mode?

Christoph



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-24  6:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23  1:21 hungry-delete in other modes Christoph
2011-02-23  1:48 ` Stefan Monnier
2011-02-23  2:23   ` Nathaniel Flath
2011-02-24  6:00     ` Christoph
2011-02-24  5:58   ` Christoph

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).