unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Jorgen Schaefer <contact@jorgenschaefer.de>
Cc: 20260@debbugs.gnu.org
Subject: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations
Date: Tue, 07 Apr 2015 14:53:42 -0400	[thread overview]
Message-ID: <jwvbnizrctk.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87iodb4jem.fsf@loki.jorgenschaefer.de> (Jorgen Schaefer's message of "Sun, 05 Apr 2015 00:29:21 +0200")

> Triple-click on the "World" in the *Bug* buffer. Notice that Emacs
> selects the whole line only momentarily, and then deselects it again
> immediately.

Indeed.  I though I had fixed this in Emacs-25 by making deactivate-mark
buffer-local, but I actually failed to adjust the C code accordingly.

The patch below seems to fix your test case.  Can you confirm it also
fixes your real use case?


        Stefan


diff --git a/src/fileio.c b/src/fileio.c
index d4e12cb..a6e7fbb 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4165,7 +4165,7 @@ by calling `format-decode', which see.  */)
       Vdeactivate_mark = old_Vdeactivate_mark;
     }
   else
-    Vdeactivate_mark = Qt;
+    Fset (Qdeactivate_mark, Qt);
 
   emacs_close (fd);
   clear_unwind_protect (fd_index);
diff --git a/src/insdel.c b/src/insdel.c
index 80650be..22c2bcc 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1846,7 +1846,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
       = call1 (Fsymbol_value (Qregion_extract_function), Qnil);
 
   signal_before_change (start, end, preserve_ptr);
-  Vdeactivate_mark = Qt;
+  Fset (Qdeactivate_mark, Qt);
 }
 
 /* Like above, but called when we know that the buffer text





  reply	other threads:[~2015-04-07 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 22:29 bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations Jorgen Schaefer
2015-04-07 18:53 ` Stefan Monnier [this message]
2015-04-08 10:41 ` Vasilij Schneidermann
2015-04-08 14:26   ` Stefan Monnier
2015-04-10 19:04     ` Jorgen Schäfer
2015-04-13 14:18     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvbnizrctk.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20260@debbugs.gnu.org \
    --cc=contact@jorgenschaefer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).