/* NeXT/Open/GNUstep / MacOSX Cocoa selection processing for emacs.
- Copyright (C) 1993, 1994, 2005, 2006, 2008
+ Copyright (C) 1993, 1994, 2005, 2006, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
#include "config.h"
+#include <setjmp.h>
+
#include "lisp.h"
#include "nsterm.h"
#include "termhooks.h"
static Lisp_Object Vselection_alist;
static Lisp_Object Vselection_converter_alist;
-/* 23: new */
-/* Coding system for communicating with other programs. */
-static Lisp_Object Vselection_coding_system;
-/* Coding system for the next communicating with other programs. */
-static Lisp_Object Vnext_selection_coding_system;
static Lisp_Object Qforeign_selection;
NSString *NXSecondaryPboard;
if (EQ (sym, QPRIMARY)) return NSGeneralPboard;
if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
if (EQ (sym, QTEXT)) return NSStringPboardType;
- return [NSString stringWithUTF8String: XSTRING (XSYMBOL (sym)->xname)->data];
+ return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)];
}
return clean_local_selection_data (AREF (obj, 0));
copy = Fmake_vector (make_number (size), Qnil);
for (i = 0; i < size; i++)
- AREF (copy, i) = clean_local_selection_data (AREF (obj, i));
+ ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
return copy;
}
CHECK_STRING (str);
- utfStr = XSTRING (str)->data;
+ utfStr = SDATA (str);
nsStr = [NSString stringWithUTF8String: utfStr];
if (gtype == nil)
========================================================================== */
-DEFUN ("ns-own-selection-internal", Fns_own_selection_internal,
- Sns_own_selection_internal, 2, 2, 0, "Assert a selection.")
+DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
+ Sx_own_selection_internal, 2, 2, 0,
+ doc: /* Assert a selection.
+SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+VALUE is typically a string, or a cons of two markers, but may be
+anything that the functions on `selection-converter-alist' know about. */)
(selection_name, selection_value)
Lisp_Object selection_name, selection_value;
{
}
-DEFUN ("ns-disown-selection-internal", Fns_disown_selection_internal,
- Sns_disown_selection_internal, 1, 2, 0,
- "If we own the selection SELECTION, disown it.")
+DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
+ Sx_disown_selection_internal, 1, 2, 0,
+ doc: /* If we own the selection SELECTION, disown it. */)
(selection_name, time)
Lisp_Object selection_name, time;
{
}
-DEFUN ("ns-selection-exists-p", Fns_selection_exists_p, Sns_selection_exists_p,
- 0, 1, 0, "Whether there is an owner for the given selection.\n\
-The arg should be the name of the selection in question, typically one of\n\
-the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\
-\(Those are literal upper-case symbol names.)\n\
-For convenience, the symbol nil is the same as `PRIMARY',\n\
-and t is the same as `SECONDARY'.)")
+DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
+ 0, 1, 0, doc: /* Whether there is an owner for the given selection.
+The arg should be the name of the selection in question, typically one of
+the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names.)
+For convenience, the symbol nil is the same as `PRIMARY',
+and t is the same as `SECONDARY'.) */)
(selection)
Lisp_Object selection;
{
}
-DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p,
+DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
0, 1, 0,
- "Whether the current Emacs process owns the given selection.\n\
-The arg should be the name of the selection in question, typically one of\n\
-the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\
-\(Those are literal upper-case symbol names.)\n\
-For convenience, the symbol nil is the same as `PRIMARY',\n\
-and t is the same as `SECONDARY'.)")
+ doc: /* Whether the current Emacs process owns the given selection.
+The arg should be the name of the selection in question, typically one of
+the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names.)
+For convenience, the symbol nil is the same as `PRIMARY',
+and t is the same as `SECONDARY'.) */)
(selection)
Lisp_Object selection;
{
}
-DEFUN ("ns-get-selection-internal", Fns_get_selection_internal,
- Sns_get_selection_internal, 2, 2, 0,
- "Return text selected from some pasteboard.\n\
-SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.\n\
-\(Those are literal upper-case symbol names.)\n\
-TYPE is the type of data desired, typically `STRING'.")
+DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
+ Sx_get_selection_internal, 2, 2, 0,
+ doc: /* Return text selected from some pasteboard.
+SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+\(Those are literal upper-case symbol names.)
+TYPE is the type of data desired, typically `STRING'. */)
(selection_name, target_type)
Lisp_Object selection_name, target_type;
{
#ifdef CUT_BUFFER_SUPPORT
DEFUN ("ns-get-cut-buffer-internal", Fns_get_cut_buffer_internal,
Sns_get_cut_buffer_internal, 1, 1, 0,
- "Returns the value of the named cut buffer.")
+ doc: /* Returns the value of the named cut buffer. */)
(buffer)
Lisp_Object buffer;
{
DEFUN ("ns-rotate-cut-buffers-internal", Fns_rotate_cut_buffers_internal,
Sns_rotate_cut_buffers_internal, 1, 1, 0,
- "Rotate the values of the cut buffers by the given number of steps;\n\
- positive means move values forward, negative means backward. CURRENTLY NOT IMPLEMENTED UNDER NeXTstep.")
+ doc: /* Rotate the values of the cut buffers by N steps.
+Positive N means move values forward, negative means
+backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ )
(n)
Lisp_Object n;
{
DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal,
Sns_store_cut_buffer_internal, 2, 2, 0,
- "Sets the value of the named cut buffer (typically CUT_BUFFER0).")
+ doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */)
(buffer, string)
Lisp_Object buffer, string;
{
QTEXT = intern ("TEXT"); staticpro (&QTEXT);
QFILE_NAME = intern ("FILE_NAME"); staticpro (&QFILE_NAME);
- defsubr (&Sns_disown_selection_internal);
- defsubr (&Sns_get_selection_internal);
- defsubr (&Sns_own_selection_internal);
- defsubr (&Sns_selection_exists_p);
- defsubr (&Sns_selection_owner_p);
+ defsubr (&Sx_disown_selection_internal);
+ defsubr (&Sx_get_selection_internal);
+ defsubr (&Sx_own_selection_internal);
+ defsubr (&Sx_selection_exists_p);
+ defsubr (&Sx_selection_owner_p);
#ifdef CUT_BUFFER_SUPPORT
defsubr (&Sns_get_cut_buffer_internal);
defsubr (&Sns_rotate_cut_buffers_internal);
\(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD').");
Vns_lost_selection_hooks = Qnil;
-/* 23: { */
- DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
- doc: /* Coding system for communicating with other programs.
-When sending or receiving text via cut_buffer, selection, and clipboard,
-the text is encoded or decoded by this coding system.
-The default value is determined by the system script code. */);
- Vselection_coding_system = Qnil;
-
- DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
- doc: /* Coding system for the next communication with other programs.
-Usually, `selection-coding-system' is used for communicating with
-other programs. But, if this variable is set, it is used for the
-next communication only. After the communication, this variable is
-set to nil. */);
- Vnext_selection_coding_system = Qnil;
-
Qforeign_selection = intern ("foreign-selection");
staticpro (&Qforeign_selection);
-/* } */
-
}
// arch-tag: 39d1dde7-06a6-49ff-95a7-0e7af12d2218