all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13169: [PATCH] kill-region fails to deactivate mark after cutting empty region
@ 2012-12-13  8:19 Kelly Dean
  2012-12-21  3:49 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Kelly Dean @ 2012-12-13  8:19 UTC (permalink / raw)
  To: 13169

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

On 24.2, emacs -Q
C-SPC M-w C-p
kill-ring-save copied an empty region, and deactivated the mark. This is correct. But now do
C-SPC C-w C-p
kill-region cut an empty region, which is correct, but the mark is still active, which is incorrect. When the buffer and text aren't read-only, kill-region relies on the command loop to deactivate the mark after the buffer is modified, but when cutting an empty region, the buffer isn't modified, so the mark is never deactivated.
The attached killregionbug.patch fixes it.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: killregionbug.patch --]
[-- Type: text/x-diff; name="killregionbug.patch", Size: 442 bytes --]

--- emacs-24.2/lisp/simple.el	2012-08-22 22:33:42.000000000 -0700
+++ emacs-24.2/lisp/simple.el.new2	2012-12-12 22:52:46.258462306 -0800
@@ -3233,6 +3233,7 @@
 	    (kill-new string nil yank-handler)))
 	(when (or string (eq last-command 'kill-region))
 	  (setq this-command 'kill-region))
+	(setq deactivate-mark t)
 	nil)
     ((buffer-read-only text-read-only)
      ;; The code above failed because the buffer, or some of the characters

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#13169: [PATCH] kill-region fails to deactivate mark after cutting empty region
  2012-12-13  8:19 bug#13169: [PATCH] kill-region fails to deactivate mark after cutting empty region Kelly Dean
@ 2012-12-21  3:49 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-12-21  3:49 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 13169-done

Kelly Dean <kellydeanch@yahoo.com> writes:

> C-SPC C-w C-p
> kill-region cut an empty region, which is correct, but the mark is
> still active, which is incorrect. When the buffer and text aren't
> read-only, kill-region relies on the command loop to deactivate the
> mark after the buffer is modified, but when cutting an empty region,
> the buffer isn't modified, so the mark is never deactivated.
> The attached killregionbug.patch fixes it.

Committed to trunk, thanks.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-21  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-13  8:19 bug#13169: [PATCH] kill-region fails to deactivate mark after cutting empty region Kelly Dean
2012-12-21  3:49 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.