nflath/hungry-delete — pull request #15 by jschaf (2014-08-05 20:51:35+00:00)
Title: Add hungry-delete-chars-to-skip for customization.

I factored out the whitespace character string into a separate variable because it allows for easier customization.

Specifically, I wanted to define a function that deletes non-vertical white-space on the first press and all whitespace on the second press.

Without a way to modify the characters that are skipped it would have been much more difficult. The function I defined using the refactor is below.

``` emacs-lisp
(defun my:hungry-delete-backward (n &optional killflag)
"Delete non-vertical whitespace backwards on first key press.
Delete all whitespace on a successive key press."
(interactive "p\nP")
(if (eq last-command 'my:hungry-delete-backward)
(hungry-delete-backward n killflag)
(let ((hungry-delete-chars-to-skip " \t\f\v"))
(hungry-delete-backward n killflag))))
```