From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nils Berg Newsgroups: gmane.emacs.bugs Subject: bug#23288: 25.0.92; Clicking on links inserts primary X selection Date: Mon, 18 Apr 2016 10:50:37 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11381bf65eeca10530be7498 X-Trace: ger.gmane.org 1460969484 2594 80.91.229.3 (18 Apr 2016 08:51:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Apr 2016 08:51:24 +0000 (UTC) Cc: 23288@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 18 10:51:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1as4tk-00041T-B1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Apr 2016 10:51:12 +0200 Original-Received: from localhost ([::1]:33371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as4tj-0004xV-Kr for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Apr 2016 04:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as4tg-0004vR-0j for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2016 04:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1as4ta-0007W5-Ot for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2016 04:51:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as4ta-0007W1-KD for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2016 04:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1as4ta-0003Iw-Fx for bug-gnu-emacs@gnu.org; Mon, 18 Apr 2016 04:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nils Berg Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Apr 2016 08:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23288 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 23288-submit@debbugs.gnu.org id=B23288.146096944512677 (code B ref 23288); Mon, 18 Apr 2016 08:51:02 +0000 Original-Received: (at 23288) by debbugs.gnu.org; 18 Apr 2016 08:50:45 +0000 Original-Received: from localhost ([127.0.0.1]:38911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1as4tJ-0003IP-6t for submit@debbugs.gnu.org; Mon, 18 Apr 2016 04:50:45 -0400 Original-Received: from mail-ig0-f182.google.com ([209.85.213.182]:38055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1as4tH-0003IC-J2 for 23288@debbugs.gnu.org; Mon, 18 Apr 2016 04:50:43 -0400 Original-Received: by mail-ig0-f182.google.com with SMTP id y9so19001045igg.1 for <23288@debbugs.gnu.org>; Mon, 18 Apr 2016 01:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VVbkHizWUD9WstHXGmfwHnTNiRtWc9fPLP8vRS64KXo=; b=R1OUc5YrA0YHuCGGG/KrGiQMofnO/mRZDXvB2v/xGCrZe7jbbxau2EFxij8MAwgMCu VJL0yZzJJ9eA7ZWZt9J96O/15E89k7tCCv2xqQCn35xI9iJnJwbnnhhO+27dxuH+QTK3 +fZYps60A88TW3WoN8z58kiDwmn5R/+cAJIgy9gGaLovGBM3sU+fnu3sHv4MXheqGLj9 e3yn1jKuey+4Ptfj3Nsdtuq1TN4pQVFlKFpeDffqaJny648HbgL39F+//SWBpFt567RS 0RQnwoQH2iQWcs45TZjobxS9AjRNP15dKH3+o/JRtrOYOsrOEBBt9U3RVW4nRzbA4Sks owwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=VVbkHizWUD9WstHXGmfwHnTNiRtWc9fPLP8vRS64KXo=; b=BaOsTI7p9eQePCLcp/senNATwVs3Bq0664mhZuOGI6VnOx1QXIExCrqh/VM6XtsaRi i/wWyIsly41qOC2/cHXtUN+7keAtRnuViE7+x9IJRGb5bBoqHXWzA3xwPtLNA6sT6w6f 4WoWJ+IoqgUfs+of9oDnG6ssb8aydnjROvkqjQaSiRSQ+idFVOSeuSuwWnnNMDHQd9ZY fNY37yiIC0qb2YYUmPVih0bsPteNJvcjudCqRbH53wmEkMIvi/qOfUiXTilA3rGwUUbd usQg1PN5X1GJ2Rw1ymltBh9Gdb5sZRU2Sk44bGawLUvqk9e4xtWVL1qD9WqwSOKtovg0 Pk6w== X-Gm-Message-State: AOPr4FVSrUqZzj6PNGOJHRL5mb8m+Zzzn1k8Ol397QSEArLrMFt05QkII2Lltr30DBAlV4tt70rMGoKN07EFo03o X-Received: by 10.50.155.36 with SMTP id vt4mr18542829igb.0.1460969437820; Mon, 18 Apr 2016 01:50:37 -0700 (PDT) Original-Received: by 10.64.41.169 with HTTP; Mon, 18 Apr 2016 01:50:37 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116584 Archived-At: --001a11381bf65eeca10530be7498 Content-Type: text/plain; charset=UTF-8 I applied the patch, and the paste-on-click behavior is gone. However, if you try your original example again, you'll find that nothing happens at all, when we're expecting an "a" to be inserted. As the documentation of mouse-on-link-p says, a string or vector return value indicates the event to translate the original mouse-1 click into. In emacs24, that translation was done in mouse-drag-track: (let (on-link (and mouse-1-click-follows-link ;; Use start-point before the intangibility ;; treatment, in case we click on a link inside ;; intangible text. (mouse-on-link-p start-posn))) (if (or (vectorp on-link) (stringp on-link)) (setq event (aref on-link 0)) (select-window original-window) (setcar event 'mouse-2) ;; If this mouse click has never been done by the ;; user, it doesn't have the necessary property to be ;; interpreted correctly. (put 'mouse-2 'event-kind 'mouse-click))) (abridged from mouse.el:791/901 in Emacs 24.3.1) I think mouse--down-1-maybe-follows-link should do something similar. On Sat, Apr 16, 2016 at 3:36 PM, Philipp Stephani wrote: > > > Nils Berg schrieb am Do., 14. Apr. 2016 um 19:18 Uhr: > >> I've tracked down the bug to mouse--down-1-maybe-follows-link too, but >> don't think read-event is the culprit here. >> >> Rather, mouse--down-1-maybe-follows-link discards the result of >> mouse-on-link-p, which contains the event a click is supposed to be >> translated into. Instead, it just replaces the mouse event with mouse-2 if >> mouse-on-link-p returns non-nil. >> > > I've attached a patch that should fix this. According to the documentation > of mouse-on-link-p no such translation should happen if the return value is > a string or vector. > --001a11381bf65eeca10530be7498 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I applied the patch, and the paste-on-click behavior is go= ne.

