nflath / hungry-delete

Enables hungry deletion in all modes.
98 stars 16 forks source link

Respect `delete-forward-char` prefix argument #13

Closed DamienCassou closed 10 years ago

DamienCassou commented 10 years ago

With delete-forward-char, it is possible to pass a prefix argument to delete as many characters. For example,

M-4 C-d

would delete 4 characters. Would it be possible that hungry-delete do the same?

As a reference, here is the docstring:

(delete-forward-char N &optional KILLFLAG)

Delete the following N characters (previous if N is negative).
If Transient Mark mode is enabled, the mark is active, and N is 1,
delete the text in the region and deactivate the mark instead.
To disable this, set `delete-active-region' to nil.

Optional second arg KILLFLAG non-nil means to kill (save in kill
ring) instead of delete.  Interactively, N is the prefix arg, and
KILLFLAG is set if N was explicitly specified.
mwfogleman commented 10 years ago

If you are using a recent version of hungry-delete (i.e. one produced in the last day or two), you will find that this feature works as desired!

DamienCassou commented 10 years ago

I confirm, good job :+1: