Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command

From: Juri Linkov <[email-masked]>
Date: Wed, 18 Sep 2024 19:08:35 +0300

> Thanks for the new command!

Sorry, I meant the new option.

> I'd like to use it, but currently can't
> because I have customized 'mark-even-if-inactive' to nil.

This small fix addresses the remaining issues:

diff --git a/lisp/simple.el b/lisp/simple.el
index 9fbd9bfb577..40266f37209 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5865,7 +5865,7 @@ kill-region
   ;; Pass mark first, then point, because the order matters when
   ;; calling `kill-append'.
   (interactive (progn
-                 (let ((beg (mark))
+                 (let ((beg (mark kill-region-dwim))
                        (end (point)))
                    (cond
                     ((and kill-region-dwim (not (use-region-p)))
@@ -5888,10 +5888,12 @@ kill-region
                      ((filter-buffer-substring beg end 'delete)))))
 	(when string			;STRING is nil if BEG = END
 	  ;; Add that string to the kill ring, one way or another.
-	  (if (eq last-command 'kill-region)
+	  (if (and (null kill-region-dwim)
+		   (eq last-command 'kill-region))
 	      (kill-append string (< end beg))
 	    (kill-new string)))
-	(when (or string (eq last-command 'kill-region))
+	(when (and (null kill-region-dwim)
+		   (or string (eq last-command 'kill-region)))
 	  (setq this-command 'kill-region))
 	(setq deactivate-mark t)
 	nil)