summary refs log tree commit diff stats
path: root/lisp/+emacs.el
diff options
context:
space:
mode:
authorCase Duckworth2022-01-06 15:47:42 -0600
committerCase Duckworth2022-01-06 15:48:00 -0600
commit4dee486f1f1d39ebc523e03f61705656d8e9c326 (patch)
treeaa4b8bdcceb638d63d4ca06f5566c4385b5502bd /lisp/+emacs.el
parentAdd user-save-mode (diff)
downloademacs-4dee486f1f1d39ebc523e03f61705656d8e9c326.tar.gz
emacs-4dee486f1f1d39ebc523e03f61705656d8e9c326.zip
Add +kill-word-backward-or-region
Diffstat (limited to 'lisp/+emacs.el')
-rw-r--r--lisp/+emacs.el9
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.
225BACKWARD-KILL-WORD-FN is the function to call to kill a word
226backward. 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.