Created
August 19, 2010 04:30
-
-
Save kurohuku/537042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun kill-to-regexp-forward (regexp) | |
(interactive "sRegexp:") | |
(let ((start-point (point))) | |
(when (re-search-forward regexp nil t) | |
(re-search-backward regexp nil t) | |
(kill-region start-point (point))))) | |
(defun kill-to-regexp-backward (regexp) | |
(interactive "sRegexp:") | |
(let ((start-point (point))) | |
(when (re-search-backward regexp nil t) | |
(re-search-forward regexp nil t) | |
(kill-region (point) start-point)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment