From: "Jan Djärv" <jan.h.d@swipnet.se>
To: "Randal L. Schwartz" <merlyn@stonehenge.com>
Cc: emacs-devel@gnu.org
Subject: Re: "pasteboard doesn't contain valid data" on OSX
Date: Sun, 08 Aug 2010 21:17:33 +0200 [thread overview]
Message-ID: <4C5F02CD.6050500@swipnet.se> (raw)
In-Reply-To: <86y6ci5jbn.fsf@red.stonehenge.com>
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
It is known. Part of the selection-changes being done.
The attached patch fixes it (nsselect.m changes by David De La Harpe Golden).
Jan D.
Randal L. Schwartz skrev 2010-08-07 21.11:
>
> This is recently broken. "pasteboard doesn't contain valid data"
> on any use of ^Y paste after any kind of cut or copy within Emacs.
>
> Pasting *does* seem to work if the text came from another application
> though, so it's more likely the copy/cut operation in emacs.
>
> I haven't had time to bisect yet, but hopefully this will ring a bell
> for someone to go investigate.
>
[-- Attachment #2: clipboard.diff --]
[-- Type: text/plain, Size: 2591 bytes --]
=== modified file 'lisp/term/ns-win.el'
--- lisp/term/ns-win.el 2010-07-13 10:41:49 +0000
+++ lisp/term/ns-win.el 2010-08-06 10:52:23 +0000
@@ -1003,7 +1003,7 @@
(defun ns-get-pasteboard ()
"Returns the value of the pasteboard."
- (ns-get-cut-buffer-internal 'PRIMARY))
+ (ns-get-cut-buffer-internal 'CLIPBOARD))
(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string))
@@ -1011,7 +1011,7 @@
"Store STRING into the pasteboard of the Nextstep display server."
;; Check the data type of STRING.
(if (not (stringp string)) (error "Nonstring given to pasteboard"))
- (ns-store-cut-buffer-internal 'PRIMARY string))
+ (ns-store-cut-buffer-internal 'CLIPBOARD string))
;; We keep track of the last text selected here, so we can check the
;; current selection against it, and avoid passing back our own text
=== modified file 'src/nsselect.m'
--- src/nsselect.m 2010-07-08 21:25:08 +0000
+++ src/nsselect.m 2010-08-06 10:46:52 +0000
@@ -36,7 +36,7 @@
#define CUT_BUFFER_SUPPORT
-Lisp_Object QPRIMARY, QSECONDARY, QTEXT, QFILE_NAME;
+Lisp_Object QCLIPBOARD, QPRIMARY, QSECONDARY, QTEXT, QFILE_NAME;
static Lisp_Object Vns_sent_selection_hooks;
static Lisp_Object Vns_lost_selection_hooks;
@@ -45,6 +45,8 @@
static Lisp_Object Qforeign_selection;
+/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */
+NSString *NXPrimaryPboard;
NSString *NXSecondaryPboard;
@@ -60,7 +62,8 @@
symbol_to_nsstring (Lisp_Object sym)
{
CHECK_SYMBOL (sym);
- if (EQ (sym, QPRIMARY)) return NSGeneralPboard;
+ if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard;
+ if (EQ (sym, QPRIMARY)) return NXPrimaryPboard;
if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
if (EQ (sym, QTEXT)) return NSStringPboardType;
return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)];
@@ -71,6 +74,8 @@
ns_string_to_symbol (NSString *t)
{
if ([t isEqualToString: NSGeneralPboard])
+ return QCLIPBOARD;
+ if ([t isEqualToString: NXPrimaryPboard])
return QPRIMARY;
if ([t isEqualToString: NXSecondaryPboard])
return QSECONDARY;
@@ -536,12 +541,14 @@
void
nxatoms_of_nsselect (void)
{
- NXSecondaryPboard = @"Selection";
+ NXPrimaryPboard = @"PrimarySelection";
+ NXSecondaryPboard = @"SecondarySelection";
}
void
syms_of_nsselect (void)
{
+ QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD);
QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY);
QSECONDARY = intern ("SECONDARY"); staticpro (&QSECONDARY);
QTEXT = intern ("TEXT"); staticpro (&QTEXT);
next prev parent reply other threads:[~2010-08-08 19:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-07 19:11 "pasteboard doesn't contain valid data" on OSX Randal L. Schwartz
2010-08-08 19:17 ` Jan Djärv [this message]
2010-08-08 21:07 ` David De La Harpe Golden
2010-08-08 22:58 ` David De La Harpe Golden
2010-08-09 7:35 ` "pasteboard doesn't contain valid data" " Adrian Robert
2010-08-21 19:32 ` "pasteboard doesn't contain valid data" " Randal L. Schwartz
2010-08-09 6:25 ` Jan Djärv
2010-08-09 20:46 ` David De La Harpe Golden
2010-08-11 14:23 ` Randal L. Schwartz
2010-08-11 14:51 ` Jan Djärv
2010-08-11 14:53 ` Randal L. Schwartz
2010-08-11 15:10 ` Jan Djärv
2010-08-11 18:37 ` Chad Brown
2010-08-11 18:51 ` Leo
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C5F02CD.6050500@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=emacs-devel@gnu.org \
--cc=merlyn@stonehenge.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.