From: David De La Harpe Golden <david@harpegolden.net>
To: 6635@debbugs.gnu.org
Subject: bug#6635: mouse-yank-primary/secondary and unicode from other apps.
Date: Thu, 15 Jul 2010 01:38:11 +0100 [thread overview]
Message-ID: <4C3E5873.9090909@harpegolden.net> (raw)
[-- 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,
next reply other threads:[~2010-07-15 0:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-15 0:38 David De La Harpe Golden [this message]
2010-07-15 5:29 ` bug#6635: mouse-yank-primary/secondary and unicode from other apps 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C3E5873.9090909@harpegolden.net \
--to=david@harpegolden.net \
--cc=6635@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).