Closed jschaf closed 10 years ago
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.
(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))))
Looks good!
Thanks!
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.