However, if you try your original example again, you= 'll find that nothing happens at all, when we're expecting an "= ;a" to be inserted.
As the documentation of mouse-on-link-p = says, a string or vector return value indicates the event to translate the = original mouse-1 click into. In emacs24, that translation was done in mouse= -drag-track:
(let (on-link (and mouse-1-click-follows-link
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0;; Use start-point before the intangibility
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0;; treatment, in case we click on a link inside
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;;= intangible text.
=C2=A0 (mouse-on-link-p start-posn)))
= =C2=A0 (if (or (vectorp on-link) (stringp on-link))
=C2=A0(setq e= vent (aref on-link 0))
(select-window original-window)
(setca= r event 'mouse-2)
;; If this mouse click has never been done by= the
;; user, it doesn't have the necessary property to be
=
;; interpreted correctly.
(put 'mouse-2 'event-kind 'm= ouse-click)))

(abridged from mouse.el:791/90= 1 in Emacs 24.3.1)

I think mouse--down-1-maybe-fol= lows-link should do something similar.

On Sat, Apr 16, 2016 at 3:36 PM, Phili= pp Stephani <p.stephani2@gmail.com> wrote:


Nils Berg <nilsb@google.com> schrieb am Do., 14. Apr. = 2016 um 19:18=C2=A0Uhr:
I've tracked down the bug to mouse--down-1-maybe-follows-link too= , but don't think read-event is the culprit here.

Ra= ther, mouse--down-1-maybe-follows-link discards the result of mouse-on-link= -p, which contains the event a click is supposed to be translated into. Ins= tead, it just replaces the mouse event with mouse-2 if mouse-on-link-p retu= rns non-nil.

I've at= tached a patch that should fix this. According to the documentation of mous= e-on-link-p no such translation should happen if the return value is a stri= ng or vector.=C2=A0

--001a11381bf65eeca10530be7498--