GNU bug report logs - #12389
24.2.50; mark, transient-mark-mode and registers

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Sat, 8 Sep 2012 19:10:01 UTC

Severity: minor

Tags: moreinfo

Found in version 24.2.50

Done: Jambunathan K <kjambunathan <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12389 <at> debbugs.gnu.org
Subject: Re: bug#12389: 24.2.50; mark, transient-mark-mode and registers
Date: Wed, 03 Oct 2012 20:01:04 +0530
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> 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.

[bug12389.diff (text/x-diff, inline)]
=== 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  <kjambunathan <at> gmail.com>
+
+	* 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  <rudalics <at> gmx.at>
 
 	* 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)

[Message part 3 (text/plain, inline)]

>> 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

This bug report was last modified 11 years and 250 days ago.

Previous Next


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