From: Jan D Date: Wed, 18 Aug 2010 06:16:55 +0000 (+0200) Subject: Use CLIPBOARD and PRIMARY on NS (Bug#6677). X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~259 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=64cb6c788376c364c8e27e99c97921ad3a308963;p=emacs.git Use CLIPBOARD and PRIMARY on NS (Bug#6677). * lisp/term/ns-win.el (ns-get-pasteboard, ns-set-pasteboard): Use QCLIPBOARD instead of QPRIMARY (Bug#6677). * src/nsselect.m (QCLIPBOARD, NXPrimaryPboard): Define. (symbol_to_nsstring): Map QCLIPBOARD => NSGeneralPboard, QPRIMARY => NXPrimaryPboard. (ns_string_to_symbol): NSGeneralPboard => QCLIPBOARD, NXPrimaryPboard => QPRIMARY. (nxatoms_of_nsselect): NXPrimaryPboard = PrimarySelection, NXSecondaryPboard = SecondarySelection. (syms_of_nsselect): Intern QCLIPBOARD (Bug#6677). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2803ec0a488..e9712bd80dd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-08-18 Jan Djärv + + * term/ns-win.el (ns-get-pasteboard, ns-set-pasteboard): Use + QCLIPBOARD instead of QPRIMARY (Bug#6677). + 2010-08-17 Stefan Monnier * emacs-lisp/lisp.el (up-list): Obey forward-sexp-function if set. diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index f73b3d7e67e..d42632c3f23 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -1003,7 +1003,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (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 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") "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 diff --git a/src/ChangeLog b/src/ChangeLog index 29d3294210c..589265586c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2010-08-18 David De La Harpe Golden + + * nsselect.m (QCLIPBOARD, NXPrimaryPboard): Define. + (symbol_to_nsstring): Map QCLIPBOARD => NSGeneralPboard, + QPRIMARY => NXPrimaryPboard. + (ns_string_to_symbol): NSGeneralPboard => QCLIPBOARD, + NXPrimaryPboard => QPRIMARY. + (nxatoms_of_nsselect): NXPrimaryPboard = PrimarySelection, + NXSecondaryPboard = SecondarySelection. + (syms_of_nsselect): Intern QCLIPBOARD (Bug#6677). + 2010-08-17 Stefan Monnier * gtkutil.c (update_frame_tool_bar): Don't assume TOOL_BAR_ITEM_LABEL diff --git a/src/nsselect.m b/src/nsselect.m index f7e69964910..597d6e76253 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -37,7 +37,7 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu) #define CUT_BUFFER_SUPPORT -Lisp_Object QSECONDARY, QTEXT, QFILE_NAME; +Lisp_Object QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME; static Lisp_Object Vns_sent_selection_hooks; static Lisp_Object Vns_lost_selection_hooks; @@ -46,6 +46,8 @@ static Lisp_Object Vselection_converter_alist; static Lisp_Object Qforeign_selection; +/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */ +NSString *NXPrimaryPboard; NSString *NXSecondaryPboard; @@ -61,7 +63,8 @@ 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)]; @@ -72,6 +75,8 @@ 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; @@ -537,12 +542,14 @@ DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal, void nxatoms_of_nsselect (void) { - NXSecondaryPboard = @"Selection"; + NXPrimaryPboard = @"PrimarySelection"; + NXSecondaryPboard = @"SecondarySelection"; } void syms_of_nsselect (void) { + QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD); QSECONDARY = intern ("SECONDARY"); staticpro (&QSECONDARY); QTEXT = intern ("TEXT"); staticpro (&QTEXT); QFILE_NAME = intern ("FILE_NAME"); staticpro (&QFILE_NAME);