GNU bug report logs - #6635
mouse-yank-primary/secondary and unicode from other apps.

Previous Next

Package: emacs;

Reported by: David De La Harpe Golden <david <at> harpegolden.net>

Date: Thu, 15 Jul 2010 00:39:02 UTC

Severity: normal

Merged with 6802

Found in version 24.0.50

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#6635: mouse-yank-primary/secondary and unicode from other apps.
Date: Wed, 14 Jul 2010 23:29:11 -0600
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





This bug report was last modified 13 years and 233 days ago.

Previous Next


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