From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: bug#6635: mouse-yank-primary/secondary and unicode from other apps. Date: Wed, 14 Jul 2010 23:29:11 -0600 Message-ID: References: <4C3E5873.9090909@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279171835 17718 80.91.229.12 (15 Jul 2010 05:30:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 05:30:35 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 15 07:30:34 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 1OZH1j-0001gI-Je for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jul 2010 07:30:31 +0200 Original-Received: from localhost ([127.0.0.1]:34532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZH1i-0006mU-RE for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jul 2010 01:30:30 -0400 Original-Received: from [140.186.70.92] (port=53883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZH1Z-0006lF-J1 for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:30:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZH1Y-0000hh-8O for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:30:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57781) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZH1Y-0000ha-3F for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:30:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OZH1I-000630-7i; Thu, 15 Jul 2010 01:30:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kevin Rodgers 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 05:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6635 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.127917176723219 (code B ref -1); Thu, 15 Jul 2010 05:30:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jul 2010 05:29:27 +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 1OZH0h-00062S-6V for submit@debbugs.gnu.org; Thu, 15 Jul 2010 01:29:27 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZH0f-00062L-5E for submit@debbugs.gnu.org; Thu, 15 Jul 2010 01:29:26 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:56328) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OZH0o-0002RC-Uw for submit@debbugs.gnu.org; Thu, 15 Jul 2010 01:29:35 -0400 Original-Received: from [140.186.70.92] (port=53771 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZH0n-0006db-AP for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:29:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZH0m-0000b6-1q for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:29:33 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:39832) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZH0l-0000av-PM for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 01:29:32 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OZH0e-0001EJ-Bk for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2010 07:29:24 +0200 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 07:29:24 +0200 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 07:29:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) In-Reply-To: <4C3E5873.9090909@harpegolden.net> 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: Thu, 15 Jul 2010 01:30:04 -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:38529 Archived-At: David De La Harpe Golden wrote: > 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. ... - (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")))) ... - (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")))) Can someone explain why the result of x-get-selection/x-selection-value is bound to a variable, but instead of referencing the variable in the insert function call the expression is evaluated again? I.e. why not change it to: (let ((primary (x-selection-value 'PRIMARY))) (if primary (insert primary) (error "No primary selection")))) ... (let ((secondary (x-selection-value 'SECONDARY))) (if secondary (insert secondary) (error "No secondary selection")))) Thanks, -- Kevin Rodgers Denver, Colorado, USA