From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nathaniel Flath Newsgroups: gmane.emacs.devel Subject: Re: hungry-delete in other modes Date: Tue, 22 Feb 2011 21:23:12 -0500 Message-ID: References: <86k4grsfzm.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec53f8eaf581286049ce9c781 X-Trace: dough.gmane.org 1298427931 17798 80.91.229.12 (23 Feb 2011 02:25:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Feb 2011 02:25:31 +0000 (UTC) Cc: Christoph , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 23 03:25:23 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ps4Po-0005PY-BY for ged-emacs-devel@m.gmane.org; Wed, 23 Feb 2011 03:25:20 +0100 Original-Received: from localhost ([127.0.0.1]:42633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ps4Pn-0001lm-UB for ged-emacs-devel@m.gmane.org; Tue, 22 Feb 2011 21:25:19 -0500 Original-Received: from [140.186.70.92] (port=55241 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ps4Pi-0001kT-Pf for emacs-devel@gnu.org; Tue, 22 Feb 2011 21:25:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ps4Ph-0005G5-Ic for emacs-devel@gnu.org; Tue, 22 Feb 2011 21:25:14 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:46885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ps4Ph-0005G1-GG for emacs-devel@gnu.org; Tue, 22 Feb 2011 21:25:13 -0500 Original-Received: by vxc38 with SMTP id 38so2341765vxc.0 for ; Tue, 22 Feb 2011 18:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aCEq5Uwfn/HUjLVSrdl+jdsYJTLJl4XCg83SmZZhUPI=; b=Myt7ZothtPVbNK3tEJUQBKHjOyRE8fnI07g5v/g8T7TmPbxRVOf6yPqDgR9jJKnSFd YCsD40d+STrtEMtHg6G/zdDiFivRx8cvmYs/KPdavMZJmJ75cJdAP+rfslq2V4SO+Dah Ja92nDzl1K3+PMaZk+pAc0JoOO1qwA1JV88Zs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=f0SPNCwJIhDFsNfUDX/qVnvZKOVwDhluWnMch4smXE1BxD+MtzIBeLRVauyYPZdu4y l4RKg9J+g3ehHWL8cRuYu6KS9wNG483WH3EtfqWhXMH9widyS4t/jGvoVkwN8AQ1lYrq JNR5F7E6t6B3kqfE6ttgy5bphT2cBQpLpIGO8= Original-Received: by 10.52.167.166 with SMTP id zp6mr5216945vdb.286.1298427792593; Tue, 22 Feb 2011 18:23:12 -0800 (PST) Original-Received: by 10.220.81.73 with HTTP; Tue, 22 Feb 2011 18:23:12 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136383 Archived-At: --bcaec53f8eaf581286049ce9c781 Content-Type: text/plain; charset=ISO-8859-1 I actually ran into this before, and ended up moving the necessary machinery out of cc-mode into it's own mode. You can take a look at https://github.com/nflath/hungry-delete Thanks, Nathaniel Flath On Tue, Feb 22, 2011 at 8:48 PM, Stefan Monnier wrote: > > 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. > > For DEL at least, you can > > (global-set-key [?\^?] 'backward-delete-char-untabify) > > and even control it via buffer-local settings of > backward-delete-char-untabify-method. > > > 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? > > Because the CC-mode author wanted to provide the feature to all CC-mode > users and/or did not make the effort to try and submit this feature for > separate inclusion in Emacs. > > > 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? > > Of course it's possible. As a matter of fact we do have subword-mode, > as well as electric-layout-mode. > > > Stefan > > --bcaec53f8eaf581286049ce9c781 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I actually ran into this before, and ended up moving the necessary machiner= y out of cc-mode into it's own mode. =A0You can take a look at
Thanks,
Nathaniel Flath
On = Tue, Feb 22, 2011 at 8:48 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> I really like the hu= ngry-delete minor mode that cc-mode provides, so I
> would like to have it in other modes, specifically Python mode.

For DEL at least, you can

=A0(global-set-key [?\^?] 'backward-delete-char-untabify)

and even control it via buffer-local settings of
backward-delete-char-untabify-method.

> 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?=

Because the CC-mode author wanted to provide the feature to all CC-mo= de
users and/or did not make the effort to try and submit this feature for
separate inclusion in Emacs.

> 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?

Of course it's possible. =A0As a matter of fact we do have subwor= d-mode,
as well as electric-layout-mode.


=A0 =A0 =A0 =A0Stefan


--bcaec53f8eaf581286049ce9c781--