GNU bug report logs - #20906
25.0.50; Pasting unicode from external applications with mouse wheel on Unix

Previous Next

Package: emacs;

Reported by: Boris Kheyfets <kheyfboris <at> gmail.com>

Date: Fri, 26 Jun 2015 21:26:02 UTC

Severity: normal

Merged with 19310

Found in version 25.0.50

Done: Andreas Schwab <schwab <at> suse.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andreas Schwab <schwab <at> suse.de>
To: Mike FABIAN <mfabian <at> redhat.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 20906 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#20906: 25.0.50;
Date: Thu, 08 Oct 2015 16:02:05 +0200
Mike FABIAN <mfabian <at> redhat.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> さんはかきました:
>
>> If the data we receive is different, I guess the only explanation
>> could be that we request it in some different way?
>
> Yes, in the old code
>
>    (defun x-get-selection (&optional type data-type)
>
> is called with “'UTF8_STRING” in data-type,
> in the new code 
>
>    (defun gui-get-selection (&optional type data-type)
>
> is called with “nil” in data type.
>
> That seems to make the difference, evaluating
>
>     (gui-get-selection 'PRIMARY 'UTF8_STRING)
>
> gets the selection correctly using the new code,  
>
>     (gui-get-selection 'PRIMARY)
>
> produces the problem I am seeing. 
>
> I still now know why this is called differently, looking ...

This:

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 93bd628..f569ec3 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1068,24 +1068,7 @@ regardless of where you click."
     (let (select-active-regions)
       (deactivate-mark)))
   (or mouse-yank-at-point (mouse-set-point click))
-  (let ((primary
-         (if (fboundp 'x-get-selection-value)
-             (if (eq (framep (selected-frame)) 'w32)
-                 ;; MS-Windows emulates PRIMARY in x-get-selection, but not
-                 ;; in x-get-selection-value (the latter only accesses the
-                 ;; clipboard).  So try PRIMARY first, in case they selected
-                 ;; something with the mouse in the current Emacs session.
-                 (or (x-get-selection 'PRIMARY)
-                     (x-get-selection-value))
-               ;; Else MS-DOS or X.
-               ;; On X, x-get-selection-value supports more formats and
-               ;; encodings, so use it in preference to x-get-selection.
-               (or (x-get-selection-value)
-                   (x-get-selection 'PRIMARY)))
-           ;; FIXME: What about xterm-mouse-mode etc.?
-           (x-get-selection 'PRIMARY))))
-    (unless primary
-      (error "No selection is available"))
+  (let ((primary (gui-get-primary-selection)))
     (push-mark (point))
     (insert-for-yank primary)))
 

The comment is there for a reason...

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




This bug report was last modified 9 years and 282 days ago.

Previous Next


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