From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "=?ISO-8859-1?Q?Nordl=F6w?=" Newsgroups: gmane.emacs.help Subject: Re: Hungry delete in any mode Date: Tue, 22 Jan 2008 00:42:55 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1200994940 32665 80.91.229.12 (22 Jan 2008 09:42:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Jan 2008 09:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 22 10:42:38 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JHFeQ-00028b-Ah for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Jan 2008 10:42:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHFdy-00049K-QB for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Jan 2008 04:42:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v4g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1200991376 19447 127.0.0.1 (22 Jan 2008 08:42:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 22 Jan 2008 08:42:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v4g2000hsf.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en; rv:1.8.1.8) Gecko/20071022 Epiphany/2.20 Firefox/2.0.0.8,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Original-Xref: shelby.stanford.edu gnu.emacs.help:155456 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50860 Archived-At: On 22 Jan, 03:36, Kevin Rodgers wrote: > Nordl=F6w wrote: > > I trying to create a general hungry-mode that can be used in alla > > programming modes. Everything works except that I the following code > > only rebinds but not (nor C-d). What have I > > missed? Has perhaps someone already solved the problem? > > > (define-minor-mode any-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. > > '(([backspace]. c-hungry-delete-backwards) ;backspace > > ("\d" . 'c-hungry-delete-forward) ;??? > > )) > > You have bound the backspace function key and the DEL ASCII character > (by default, backspace is automatically translated to DEL). > > Try also binding [delete] and "\C-d" (likewise, the ASCII character > to which delete is translated). > > I wonder if an alternative implementaton would work: instead of binding > any keys at all, make backward-delete-char-untabify-method buffer local > and toggle its value between `hungry' and the global value. > > -- > Kevin Rodgers > Denver, Colorado, USA Neither [delete] nor "\C-d" works for me. /Nordl=F6w