all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: emacs-devel@gnu.org
Cc: Sam Steingold <sds@gnu.org>
Subject: Re: hungry-delete
Date: Mon, 04 Apr 2011 20:54:45 +0200	[thread overview]
Message-ID: <4D9A13F5.7040702@online.de> (raw)
In-Reply-To: <sv8vvpj2un.fsf@tbox.wtc.algo>

Am 04.04.2011 20:20, schrieb Sam Steingold:
>> * Andreas Röhler<naqernf.ebruyre@bayvar.qr>  [2011-04-04 19:19:52 +0200]:
>>
>> https://bugs.launchpad.net/python-mode/+bug/328853
>>
>> "I really love the hungry-delete feature of Emacs'
>> c-mode. It would be great to have hungry-delete for
>> python-mode as well."
>
> DEL (translated from<backspace>) runs the command
> backward-delete-char-untabify, which is an interactive compiled Lisp
> function in `simple.el'.
>
> It is bound to DEL.
>
> (backward-delete-char-untabify ARG&optional KILLP)
>
> Delete characters backward, changing tabs into spaces.
> The exact behavior depends on `backward-delete-char-untabify-method'.
> Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil.
> Interactively, ARG is the prefix arg (default 1)
> and KILLP is t if a prefix arg was specified.
>
> backward-delete-char-untabify-method is a variable defined in `simple.el'.
> Its value is all
> Original value was untabify
>
> Documentation:
> The method for untabifying when deleting backward.
> Can be `untabify' -- turn a tab to many spaces, then delete one space;
>         `hungry' -- delete all whitespace, both tabs and spaces;
>         `all' -- delete all whitespace, including tabs, spaces and newlines;
>         nil -- just delete one character.
>
> You can customize this variable.
>
> This variable was introduced, or its default value was changed, in
> version 20.3 of Emacs.
>
>
>
>

Hi,

thanks for the hint.
However don't think customizing DEL does it.
In most cases you will use DEL as `untabify'.

"Hungry" eates a lot - that's is fine, but not as taking the common DEL.

Therefore think a seperate key for hungry-delete is needed.

However, seems it must not be copied from the scratch.
What about such a thing:

(defun hunry-delete  (&optional killp)
   "Delete characters backward, changing tabs into spaces.

Kill (save in kill ring) if KILLP is non-nil.
  "
   (interactive "P")
   (let ((backward-delete-char-untabify-method 'all))
     (backward-delete-char-untabify 1 killp)))


;;;;;;;;



  reply	other threads:[~2011-04-04 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 17:19 hungry-delete Andreas Röhler
2011-04-04 18:20 ` hungry-delete Sam Steingold
2011-04-04 18:54   ` Andreas Röhler [this message]
2011-04-04 19:00     ` hungry-delete Sam Steingold
2011-04-04 20:02       ` hungry-delete Andreas Röhler
2011-04-04 19:59         ` hungry-delete Sam Steingold
2011-04-05  6:02           ` hungry-delete Andreas Röhler
2011-04-05 16:11     ` hungry-delete Andrew W. Nosenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D9A13F5.7040702@online.de \
    --to=andreas.roehler@online.de \
    --cc=emacs-devel@gnu.org \
    --cc=sds@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.