Subject: bug#12389: 24.2.50; mark, transient-mark-mode and registers

From: Jambunathan K <[email-masked]>
Date: Wed, 03 Oct 2012 20:01:04 +0530

Stefan Monnier <[email-masked]> writes:

>> Item-1
>> ======
>> My upvotes for de-activating mark after `prepend-to-register' and
>> `append-to-register.
>
> Fine by me.

I am attaching a patch.

Please leave the bug open.  I will continue my discussion on Item-2
sometime later.

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-10-03 08:50:49 +0000
+++ lisp/ChangeLog	2012-10-03 14:26:48 +0000
@@ -1,3 +1,9 @@
+2012-10-03  Jambunathan K  <[email-masked]>
+
+	* register.el (append-to-register, prepend-to-register):
+	Deactivate mark.  This accords with current behaviour of
+	`copy-to-register'.  See (Bug#12389).
+
 2012-10-03  Martin Rudalics  <[email-masked]>
 
 	* menu-bar.el (kill-this-buffer): Don't do anything when

=== modified file 'lisp/register.el'
--- lisp/register.el	2012-09-09 08:10:56 +0000
+++ lisp/register.el	2012-10-03 13:21:46 +0000
@@ -382,6 +382,7 @@
      register (cond ((not reg) text)
                     ((stringp reg) (concat reg separator text))
                     (t (error "Register does not contain text")))))
+  (setq deactivate-mark t)
   (cond (delete-flag
 	 (delete-region start end))
 	((called-interactively-p 'interactive)
@@ -400,6 +401,7 @@
      register (cond ((not reg) text)
                     ((stringp reg) (concat text separator reg))
                     (t (error "Register does not contain text")))))
+  (setq deactivate-mark t)
   (cond (delete-flag
 	 (delete-region start end))
 	((called-interactively-p 'interactive)

>> Item-2
>> ======
>> 1. Enable transient-mark-mode
>> 2. C-SPC
>> 3. <down> <down>
>> 4. C-g
>> 5. C-u C-x r s a
>
> That's normal: the same happens with C-w instead of C-u C-x r s a.
>
>> Now as a transient mark user, I find disappearance of a non-highlighted
>> text in (5) surprising.  Comments?
>
> What did you expect to happen?  That the text is copied but not deleted?
> Or that neither happens and you get an error.
> If you want an error, you can set mark-even-if-inactive to nil.
>
>
>         Stefan