diff options
author | Case Duckworth | 2022-01-06 15:47:42 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-06 15:48:00 -0600 |
commit | 4dee486f1f1d39ebc523e03f61705656d8e9c326 (patch) | |
tree | aa4b8bdcceb638d63d4ca06f5566c4385b5502bd /lisp | |
parent | Add user-save-mode (diff) | |
download | emacs-4dee486f1f1d39ebc523e03f61705656d8e9c326.tar.gz emacs-4dee486f1f1d39ebc523e03f61705656d8e9c326.zip |
Add +kill-word-backward-or-region
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+emacs.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/+emacs.el b/lisp/+emacs.el index 7453913..ecdfeaa 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el | |||
@@ -220,6 +220,15 @@ kill without asking." | |||
220 | (save-buffers-kill-emacs)) | 220 | (save-buffers-kill-emacs)) |
221 | (delete-frame nil :force))) | 221 | (delete-frame nil :force))) |
222 | 222 | ||
223 | (defun +kill-word-backward-or-region (&optional arg backward-kill-word-fn) | ||
224 | "Kill active region or ARG words backward. | ||
225 | BACKWARD-KILL-WORD-FN is the function to call to kill a word | ||
226 | backward. It defaults to `backward-kill-word'." | ||
227 | (interactive "P") | ||
228 | (call-interactively (if (region-active-p) | ||
229 | #'kill-region | ||
230 | (or backward-kill-word-fn #'backward-kill-word)))) | ||
231 | |||
223 | ;; ... and advice | 232 | ;; ... and advice |
224 | 233 | ||
225 | ;; Indent the region after a yank. | 234 | ;; Indent the region after a yank. |