GNU bug report logs - #69097
[PATCH] Add 'kill-region-or-word' command

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Tue, 13 Feb 2024 09:57:02 UTC

Severity: normal

Tags: patch

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


Message #271 received at 69097 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 69097 <at> debbugs.gnu.org
Subject: Re: bug#69097: [PATCH] Add 'kill-region-or-word' command
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)




This bug report was last modified 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.