HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from emacs-24; up to 2012-12-27T08:21:08Z!rgm@gnu.org
[bpt/emacs.git]
/
src
/
xselect.c
diff --git
a/src/xselect.c
b/src/xselect.c
index
de9386b
..
b422a22
100644
(file)
--- a/
src/xselect.c
+++ b/
src/xselect.c
@@
-1,5
+1,5
@@
/* X Selection processing for Emacs.
/* X Selection processing for Emacs.
- Copyright (C) 1993-1997, 2000-201
2
Free Software Foundation, Inc.
+ Copyright (C) 1993-1997, 2000-201
3
Free Software Foundation, Inc.
This file is part of GNU Emacs.
This file is part of GNU Emacs.
@@
-1120,7
+1120,7
@@
unexpect_property_change (struct prop_location *location)
static Lisp_Object
wait_for_property_change_unwind (Lisp_Object loc)
{
static Lisp_Object
wait_for_property_change_unwind (Lisp_Object loc)
{
- struct prop_location *location = XSAVE_
VALUE (loc)->pointer
;
+ struct prop_location *location = XSAVE_
POINTER (loc, 0)
;
unexpect_property_change (location);
if (location == property_change_reply_object)
unexpect_property_change (location);
if (location == property_change_reply_object)
@@
-1141,7
+1141,7
@@
wait_for_property_change (struct prop_location *location)
/* Make sure to do unexpect_property_change if we quit or err. */
record_unwind_protect (wait_for_property_change_unwind,
/* Make sure to do unexpect_property_change if we quit or err. */
record_unwind_protect (wait_for_property_change_unwind,
- make_save_
value (location, 0
));
+ make_save_
pointer (location
));
XSETCAR (property_change_reply, Qnil);
property_change_reply_object = location;
XSETCAR (property_change_reply, Qnil);
property_change_reply_object = location;
@@
-1388,7
+1388,7
@@
x_get_window_property (Display *display, Window window, Atom property,
data = data1;
}
data = data1;
}
- if (
32 < BITS_PER_LONG
&& *actual_format_ret == 32)
+ if (
BITS_PER_LONG > 32
&& *actual_format_ret == 32)
{
unsigned long i;
int *idata = (int *) (data + offset);
{
unsigned long i;
int *idata = (int *) (data + offset);
@@
-1670,11
+1670,10
@@
selection_data_to_lisp_data (Display *display, const unsigned char *data,
return x_atom_to_symbol (display, (Atom) idata[0]);
else
{
return x_atom_to_symbol (display, (Atom) idata[0]);
else
{
- Lisp_Object v =
Fmake_vector (make_number (size / sizeof (int)),
- make_number (0));
+ Lisp_Object v =
make_uninit_vector (size / sizeof (int));
+
for (i = 0; i < size / sizeof (int); i++)
for (i = 0; i < size / sizeof (int); i++)
- Faset (v, make_number (i),
- x_atom_to_symbol (display, (Atom) idata[i]));
+ ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i]));
return v;
}
}
return v;
}
}
@@
-1694,24
+1693,24
@@
selection_data_to_lisp_data (Display *display, const unsigned char *data,
else if (format == 16)
{
ptrdiff_t i;
else if (format == 16)
{
ptrdiff_t i;
- Lisp_Object v;
- v = Fmake_vector (make_number (size / 2), make_number (0));
+ Lisp_Object v
= make_uninit_vector (size / 2)
;
+
for (i = 0; i < size / 2; i++)
{
short j = ((short *) data) [i];
for (i = 0; i < size / 2; i++)
{
short j = ((short *) data) [i];
-
Faset (v, make_number (i)
, make_number (j));
+
ASET (v, i
, make_number (j));
}
return v;
}
else
{
ptrdiff_t i;
}
return v;
}
else
{
ptrdiff_t i;
- Lisp_Object v =
Fmake_vector (make_number (size / X_LONG_SIZE),
- make_number (0));
+ Lisp_Object v =
make_uninit_vector (size / X_LONG_SIZE);
+
for (i = 0; i < size / X_LONG_SIZE; i++)
{
int j = ((int *) data) [i];
for (i = 0; i < size / X_LONG_SIZE; i++)
{
int j = ((int *) data) [i];
-
Faset (v, make_number (i)
, INTEGER_TO_CONS (j));
+
ASET (v, i
, INTEGER_TO_CONS (j));
}
return v;
}
}
return v;
}
@@
-1904,7
+1903,7
@@
clean_local_selection_data (Lisp_Object obj)
Lisp_Object copy;
if (size == 1)
return clean_local_selection_data (AREF (obj, 0));
Lisp_Object copy;
if (size == 1)
return clean_local_selection_data (AREF (obj, 0));
- copy =
Fmake_vector (make_number (size), Qnil
);
+ copy =
make_uninit_vector (size
);
for (i = 0; i < size; i++)
ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
return copy;
for (i = 0; i < size; i++)
ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
return copy;
@@
-1940,7
+1939,7
@@
x_handle_selection_notify (XSelectionEvent *event)
static struct frame *
frame_for_x_selection (Lisp_Object object)
{
static struct frame *
frame_for_x_selection (Lisp_Object object)
{
- Lisp_Object tail;
+ Lisp_Object tail
, frame
;
struct frame *f;
if (NILP (object))
struct frame *f;
if (NILP (object))
@@
-1949,9
+1948,9
@@
frame_for_x_selection (Lisp_Object object)
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
-
for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)
)
+
FOR_EACH_FRAME (tail, frame
)
{
{
- f = XFRAME (
XCAR (tail)
);
+ f = XFRAME (
frame
);
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
}
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
return f;
}
@@
-1959,15
+1958,14
@@
frame_for_x_selection (Lisp_Object object)
else if (TERMINALP (object))
{
struct terminal *t = get_terminal (object, 1);
else if (TERMINALP (object))
{
struct terminal *t = get_terminal (object, 1);
+
if (t->type == output_x_window)
if (t->type == output_x_window)
- {
- for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
- {
- f = XFRAME (XCAR (tail));
- if (FRAME_LIVE_P (f) && f->terminal == t)
- return f;
- }
- }
+ FOR_EACH_FRAME (tail, frame)
+ {
+ f = XFRAME (frame);
+ if (FRAME_LIVE_P (f) && f->terminal == t)
+ return f;
+ }
}
else if (FRAMEP (object))
{
}
else if (FRAMEP (object))
{
@@
-2452,7
+2450,7
@@
Use the display for FRAME or the current frame if FRAME is not given or nil.
If the value is 0 or the atom is not known, return the empty string. */)
(Lisp_Object value, Lisp_Object frame)
{
If the value is 0 or the atom is not known, return the empty string. */)
(Lisp_Object value, Lisp_Object frame)
{
- struct frame *f =
check_x
_frame (frame);
+ struct frame *f =
decode_window_system
_frame (frame);
char *name = 0;
char empty[] = "";
Lisp_Object ret = Qnil;
char *name = 0;
char empty[] = "";
Lisp_Object ret = Qnil;
@@
-2487,7
+2485,7
@@
FRAME is on. If FRAME is nil, the selected frame is used. */)
(Lisp_Object atom, Lisp_Object frame)
{
Atom x_atom;
(Lisp_Object atom, Lisp_Object frame)
{
Atom x_atom;
- struct frame *f =
check_x
_frame (frame);
+ struct frame *f =
decode_window_system
_frame (frame);
ptrdiff_t i;
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
ptrdiff_t i;
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@
-2543,7
+2541,7
@@
x_handle_dnd_message (struct frame *f, XClientMessageEvent *event,
function expects them to be of size int (i.e. 32). So to be able to
use that function, put the data in the form it expects if format is 32. */
function expects them to be of size int (i.e. 32). So to be able to
use that function, put the data in the form it expects if format is 32. */
- if (
32 < BITS_PER_LONG
&& event->format == 32)
+ if (
BITS_PER_LONG > 32
&& event->format == 32)
{
for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
idata[i] = event->data.l[i];
{
for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */
idata[i] = event->data.l[i];
@@
-2573,7
+2571,7
@@
x_handle_dnd_message (struct frame *f, XClientMessageEvent *event,
return 1;
}
return 1;
}
-DEFUN ("x-send-client-message", Fx_send_client_
event
,
+DEFUN ("x-send-client-message", Fx_send_client_
message
,
Sx_send_client_message, 6, 6, 0,
doc: /* Send a client message of MESSAGE-TYPE to window DEST on DISPLAY.
Sx_send_client_message, 6, 6, 0,
doc: /* Send a client message of MESSAGE-TYPE to window DEST on DISPLAY.
@@
-2620,7
+2618,7
@@
x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
struct x_display_info *dpyinfo = check_x_display_info (display);
Window wdest;
XEvent event;
struct x_display_info *dpyinfo = check_x_display_info (display);
Window wdest;
XEvent event;
- struct frame *f =
check_x
_frame (from);
+ struct frame *f =
decode_window_system
_frame (from);
int to_root;
CHECK_NUMBER (format);
int to_root;
CHECK_NUMBER (format);
@@
-2637,7
+2635,7
@@
x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
if (FRAMEP (dest) || NILP (dest))
{
if (FRAMEP (dest) || NILP (dest))
{
- struct frame *fdest =
check_x
_frame (dest);
+ struct frame *fdest =
decode_window_system
_frame (dest);
wdest = FRAME_OUTER_WINDOW (fdest);
}
else if (STRINGP (dest))
wdest = FRAME_OUTER_WINDOW (fdest);
}
else if (STRINGP (dest))