From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.bugs Subject: bug#6635: mouse-yank-primary/secondary and unicode from other apps. Date: Thu, 15 Jul 2010 01:38:11 +0100 Message-ID: <4C3E5873.9090909@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000902020902080600030409" X-Trace: dough.gmane.org 1279155631 16240 80.91.229.12 (15 Jul 2010 01:00:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 01:00:31 +0000 (UTC) To: 6635@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 15 03:00:30 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZCoP-0005Ww-9X for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jul 2010 03:00:29 +0200 Original-Received: from localhost ([127.0.0.1]:43706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZCoO-0002rI-OM for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Jul 2010 21:00:28 -0400 Original-Received: from [140.186.70.92] (port=36195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZCoI-0002rD-0h for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 21:00:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZCoG-0001UV-Th for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 21:00:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36754) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZCoG-0001UN-R2 for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 21:00:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OZCTe-0004EW-FH; Wed, 14 Jul 2010 20:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David De La Harpe Golden Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2010 00:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6635 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127915428816254 (code B ref -1); Thu, 15 Jul 2010 00:39:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jul 2010 00:38:08 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZCSl-0004E7-TS for submit@debbugs.gnu.org; Wed, 14 Jul 2010 20:38:08 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZCSk-0004Dl-PF for submit@debbugs.gnu.org; Wed, 14 Jul 2010 20:38:07 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:39878) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OZCSu-0006w6-5F for submit@debbugs.gnu.org; Wed, 14 Jul 2010 20:38:16 -0400 Original-Received: from [140.186.70.92] (port=41175 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZCSs-0006mT-Ll for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 20:38:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZCSr-0007gZ-MM for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 20:38:14 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:41718) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZCSr-0007gT-G0 for bug-gnu-emacs@gnu.org; Wed, 14 Jul 2010 20:38:13 -0400 Original-Received: from [87.198.54.10] (87-198-54-10.ptr.magnet.ie [87.198.54.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id C3D9C68422 for ; Thu, 15 Jul 2010 01:38:10 +0100 (IST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100620 Icedove/3.0.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 14 Jul 2010 20:39:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38528 Archived-At: This is a multi-part message in MIME format. --------------000902020902080600030409 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit mouse-yank-primary and mouse-yank-secondary don't like inserting non-ascii chars from other apps. They need to use the slightly higher-level (x-selection-value 'PRIMARY) or at least give a 'TEXT arg to their (x-get-selection 'PRIMARY 'TEXT), so that the proper kinds of selection type are tried as e.g. attached. --------------000902020902080600030409 Content-Type: text/x-patch; name="myp-encode_r1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="myp-encode_r1.diff" === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-07-14 18:03:39 +0000 +++ lisp/mouse.el 2010-07-15 00:32:41 +0000 @@ -1277,19 +1277,19 @@ (interactive "e") ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) (when select-active-regions ;; Without this, confusing things happen upon e.g. inserting into ;; the middle of an active region. (deactivate-mark)) (or mouse-yank-at-point (mouse-set-point click)) - (let ((primary (x-get-selection 'PRIMARY))) + (let ((primary (x-selection-value 'PRIMARY))) (if primary - (insert (x-get-selection 'PRIMARY)) + (insert (x-selection-value 'PRIMARY)) (error "No primary selection")))) (defun mouse-kill-ring-save (click) "Copy the region between point and the mouse click in the kill ring. This does not delete the region; it acts like \\[kill-ring-save]." (interactive "e") (mouse-set-mark-fast click) (let (this-command last-command) @@ -1572,19 +1572,19 @@ "Insert the secondary selection at the position clicked on. Move point to the end of the inserted text. If `mouse-yank-at-point' is non-nil, insert at point regardless of where you click." (interactive "e") ;; Give temporary modes such as isearch a chance to turn off. (run-hooks 'mouse-leave-buffer-hook) (or mouse-yank-at-point (mouse-set-point click)) - (let ((secondary (x-get-selection 'SECONDARY))) + (let ((secondary (x-selection-value 'SECONDARY))) (if secondary - (insert (x-get-selection 'SECONDARY)) + (insert (x-selection-value 'SECONDARY)) (error "No secondary selection")))) (defun mouse-kill-secondary () "Kill the text in the secondary selection. This is intended more as a keyboard command than as a mouse command but it can work as either one. The current buffer (in case of keyboard use), or the buffer clicked on, --------------000902020902080600030409--