unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: rjs@netti.fi (Riku Saikkonen)
To: 18939@debbugs.gnu.org
Subject: bug#18939: 24.4; middle-click sometimes pastes data other than the PRIMARY selection
Date: Tue, 30 Dec 2014 12:45:12 +0200	[thread overview]
Message-ID: <87zja54ds7.fsf@anar.lloke.localnet> (raw)
In-Reply-To: <87k33catpv.fsf@xvii.vinc17.org>

I tried to trace where the bug occurs, and got as far as this:

mouse-drag-track contains the lines

	  ;; Otherwise, run binding of terminating up-event.
          (deactivate-mark)
	  (if do-multi-click
	      (goto-char start-point)
	    (unless moved-off-start
	      (pop-mark)))

(lines 858-863 of mouse.el in Emacs 24.4.1)

Commenting out the last (pop-mark) fixes the bug, but leaves extra marks
in the mark ring (accessible with C-u C-SPC) at every point you click.
There's a corresponding push-mark on line 796 which this pop-mark
appears to try to undo, but it appears that as a side effect pop-mark
sets the primary selection (in the situation described in the bug).

I am not sure what would be a proper fix. Perhaps mouse-drag-track
should not push the mark at all until it detects something else than a
single click (i.e., (or moved-off-start do-multi-click) or something)?
(From a quick look at the source, that seems to be how mouse-drag-track
worked in Emacs 23.4.1. But the source has changed quite a lot since
then.)

PS. I found out about this bug because Debian currently considers it to
    be a release-critical bug; see <http://bugs.debian.org/774090>.





  parent reply	other threads:[~2014-12-30 10:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 20:56 bug#18939: 24.4; middle-click sometimes pastes data other than the PRIMARY selection Vincent Lefevre
2014-11-16 12:27 ` Vincent Lefevre
2014-12-28 15:03   ` Vincent Lefevre
2014-12-28 15:10     ` Vincent Lefevre
2015-03-21 13:42     ` Stefan Monnier
2015-03-21 19:35       ` Vincent Lefevre
2015-03-21 22:25         ` Stefan Monnier
2015-03-22  1:42           ` Vincent Lefevre
2015-03-22 18:33             ` Jan Djärv
2015-03-22 18:39           ` Glenn Morris
2014-12-30 10:45 ` Riku Saikkonen [this message]
2015-01-04  2:23   ` Vincent Lefevre
2015-01-18  1:17   ` Glenn Morris

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=87zja54ds7.fsf@anar.lloke.localnet \
    --to=rjs@netti.fi \
    --cc=18939@debbugs.gnu.org \
    /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).