unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6635: mouse-yank-primary/secondary and unicode from other apps.
@ 2010-07-15  0:38 David De La Harpe Golden
  2010-07-15  5:29 ` Kevin Rodgers
  2011-10-06 21:42 ` Glenn Morris
  0 siblings, 2 replies; 5+ messages in thread
From: David De La Harpe Golden @ 2010-07-15  0:38 UTC (permalink / raw)
  To: 6635

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

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.







[-- Attachment #2: myp-encode_r1.diff --]
[-- Type: text/x-patch, Size: 1919 bytes --]

=== 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,


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-06 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15  0:38 bug#6635: mouse-yank-primary/secondary and unicode from other apps David De La Harpe Golden
2010-07-15  5:29 ` Kevin Rodgers
2010-07-18 16:39   ` David De La Harpe Golden
2011-10-06 21:42 ` Glenn Morris
2011-10-06 23:17   ` David De La Harpe Golden

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).