From 82ec206be2ff946042c2f495d5ac903aedbb863e Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 22 Nov 2024 09:18:28 +0100 Subject: [PATCH] puni-kill-active-region: do Emacs default behavior if there's no active region The default kill-region fallback behavior is to signal an error, or, since Emacs 31, to perform the action defined by kill-region-dwim (which are variant of killing the word before point which is a very handy operation for fixing typos while writing). --- puni.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/puni.el b/puni.el index 442672e..76fb618 100644 --- a/puni.el +++ b/puni.el @@ -1558,7 +1558,9 @@ rectangular region instead." (interactive) (if (use-region-p) (puni-kill-region) - (user-error "No active region"))) + ;; Fall back to Emacs default behavior which is signaling an error or what + ;; `kill-region-dwim' defines (since Emacs 31). + (call-interactively #'kill-region))) ;;;;; Char