From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.bugs Subject: bug#6677: 24.0.50; NS variant cannot copy to pasteboard correctly Date: Mon, 09 Aug 2010 00:01:25 +0100 Message-ID: <4C5F3745.8020901@harpegolden.net> References: <3F766F47-ADAC-45DA-9F56-27E576362DB8@Freenet.DE> <4C4620D0.70704@harpegolden.net> <4C4BE029.7010804@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030204030409010700030504" X-Trace: dough.gmane.org 1281308927 24729 80.91.229.12 (8 Aug 2010 23:08:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 Aug 2010 23:08:47 +0000 (UTC) Cc: Peter Dyballa To: 6677@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 09 01:08:45 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 1OiEys-0007kr-7E for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Aug 2010 01:08:43 +0200 Original-Received: from localhost ([127.0.0.1]:54297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiEyl-0005Ff-IM for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Aug 2010 19:08:31 -0400 Original-Received: from [140.186.70.92] (port=60021 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiEye-0005FT-Di for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 19:08:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiEyc-00052p-7D for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 19:08:23 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58620) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiEyc-00052j-55 for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 19:08:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OiErW-0007Ka-7H; Sun, 08 Aug 2010 19:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David De La Harpe Golden Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Aug 2010 23:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6677 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6677-submit@debbugs.gnu.org id=B6677.128130845028173 (code B ref 6677); Sun, 08 Aug 2010 23:01:02 +0000 Original-Received: (at 6677) by debbugs.gnu.org; 8 Aug 2010 23:00:50 +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 1OiErJ-0007KM-Tt for submit@debbugs.gnu.org; Sun, 08 Aug 2010 19:00:50 -0400 Original-Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiErH-0007KF-E5 for 6677@debbugs.gnu.org; Sun, 08 Aug 2010 19:00:48 -0400 Original-Received: from [87.198.55.108] (87-198-55-108.ptr.magnet.ie [87.198.55.108]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id 7B750684DD; Mon, 9 Aug 2010 00:01:23 +0100 (IST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100620 Icedove/3.0.5 In-Reply-To: <4C4BE029.7010804@harpegolden.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 08 Aug 2010 19:01:02 -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:39323 Archived-At: This is a multi-part message in MIME format. --------------030204030409010700030504 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25/07/10 07:56, David De La Harpe Golden wrote: > x11 side ns side > CLIPBOARD General Pasteboard > PRIMARY "Selection" named pasteboard > SECONDARY "Secondary" named pasteboard Updated patch that at least does this. There are be remaining issues, but it should work a bit better on macosx as well. --------------030204030409010700030504 Content-Type: text/x-patch; name="ns-clipboard-pboard_r2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ns-clipboard-pboard_r2.diff" === 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-08 22:40:49 +0000 @@ -998,25 +998,25 @@ ;;;; Pasteboard support. (declare-function ns-get-cut-buffer-internal "nsselect.m" (buffer)) (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)) (defun ns-set-pasteboard (string) "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 ;; from x-cut-buffer-or-selection-value. (defvar ns-last-selected-text nil) (defun x-select-text (text &optional push) "Select TEXT, a string, according to the window system. === modified file 'src/nsselect.m' --- src/nsselect.m 2010-07-08 21:25:08 +0000 +++ src/nsselect.m 2010-08-08 20:42:05 +0000 @@ -31,51 +31,56 @@ #include #include "lisp.h" #include "nsterm.h" #include "termhooks.h" #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; static Lisp_Object Vselection_alist; static Lisp_Object Vselection_converter_alist; static Lisp_Object Qforeign_selection; -NSString *NXSecondaryPboard; +/* CLIPBOARD mapped to NSGeneralPboard */ +NSString *NXPrimaryPboard; +NSString *NXSecondaryPboard; /* ========================================================================== Internal utility functions ========================================================================== */ static NSString * 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)]; } static Lisp_Object ns_string_to_symbol (NSString *t) { if ([t isEqualToString: NSGeneralPboard]) + return QCLIPBOARD; + if ([t isEqualToString: NXPrimaryPboard]) return QPRIMARY; if ([t isEqualToString: NXSecondaryPboard]) return QSECONDARY; if ([t isEqualToString: NSStringPboardType]) return QTEXT; if ([t isEqualToString: NSFilenamesPboardType]) return QFILE_NAME; if ([t isEqualToString: NSTabularTextPboardType]) @@ -531,22 +536,27 @@ return Qnil; } #endif void nxatoms_of_nsselect (void) { - NXSecondaryPboard = @"Selection"; + /* These are the names GNUStep's pasteboard daemon uses, + using them for interoperability */ + + NXPrimaryPboard = @"Selection"; + NXSecondaryPboard = @"Secondary"; } 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); QFILE_NAME = intern ("FILE_NAME"); staticpro (&QFILE_NAME); defsubr (&Sx_disown_selection_internal); defsubr (&Sx_get_selection_internal); defsubr (&Sx_own_selection_internal); --------------030204030409010700030504--