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: Tue, 20 Jul 2010 23:18:56 +0100 Message-ID: <4C4620D0.70704@harpegolden.net> References: <3F766F47-ADAC-45DA-9F56-27E576362DB8@Freenet.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040900070007080207080108" X-Trace: dough.gmane.org 1279665063 10453 80.91.229.12 (20 Jul 2010 22:31:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Jul 2010 22:31:03 +0000 (UTC) Cc: Peter Dyballa , Chong Yidong To: 6677@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 21 00:31:00 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 1ObLL1-0004b4-UG for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Jul 2010 00:31:00 +0200 Original-Received: from localhost ([127.0.0.1]:56962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObLL0-0003tY-TW for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Jul 2010 18:30:58 -0400 Original-Received: from [140.186.70.92] (port=33426 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObLKm-0003qU-Nd for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2010 18:30:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObLKk-00087d-Nk for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2010 18:30:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49465) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObLKk-00087Z-MM for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2010 18:30:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ObL9S-0005rK-Qv; Tue, 20 Jul 2010 18:19: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: Tue, 20 Jul 2010 22:19: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.127966431822502 (code B ref 6677); Tue, 20 Jul 2010 22:19:02 +0000 Original-Received: (at 6677) by debbugs.gnu.org; 20 Jul 2010 22:18:38 +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 1ObL93-0005qs-Kj for submit@debbugs.gnu.org; Tue, 20 Jul 2010 18:18:37 -0400 Original-Received: from harpegolden.net ([65.99.215.13]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObL90-0005qn-SF for 6677@debbugs.gnu.org; Tue, 20 Jul 2010 18:18:35 -0400 Original-Received: from [87.198.55.208] (87-198-55-208.ptr.magnet.ie [87.198.55.208]) (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 7172B68436; Tue, 20 Jul 2010 23:18:56 +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: <3F766F47-ADAC-45DA-9F56-27E576362DB8@Freenet.DE> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 20 Jul 2010 18:19: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:38704 Archived-At: This is a multi-part message in MIME format. --------------040900070007080207080108 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 20/07/10 11:13, Peter Dyballa wrote: > Hello! > > Although it obviously works to copy some text in an X client or in a Ma= c > OS X application and paste it into the *scratch* buffer it does not wor= k > to mark some text in any buffer of the NS variant and either use the > Copy entry from the Edit menu or just press =E2=8C=98-C (Cmd-C) and ins= ert > (paste) it into the X client or a Mac OS X application (the name of the > application in the =EF=A3=BF bar only flashes, because some bad content= , not > fitting into the text pane, is held in pasteboard?). > My MacOSX/GNUStep/ObjC, while not quite non-existent, is not amazing. But it looks to me like src/nsselect.m needs some adjustment so it can=20 handle recent changes to defaults (and N.B. in fact to handle settings=20 that have been possible for a long time) It looks like it has been mapping NSGeneralPBoard (the macosx "normal"=20 cut/copy/paste clipboard) to an emulated X11 PRIMARY, when in fact=20 NSGeneralPBoard is much more closely analagous to X11 CLIPBOARD. *** Since x11 emacs is now actually using X11 CLIPBOARD, it is likely=20 that the attached _untested_ but minor patch or something very like it=20 is correct on nextstep. Can you try building an emacs with the patch on macosx? Note that even with the patch applied, it may not act quite the same as=20 before, but that is not necessarily a bug but rather a change. (N.B. it should be possible to get historical behaviour back (even=20 though looking at nsselect.m it was probably a bit odd) by twiddling=20 customizations). > Additionally double-click to mark a word is interpreted as > , bound to mouse-drag-region. I don't think tha= t > this is desirable... N.B. Mouse-drag-region calls mouse-drag-track which calls=20 mouse-start-end to _implement_ double-click to mark a word, perhaps not=20 intuitively given the name. So does double-clicking nonetheless actually=20 mark the word on NS? --------------040900070007080207080108 Content-Type: text/x-patch; name="ns-clipboard-pboard_r1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ns-clipboard-pboard_r1.diff" --- src/nsselect.m.orig 2010-07-20 22:44:08.000000000 +0100 +++ src/nsselect.m 2010-07-20 22:53:05.000000000 +0100 @@ -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; +/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */ +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,24 @@ return Qnil; } #endif 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); QFILE_NAME = intern ("FILE_NAME"); staticpro (&QFILE_NAME); defsubr (&Sx_disown_selection_internal); defsubr (&Sx_get_selection_internal); defsubr (&Sx_own_selection_internal); --------------040900070007080207080108--