Whitespace cleanup in src/ui/X11
authorSteve Youngs <steve@sxemacs.org>
Sat, 28 Jan 2012 06:01:24 +0000 (16:01 +1000)
committerSteve Youngs <steve@sxemacs.org>
Sat, 28 Jan 2012 06:01:24 +0000 (16:01 +1000)
Signed-off-by: Steve Youngs <steve@sxemacs.org>
15 files changed:
src/ui/X11/EmacsShell-sub.c
src/ui/X11/ExternalShell.c
src/ui/X11/Makefile.am
src/ui/X11/console-x.h
src/ui/X11/device-x.c
src/ui/X11/event-Xt.c
src/ui/X11/frame-x.c
src/ui/X11/glyphs-x.c
src/ui/X11/objects-x.c
src/ui/X11/redisplay-x.c
src/ui/X11/scrollbar-x.c
src/ui/X11/select-x.c
src/ui/X11/toolbar-x.c
src/ui/X11/xgccache.c
src/ui/X11/xmu.c

index cdcf626..fdcb832 100644 (file)
@@ -366,9 +366,9 @@ static void ChangeManaged(Widget wid)
                /* the managed child indicates what our size is */
                for (i = 0; i < w->composite.num_children; i++) {
                        if (XtIsManaged(w->composite.children[i])) {
-                               child = w->composite.children[i];       
-                                update_size_hints_internal(w, child->core.width,
-                                                           child->core.height);
+                               child = w->composite.children[i];
+                               update_size_hints_internal(w, child->core.width,
+                                                          child->core.height);
                        break;
                        }
                }
index 4762f37..5f6eb58 100644 (file)
@@ -73,7 +73,7 @@ ERROR ! This ought not be getting compiled if EXTERNAL_WIDGET
    The data is formatted as follows:
 
    data.l[0] = who sent this message: external_shell_send (0) or
-               external_client_send (1)
+              external_client_send (1)
    data.l[1] = message type (see enum en_extw_notify below)
    data.l[2-4] = data associated with this message
 
index 200ba77..4420437 100644 (file)
@@ -47,7 +47,7 @@ TAGS_DEPENDENCIES = $(ETAGS)
 
 all_sources=
 noinst_LIBRARIES=
-header_HEADERS=$(acgen_headers) 
+header_HEADERS=$(acgen_headers)
 
 ## just a trick :( we create these libraries to get the object files
 if DESCEND_LWLIB
@@ -66,7 +66,7 @@ libsxeX_a_headers = \
 libsxeX_a_sources = \
        EmacsFrame.c EmacsShell.c EmacsManager.c
 if WITH_EXTW
-libsxeX_a_sources += ExternalShell.c 
+libsxeX_a_sources += ExternalShell.c
 ## extw-Xt-nonshared.c extw-Xlib-nonshared.c where are these????
 endif
 libsxeX_a_SOURCES = $(libsxeX_a_headers) $(libsxeX_a_sources)
@@ -79,10 +79,10 @@ noinst_LIBRARIES += libsxeX.a
 all_sources += $(libsxeX_a_sources) $(libsxeX_a_LIBADD:.o=.c)
 
 libsxeuiX11_a_headers = \
-       balloon_help.h                                          \
-       console-x.h extw-Xlib.h extw-Xt.h                       \
-       glyphs-x.h gui-x.h objects-x.h xgccache.h               \
-       offix-cursors.h offix-types.h offix.h scrollbar-x.h     \
+       balloon_help.h                                          \
+       console-x.h extw-Xlib.h extw-Xt.h                       \
+       glyphs-x.h gui-x.h objects-x.h xgccache.h               \
+       offix-cursors.h offix-types.h offix.h scrollbar-x.h     \
        xmmanagerp.h xmprimitivep.h xmu.h
 libsxeuiX11_a_sources =  \
        console-x.c device-x.c event-Xt.c frame-x.c                     \
@@ -98,7 +98,7 @@ all_sources += $(libsxeuiX11_a_sources) $(libsxeuiX11_objs:.o=.c)
 
 noinst_LIBRARIES += libsxeuiX11.a
 
-# 
+#
 # Help the SXEmacs developers get nice post-processed source files
 
 ## Create preprocessor output (debugging purposes only)
index ffe489a..a051890 100644 (file)
@@ -176,13 +176,13 @@ struct x_device {
 #define DEVICE_X_DATA(d) DEVICE_TYPE_DATA (d, x)
 
 #define FRAME_X_DISPLAY(f) (DEVICE_X_DISPLAY (XDEVICE (f->device)))
-#define DEVICE_X_DISPLAY(d)    (DEVICE_X_DATA (d)->display)
+#define DEVICE_X_DISPLAY(d)    (DEVICE_X_DATA (d)->display)
 #define DEVICE_X_BEING_DELETED(d) (DEVICE_X_DATA (d)->being_deleted)
 #define DEVICE_X_VISUAL(d)     (DEVICE_X_DATA (d)->visual)
 #define DEVICE_X_DEPTH(d)      (DEVICE_X_DATA (d)->depth)
-#define DEVICE_X_COLORMAP(d)   (DEVICE_X_DATA (d)->device_cmap)
-#define DEVICE_XT_APP_SHELL(d)         (DEVICE_X_DATA (d)->Xt_app_shell)
-#define DEVICE_X_GC_CACHE(d)   (DEVICE_X_DATA (d)->gc_cache)
+#define DEVICE_X_COLORMAP(d)   (DEVICE_X_DATA (d)->device_cmap)
+#define DEVICE_XT_APP_SHELL(d) (DEVICE_X_DATA (d)->Xt_app_shell)
+#define DEVICE_X_GC_CACHE(d)   (DEVICE_X_DATA (d)->gc_cache)
 #define DEVICE_X_GRAY_PIXMAP(d) (DEVICE_X_DATA (d)->gray_pixmap)
 #define DEVICE_X_WM_COMMAND_FRAME(d) (DEVICE_X_DATA (d)->WM_COMMAND_frame)
 #define DEVICE_X_MOUSE_TIMESTAMP(d)  (DEVICE_X_DATA (d)->mouse_timestamp)
@@ -204,17 +204,17 @@ struct x_device {
 #define DEVICE_XATOM_WM_STATE(d)        (DEVICE_X_DATA (d)->Xatom_WM_STATE)
 
 /* allocated in Xatoms_of_select_x */
-#define DEVICE_XATOM_CLIPBOARD(d)      (DEVICE_X_DATA (d)->Xatom_CLIPBOARD)
-#define DEVICE_XATOM_TIMESTAMP(d)      (DEVICE_X_DATA (d)->Xatom_TIMESTAMP)
-#define DEVICE_XATOM_TEXT(d)           (DEVICE_X_DATA (d)->Xatom_TEXT)
-#define DEVICE_XATOM_DELETE(d)                 (DEVICE_X_DATA (d)->Xatom_DELETE)
-#define DEVICE_XATOM_MULTIPLE(d)       (DEVICE_X_DATA (d)->Xatom_MULTIPLE)
-#define DEVICE_XATOM_INCR(d)           (DEVICE_X_DATA (d)->Xatom_INCR)
-#define DEVICE_XATOM_EMACS_TMP(d)      (DEVICE_X_DATA (d)->Xatom_EMACS_TMP)
-#define DEVICE_XATOM_TARGETS(d)        (DEVICE_X_DATA (d)->Xatom_TARGETS)
-#define DEVICE_XATOM_NULL(d)           (DEVICE_X_DATA (d)->Xatom_NULL)
-#define DEVICE_XATOM_ATOM_PAIR(d)      (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR)
-#define DEVICE_XATOM_COMPOUND_TEXT(d)  (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT)
+#define DEVICE_XATOM_CLIPBOARD(d)      (DEVICE_X_DATA (d)->Xatom_CLIPBOARD)
+#define DEVICE_XATOM_TIMESTAMP(d)      (DEVICE_X_DATA (d)->Xatom_TIMESTAMP)
+#define DEVICE_XATOM_TEXT(d)           (DEVICE_X_DATA (d)->Xatom_TEXT)
+#define DEVICE_XATOM_DELETE(d)         (DEVICE_X_DATA (d)->Xatom_DELETE)
+#define DEVICE_XATOM_MULTIPLE(d)       (DEVICE_X_DATA (d)->Xatom_MULTIPLE)
+#define DEVICE_XATOM_INCR(d)           (DEVICE_X_DATA (d)->Xatom_INCR)
+#define DEVICE_XATOM_EMACS_TMP(d)      (DEVICE_X_DATA (d)->Xatom_EMACS_TMP)
+#define DEVICE_XATOM_TARGETS(d)        (DEVICE_X_DATA (d)->Xatom_TARGETS)
+#define DEVICE_XATOM_NULL(d)           (DEVICE_X_DATA (d)->Xatom_NULL)
+#define DEVICE_XATOM_ATOM_PAIR(d)      (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR)
+#define DEVICE_XATOM_COMPOUND_TEXT(d)  (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT)
 
 /* allocated in Xatoms_of_objects_x */
 #define DEVICE_XATOM_FOUNDRY(d)                (DEVICE_X_DATA (d)->Xatom_FOUNDRY)
index 8211541..47c4211 100644 (file)
@@ -197,9 +197,9 @@ static void sanity_check_geometry_resource(Display * dpy)
        XtGetApplicationNameAndClass(dpy, &app_name, &app_class);
 
        strncpy(buf1, app_name, sizeof(buf1));
-        buf1[sizeof(buf1)-1] = '\0';
+       buf1[sizeof(buf1)-1] = '\0';
        strncpy(buf2, app_class, sizeof(buf2));
-        buf2[sizeof(buf2)-1] = '\0';
+       buf2[sizeof(buf2)-1] = '\0';
 
        for (s = buf1; *s; s++) {
                if (*s == '.') {
@@ -208,10 +208,10 @@ static void sanity_check_geometry_resource(Display * dpy)
        }
        strncat(buf1, "._no_._such_._resource_.geometry",
                sizeof(buf1) - strlen(buf1) - 1);
-        buf1[sizeof(buf1)-1] = '\0';
+       buf1[sizeof(buf1)-1] = '\0';
        strncat(buf2, "._no_._such_._resource_.Geometry",
                sizeof(buf2) - strlen(buf2) - 1);
-        buf2[sizeof(buf1)-1]='\0';
+       buf2[sizeof(buf1)-1]='\0';
        if (XrmGetResource(XtDatabase(dpy), buf1, buf2, &type, &value)
            == True) {
                warn_when_safe(Qgeometry, Qerror,
@@ -436,7 +436,7 @@ static int x_get_visual_depth(Display * dpy, Visual * visual)
                                &vi_in, &out_count);
        if (!vi_out) {
                abort();
-               return 1;
+               return 1;
        } else {
                d = vi_out[0].depth;
                XFree((char *)vi_out);
@@ -608,7 +608,7 @@ read_locale_specific_resources(Display *dpy)
                        /* C99 we need you ... VLA */
                        char path[strlen(data_dir) + 13 + strlen(locale) + 7];
 
-                       int sz = snprintf(path, sizeof(path), 
+                       int sz = snprintf(path, sizeof(path),
                                          "%sapp-defaults/%s/Emacs",
                                          data_dir, locale);
                        assert(sz >= 0 && (size_t)sz < sizeof(path));
@@ -1175,7 +1175,7 @@ int signal_if_x_error(Display * dpy, int resumable_p)
        if (!resumable_p) {
                while(1)
                        Fsignal(Qx_error, data);
-       } 
+       }
        return 1;
 }
 
@@ -1218,10 +1218,10 @@ int x_IO_error_handler(Display * disp)
        /* According to X specs, we should not return from this function, or
           Xlib might just decide to exit().  So we mark the offending
           console for deletion and throw to top level.  */
-        if (d) {
-          enqueue_magic_eval_event(io_error_delete_device, dev);
-          DEVICE_X_BEING_DELETED(d) = 1;
-        }
+       if (d) {
+         enqueue_magic_eval_event(io_error_delete_device, dev);
+         DEVICE_X_BEING_DELETED(d) = 1;
+       }
        Fthrow(Qtop_level, Qnil);
 
        return 0;               /* not reached */
@@ -1912,13 +1912,13 @@ Returns t if the grab is successful, nil otherwise.
        XSync(dpy, False);
        status = XGrabKeyboard(dpy, w, True,
                               /* I don't really understand sync-vs-async
-                                 grabs, but this is what xterm does. */
+                                 grabs, but this is what xterm does. */
                               GrabModeAsync, GrabModeAsync,
                               /* Use the timestamp of the last user action
-                                 read by emacs proper; xterm uses CurrentTime
-                                 but there's a comment that says "wrong"...
-                                 (Despite the name this is the time of the
-                                 last key or mouse event.) */
+                                 read by emacs proper; xterm uses CurrentTime
+                                 but there's a comment that says "wrong"...
+                                 (Despite the name this is the time of the
+                                 last key or mouse event.) */
                               DEVICE_X_MOUSE_TIMESTAMP(d));
        if (status == GrabSuccess) {
                /* The XUngrabKeyboard should generate a FocusIn back to this
index b2cadcf..4811a08 100644 (file)
@@ -539,7 +539,7 @@ store_modifier(KeyCode code, const char *name, struct mod_clo_s *clo)
                ;
 #endif
        } else if (modifier_index == clo->meta_bit &&
-                  clo->old != clo->meta_bit) { 
+                  clo->old != clo->meta_bit) {
                modwarn(code, name, clo->meta_bit, "Meta", clo);
        } else if (modifier_index == clo->super_bit &&
                   clo->old != clo->super_bit) {
@@ -1167,7 +1167,7 @@ x_keysym_to_emacs_keysym(KeySym keysym, int simple_p)
                        default: {
                                char buf[64];
                                int sz = snprintf(buf, sizeof(buf),
-                                                 "unknown-keysym-0x%X", 
+                                                 "unknown-keysym-0x%X",
                                                  (int)keysym);
                                assert(sz>=0 && (size_t)sz < sizeof(buf));
                                return KEYSYM(buf);
@@ -1219,7 +1219,7 @@ x_to_emacs_keysym(XKeyPressedEvent * event, int simple_p)
        Status status;
 #ifdef XIM_XLIB
        XIC xic = NULL;
-       struct frame * f = 
+       struct frame * f =
                x_any_window_to_frame(get_device_from_display(event->display),event->window);
        if (f)
                xic = FRAME_X_XIC(f);
@@ -2027,9 +2027,9 @@ static void handle_client_message(struct frame *f, XEvent * event)
        }
 }
 
-/* #### I'm struggling to understand how the X event loop really works. 
+/* #### I'm struggling to understand how the X event loop really works.
    Here is the problem:
-   
+
    When widgets get mapped / changed etc the actual display updates
    are done asynchronously via X events being processed - this
    normally happens when XtAppProcessEvent() gets called. However, if
@@ -2184,7 +2184,7 @@ static void emacs_Xt_handle_magic_event(Lisp_Event * emacs_event)
                        FRAME_X_TOTALLY_VISIBLE_P(f) =
                            (event->xvisibility.state == VisibilityUnobscured);
                        /* Note that the fvwm pager only sends VisibilityNotify
-                          when changing pages. Is this all we need to do ? 
+                          when changing pages. Is this all we need to do ?
                           JV */
                        /* Nope.  We must at least trigger a redisplay here.
                           Since this case seems similar to MapNotify, I've
@@ -2245,7 +2245,7 @@ static void Xt_timeout_callback(XtPointer closure, XtIntervalId * id)
        if(timeout == NULL) {
                abort();
                return;
-       } 
+       }
        if (t2 == timeout) {
                pending_timeouts = pending_timeouts->next;
        } else {
@@ -2739,7 +2739,7 @@ static void describe_event_window(Window window, Display * display)
        if (f) {
                int len = XSTRING_LENGTH(f->name) + 4;
                char buf[len];
-               
+
                int sz = snprintf(buf, len, " \"%s\"", XSTRING_DATA(f->name));
                assert(sz >= 0 && sz < len);
                write_string_to_stdio_stream(stderr, 0, (Bufbyte*)buf, 0,
@@ -3407,7 +3407,7 @@ emacs_Xt_event_pending_p(int user_p)
           conditions by using a temporary variable */
        tick_count_val = quit_check_signal_tick_count;
        if (last_quit_check_signal_tick_count != tick_count_val
-#if !defined (SIGIO) 
+#if !defined (SIGIO)
            || (XtIMXEvent & XtAppPending(Xt_app_con))
 #endif
            ) {
index 3349e88..5c9e792 100644 (file)
@@ -736,15 +736,15 @@ static void x_set_frame_properties(struct frame *f, Lisp_Object plist)
        Bool y_position_specified_p = False;
        Bool internal_border_width_specified = False;
        Lisp_Object tail;
-        Widget w;
+       Widget w;
 
-        /* We can be called after the X IO error handler has seen a
-           broken pipe on the relevant display. Don't do anything in
-           that case.  */
-        if (!FRAME_LIVE_P (f) || DEVICE_X_BEING_DELETED (XDEVICE (FRAME_DEVICE (f))))
-          return;
+       /* We can be called after the X IO error handler has seen a
+          broken pipe on the relevant display. Don't do anything in
+          that case.  */
+       if (!FRAME_LIVE_P (f) || DEVICE_X_BEING_DELETED (XDEVICE (FRAME_DEVICE (f))))
+         return;
 
-        w = FRAME_X_TEXT_WIDGET (f);
+       w = FRAME_X_TEXT_WIDGET (f);
 
        for (tail = plist; !NILP(tail); tail = Fcdr(Fcdr(tail))) {
                Lisp_Object prop = Fcar(tail);
@@ -2632,46 +2632,46 @@ documented in `set-frame-properties' (they can be queried and
 set at any time, except as otherwise noted):
 
 window-id                    The X window ID corresponding to the
-                             frame.  May be set only at startup, and
-                             only if external widget support was
-                             compiled in; doing so causes the frame
-                             to be created as an "external widget"
-                             in another program that uses an existing
-                             window in the program rather than creating
-                             a new one.
+                            frame.  May be set only at startup, and
+                            only if external widget support was
+                            compiled in; doing so causes the frame
+                            to be created as an "external widget"
+                            in another program that uses an existing
+                            window in the program rather than creating
+                            a new one.
 initially-unmapped           If non-nil, the frame will not be visible
-                             when it is created.  In this case, you
-                             need to call `make-frame-visible' to make
-                             the frame appear.
+                            when it is created.  In this case, you
+                            need to call `make-frame-visible' to make
+                            the frame appear.
 popup                        If non-nil, it should be a frame, and this
-                             frame will be created as a "popup" frame
-                             whose parent is the given frame.  This
-                             will make the window manager treat the
-                             frame as a dialog box, which may entail
-                             doing different things (e.g. not asking
-                             for positioning, and not iconifying
-                             separate from its parent).
+                            frame will be created as a "popup" frame
+                            whose parent is the given frame.  This
+                            will make the window manager treat the
+                            frame as a dialog box, which may entail
+                            doing different things (e.g. not asking
+                            for positioning, and not iconifying
+                            separate from its parent).
 override-redirect           If non-nil, the frame will not be subject to
                             window-manager control.  In particular, it
                             will lack decorations, for more attractive
-                             appearance of balloon help, aka tooltips.
+                            appearance of balloon help, aka tooltips.
 inter-line-space             Not currently implemented.
 toolbar-shadow-thickness     Thickness of toolbar shadows.
 background-toolbar-color     Color of toolbar background.
 bottom-toolbar-shadow-color  Color of bottom shadows on toolbars.
-                             (*Not* specific to the bottom-toolbar.)
+                            (*Not* specific to the bottom-toolbar.)
 top-toolbar-shadow-color     Color of top shadows on toolbars.
-                             (*Not* specific to the top-toolbar.)
+                            (*Not* specific to the top-toolbar.)
 internal-border-width        Width of internal border around text area.
 border-width                 Width of external border around text area.
 top                          Y position (in pixels) of the upper-left
-                             outermost corner of the frame (i.e. the
-                             upper-left of the window-manager
-                             decorations).
+                            outermost corner of the frame (i.e. the
+                            upper-left of the window-manager
+                            decorations).
 left                         X position (in pixels) of the upper-left
-                             outermost corner of the frame (i.e. the
-                             upper-left of the window-manager
-                             decorations).
+                            outermost corner of the frame (i.e. the
+                            upper-left of the window-manager
+                            decorations).
 border-color                 Color of external border around text area.
 cursor-color                 Color of text cursor.
 
index ba3b46b..e2290c3 100644 (file)
@@ -173,7 +173,7 @@ void enqueue_focus_event(Widget wants_it, Lisp_Object frame, int in_p);
 
 /************************************************************************/
 /* convert from a series of RGB triples to an XImage formated for the   */
-/* proper display                                                      */
+/* proper display                                                      */
 /************************************************************************/
 static XImage *convert_EImage_to_XImage(Lisp_Object device, int width,
                                        int height, unsigned char *pic,
@@ -2094,7 +2094,7 @@ static void x_redisplay_widget(Lisp_Image_Instance * p)
                wv = gui_items_to_widget_values
                    (image_instance, IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(p),
                     /* #### this is not right; we need to keep track of which widgets
-                       want accelerators and which don't */ 0);
+                       want accelerators and which don't */ 0);
                wv->change = STRUCTURAL_CHANGE;
        } else {
                /* Assume the lotus position, breath deeply and chant to
@@ -2226,24 +2226,24 @@ static int x_widget_border_width(void)
 
 void
 x_subwindow_query_geometry(Lisp_Object image_instance,
-                           int *width, int *height);
+                          int *width, int *height);
 
 void
 x_subwindow_query_geometry(Lisp_Object image_instance,
-                           int *width, int *height)
+                          int *width, int *height)
 {
        Lisp_Image_Instance *ii = XIMAGE_INSTANCE(image_instance);
-        Window droot;
+       Window droot;
        int dx, dy;
-        unsigned int dbdw, dd, dw = 20, dh = 20;
+       unsigned int dbdw, dd, dw = 20, dh = 20;
 
-        XGetGeometry(IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(ii),
-                     (Window)IMAGE_INSTANCE_SUBWINDOW_ID(ii),
-                     &droot, &dx, &dy, &dw, &dh, &dbdw, &dd);
-        if (width)
-                *width = dw;
-        if (height)
-                *height = dh;
+       XGetGeometry(IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(ii),
+                    (Window)IMAGE_INSTANCE_SUBWINDOW_ID(ii),
+                    &droot, &dx, &dy, &dw, &dh, &dbdw, &dd);
+       if (width)
+               *width = dw;
+       if (height)
+               *height = dh;
 }
 
 #if 0
@@ -2890,7 +2890,7 @@ void image_instantiator_format_create_glyphs_x(void)
        IIFORMAT_HAS_METHOD(autodetect, validate);
        IIFORMAT_HAS_METHOD(autodetect, normalize);
        IIFORMAT_HAS_METHOD(autodetect, possible_dest_types);
-       /* #### autodetect is flawed IMO: 
+       /* #### autodetect is flawed IMO:
           1. It makes the assumption that you can detect whether the user
           wanted a cursor or a string based on the data, since the data is a
           string you have to prioritise cursors. Instead we will force users
index f288b16..2f17329 100644 (file)
@@ -534,9 +534,9 @@ static void x_finalize_font_instance(Lisp_Font_Instance * f)
    were the same sizes, which would probably be good enough.
 
    More late-breaking news: on RS/6000 AIX 3.2.4, the expression
-        XLoadQueryFont (dpy, "-*-Fixed-Medium-R-*-*-*-130-75-75-*-*-ISO8859-1")
+       XLoadQueryFont (dpy, "-*-Fixed-Medium-R-*-*-*-130-75-75-*-*-ISO8859-1")
    actually returns the font
-        -Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1
+       -Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1
    which is crazy, because that font doesn't even match that pattern!  It is
    also not included in the output produced by `xlsfonts' with that pattern.
 
index 01dcdbb..775135f 100644 (file)
@@ -73,29 +73,29 @@ static void x_clear_frame(struct frame *f);
 static void x_clear_frame_windows(Lisp_Object window);
 
      /* Note: We do not use the Xmb*() functions and XFontSets.
-        Those functions are generally losing for a number of reasons:
-
-        1) They only support one locale (e.g. you could display
-        Japanese and ASCII text, but not mixed Japanese/Chinese
-        text).  You could maybe call setlocale() frequently
-        to try to deal with this, but that would generally
-        fail because an XFontSet is tied to one locale and
-        won't have the other character sets in it.
-        2) Not all (or even very many) OS's support the useful
-        locales.  For example, as far as I know SunOS and
-        Solaris only support the Japanese locale if you get the
-        special Asian-language version of the OS.  Yuck yuck
-        yuck.  Linux doesn't support the Japanese locale at
-        all.
-        3) The locale support in X only exists in R5, not in R4.
-        (Not sure how big of a problem this is: how many
-        people are using R4?)
-        4) Who knows if the multi-byte text format (which is locale-
-        specific) is even the same for the same locale on
-        different OS's?  It's not even documented anywhere that
-        I can find what the multi-byte text format for the
-        Japanese locale under SunOS and Solaris is, but I assume
-        it's EUC.
+       Those functions are generally losing for a number of reasons:
+
+       1) They only support one locale (e.g. you could display
+       Japanese and ASCII text, but not mixed Japanese/Chinese
+       text).  You could maybe call setlocale() frequently
+       to try to deal with this, but that would generally
+       fail because an XFontSet is tied to one locale and
+       won't have the other character sets in it.
+       2) Not all (or even very many) OS's support the useful
+       locales.  For example, as far as I know SunOS and
+       Solaris only support the Japanese locale if you get the
+       special Asian-language version of the OS.  Yuck yuck
+       yuck.  Linux doesn't support the Japanese locale at
+       all.
+       3) The locale support in X only exists in R5, not in R4.
+       (Not sure how big of a problem this is: how many
+       people are using R4?)
+       4) Who knows if the multi-byte text format (which is locale-
+       specific) is even the same for the same locale on
+       different OS's?  It's not even documented anywhere that
+       I can find what the multi-byte text format for the
+       Japanese locale under SunOS and Solaris is, but I assume
+       it's EUC.
       */
 
 struct textual_run {
@@ -335,7 +335,7 @@ x_output_display_block(struct window *w, struct display_line *dl, int block,
        if (end < 0)
                end = Dynarr_length(rba);
 
-        buf = Dynarr_new (Emchar);
+       buf = Dynarr_new (Emchar);
 
        while (elt < end) {
                rb = Dynarr_atp(rba, elt);
@@ -734,20 +734,20 @@ x_get_gc(struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
 
  W             Window that the text is to be displayed in.
  DL            Display line that this text is on.  The values in the
-               structure are used to determine the vertical position and
+               structure are used to determine the vertical position and
                clipping range of the text.
  BUF           Dynamic array of Emchars specifying what is actually to be
                drawn.
  XPOS          X position in pixels where the text should start being drawn.
  XOFFSET       Number of pixels to be chopped off the left side of the
-               text.  The effect is as if the text were shifted to the
+               text.  The effect is as if the text were shifted to the
                left this many pixels and clipped at XPOS.
  CLIP_START    Clip everything left of this X position.
  WIDTH         Clip everything right of XPOS + WIDTH.
  FINDEX                Index for the face cache element describing how to display
-               the text.
+               the text.
  CURSOR                #### I don't understand this.  There's something
-               strange and overcomplexified with this variable.
+               strange and overcomplexified with this variable.
                Chuck, explain please?
  CURSOR_START  Starting X position of cursor.
  CURSOR_WIDTH  Width of cursor in pixels.
@@ -1021,13 +1021,13 @@ x_output_string(struct window *w, struct display_line *dl,
                                ascent = xfont->ascent;
                        else
                                ascent = (int) ascent_ext;
-                       
+
                        if (!XGetFontProperty
                            (xfont, XA_STRIKEOUT_DESCENT, &descent_ext))
                                descent = xfont->descent;
                        else
                                descent = (int) descent_ext;
-                       
+
                        if (!XGetFontProperty
                            (xfont, XA_UNDERLINE_THICKNESS, &uthick_ext))
                                uthick = 1;
index 0e06a97..cfb04c2 100644 (file)
@@ -67,17 +67,17 @@ static int x_inhibit_scrollbar_slider_size_change(void)
 /* A device method. */
 static void x_free_scrollbar_instance(struct scrollbar_instance *instance)
 {
-        if ( instance && instance->scrollbar_data ) {
+       if ( instance && instance->scrollbar_data ) {
 
-                if (SCROLLBAR_X_NAME(instance))
-                        xfree(SCROLLBAR_X_NAME(instance));
-                
-                if (SCROLLBAR_X_WIDGET(instance)) {
-                        if (XtIsManaged(SCROLLBAR_X_WIDGET(instance)))
-                                XtUnmanageChild(SCROLLBAR_X_WIDGET(instance));
+               if (SCROLLBAR_X_NAME(instance))
+                       xfree(SCROLLBAR_X_NAME(instance));
 
-                        lw_destroy_all_widgets(SCROLLBAR_X_ID(instance));
-                }
+               if (SCROLLBAR_X_WIDGET(instance)) {
+                       if (XtIsManaged(SCROLLBAR_X_WIDGET(instance)))
+                               XtUnmanageChild(SCROLLBAR_X_WIDGET(instance));
+
+                       lw_destroy_all_widgets(SCROLLBAR_X_ID(instance));
+               }
                xfree(instance->scrollbar_data);
        }
 }
index 457f7b3..a1c1f17 100644 (file)
@@ -85,7 +85,7 @@ static void lisp_data_to_selection_data(struct device *, Lisp_Object obj,
 static Lisp_Object selection_data_to_lisp_data(struct device *, Extbyte * data,
                                               size_t size, Atom type, int format);
 static Lisp_Object x_get_window_property_as_lisp_data(Display *, Window, Atom property,
-                                                      Lisp_Object target_type, Atom selection_atom);
+                                                     Lisp_Object target_type, Atom selection_atom);
 
 static int expect_property_change(Display *, Window, Atom prop, int state);
 static void wait_for_property_change(long);
@@ -387,7 +387,7 @@ hack_motif_clipboard_selection(Atom selection_atom,
                                       encoding,
 #ifdef MOTIF_INCREMENTAL_CLIPBOARDS_WORK
                                       /* O'Reilly examples say size can be 0,
-                                         but this clearly is not the case. */
+                                         but this clearly is not the case. */
                                       0, bytes, (int)selecting_window, /* private id */
 #else                          /* !MOTIF_INCREMENTAL_CLIPBOARDS_WORK */
                                       (XtPointer) data, bytes, 0,
@@ -412,47 +412,47 @@ motif_clipboard_cb(Widget widget, int *data_id, int *private_id, int *reason)
 {
        switch (*reason) {
        case XmCR_CLIPBOARD_DATA_REQUEST: {
-                Display *dpy = XtDisplay(widget);
-                Window window = (Window) * private_id;
-                Lisp_Object selection =
-                        select_convert_out(QCLIPBOARD, Qnil, Qnil);
-
-                /* Whichever lazy git wrote this originally just called abort()
-                   when anything didn't go their way... */
-
-                /* Try some other text types */
-                if (NILP(selection))
-                        selection =
-                                select_convert_out(QCLIPBOARD, QSTRING,
-                                                   Qnil);
-                if (NILP(selection))
-                        selection =
-                                select_convert_out(QCLIPBOARD, QTEXT, Qnil);
-                if (NILP(selection))
-                        selection =
-                                select_convert_out(QCLIPBOARD,
-                                                   QCOMPOUND_TEXT, Qnil);
-
-                if (CONSP(selection) && SYMBOLP(XCAR(selection))
-                    && (EQ(XCAR(selection), QSTRING)
-                        || EQ(XCAR(selection), QTEXT)
-                        || EQ(XCAR(selection), QCOMPOUND_TEXT)))
-                        selection = XCDR(selection);
-
-                if (NILP(selection))
-                        signal_error(Qselection_conversion_error,
-                                     build_string("no selection"));
-
-                if (!STRINGP(selection))
-                        signal_error(Qselection_conversion_error,
-                                     build_string
-                                     ("couldn't convert selection to string"));
-
-                XmClipboardCopyByName(dpy, window, *data_id,
-                                      (char *)XSTRING_DATA(selection),
-                                      XSTRING_LENGTH(selection) + 1, 0);
+               Display *dpy = XtDisplay(widget);
+               Window window = (Window) * private_id;
+               Lisp_Object selection =
+                       select_convert_out(QCLIPBOARD, Qnil, Qnil);
+
+               /* Whichever lazy git wrote this originally just called abort()
+                  when anything didn't go their way... */
+
+               /* Try some other text types */
+               if (NILP(selection))
+                       selection =
+                               select_convert_out(QCLIPBOARD, QSTRING,
+                                                  Qnil);
+               if (NILP(selection))
+                       selection =
+                               select_convert_out(QCLIPBOARD, QTEXT, Qnil);
+               if (NILP(selection))
+                       selection =
+                               select_convert_out(QCLIPBOARD,
+                                                  QCOMPOUND_TEXT, Qnil);
+
+               if (CONSP(selection) && SYMBOLP(XCAR(selection))
+                   && (EQ(XCAR(selection), QSTRING)
+                       || EQ(XCAR(selection), QTEXT)
+                       || EQ(XCAR(selection), QCOMPOUND_TEXT)))
+                       selection = XCDR(selection);
+
+               if (NILP(selection))
+                       signal_error(Qselection_conversion_error,
+                                    build_string("no selection"));
+
+               if (!STRINGP(selection))
+                       signal_error(Qselection_conversion_error,
+                                    build_string
+                                    ("couldn't convert selection to string"));
+
+               XmClipboardCopyByName(dpy, window, *data_id,
+                                     (char *)XSTRING_DATA(selection),
+                                     XSTRING_LENGTH(selection) + 1, 0);
                break;
-        }
+       }
        case XmCR_CLIPBOARD_DATA_DELETE:
        default:
                /* don't need to free anything */
@@ -562,14 +562,14 @@ x_reply_selection_request(XSelectionRequestEvent * event, int format,
         the Xt selection routines are broken for our purposes--we can't
         pass them callbacks from Lisp, for example. Let's call it a
         workaround.
+
         The call to wait_for_property_change means we can break out of that
         function, switch to another frame on the same display (which will
         be another Xt widget), select a huge amount of text, and have the
         same (foreign) app ask for another incremental selection
         transfer. Programming like X11 made sense, would mean that, in that
         case, XtRegisterDrawable is called twice with different widgets.
+
         Since the results of calling XtRegisterDrawable when the drawable
         is already registered with another widget are undefined, we want to
         avoid that--so, only call it when XtWindowToWidget returns NULL,
@@ -578,7 +578,7 @@ x_reply_selection_request(XSelectionRequestEvent * event, int format,
                if (NULL == XtWindowToWidget(display, window)) {
                        XtRegisterDrawable(display, (Drawable)window, widget);
                }
-      
+
                prop_id =
                    expect_property_change(display, window, reply.property,
                                           PropertyDelete);
@@ -857,16 +857,16 @@ x_handle_property_notify(XPropertyEvent * event)
                    rest->window == event->window &&
                    rest->display == event->display &&
                    rest->desired_state == event->state)
-                {
-                        if (prev)
-                                prev->next = rest->next;
-                        else
-                                for_whom_the_bell_tolls = rest->next;
-                        xfree(rest);
-                        return;
-                }
-                prev = rest; rest = rest->next;
-        }
+               {
+                       if (prev)
+                               prev->next = rest->next;
+                       else
+                               for_whom_the_bell_tolls = rest->next;
+                       xfree(rest);
+                       return;
+               }
+               prev = rest; rest = rest->next;
+       }
 }
 
 \f
@@ -874,40 +874,40 @@ x_handle_property_notify(XPropertyEvent * event)
 static Lisp_Object
 fetch_multiple_target(XSelectionRequestEvent * event)
 {
-        /* This function can GC */
-        Display * display = event->display;
-        Window window = event->requestor;
-        Atom target = event->target;
-        Atom selection_atom = event->selection;
-        int result;
-
-        return Fcons(QMULTIPLE, x_get_window_property_as_lisp_data
-                     (display, window, target, QMULTIPLE, selection_atom));
+       /* This function can GC */
+       Display * display = event->display;
+       Window window = event->requestor;
+       Atom target = event->target;
+       Atom selection_atom = event->selection;
+       int result;
+
+       return Fcons(QMULTIPLE, x_get_window_property_as_lisp_data
+                    (display, window, target, QMULTIPLE, selection_atom));
 }
 
 static Lisp_Object
 copy_multiple_data(Lisp_Object obj)
 {
-        Lisp_Object vec;
-        int i; int len;
-
-        if (CONSP(obj))
-                return Fcons(XCAR(obj), copy_multiple_data(XCDR(obj)));
-
-        CHECK_VECTOR(obj); len = XVECTOR_LENGTH(obj);
-        vec = make_vector(len, Qnil);
-        for (i = 0; i < len; i++) {
-                Lisp_Object vec2 = XVECTOR_DATA(obj)[i];
-                CHECK_VECTOR(vec2);
-                if (XVECTOR_LENGTH(vec2) != 2)
-                        signal_error(Qerror, list2(build_string ("vectors must be of length 2"), vec2));
-                XVECTOR_DATA(vec)[i] = make_vector(2, Qnil);
-                XVECTOR_DATA(XVECTOR_DATA(vec)[i])[0] =
-                        XVECTOR_DATA(vec2)[0];
-                XVECTOR_DATA(XVECTOR_DATA(vec)[i])[1] =
-                        XVECTOR_DATA(vec2)[1];
-        }
-        return vec;
+       Lisp_Object vec;
+       int i; int len;
+
+       if (CONSP(obj))
+               return Fcons(XCAR(obj), copy_multiple_data(XCDR(obj)));
+
+       CHECK_VECTOR(obj); len = XVECTOR_LENGTH(obj);
+       vec = make_vector(len, Qnil);
+       for (i = 0; i < len; i++) {
+               Lisp_Object vec2 = XVECTOR_DATA(obj)[i];
+               CHECK_VECTOR(vec2);
+               if (XVECTOR_LENGTH(vec2) != 2)
+                       signal_error(Qerror, list2(build_string ("vectors must be of length 2"), vec2));
+               XVECTOR_DATA(vec)[i] = make_vector(2, Qnil);
+               XVECTOR_DATA(XVECTOR_DATA(vec)[i])[0] =
+                       XVECTOR_DATA(vec2)[0];
+               XVECTOR_DATA(XVECTOR_DATA(vec)[i])[1] =
+                       XVECTOR_DATA(vec2)[1];
+       }
+       return vec;
 }
 #endif /* 0 */
 
@@ -919,7 +919,7 @@ static int selection_reply_timed_out;
 static int
 selection_reply_done(void *ignore)
 {
-        return !reading_selection_reply;
+       return !reading_selection_reply;
 }
 
 static Lisp_Object Qx_selection_reply_timeout_internal;
@@ -928,10 +928,10 @@ DEFUN("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal,
 */
       (arg))
 {
-        selection_reply_timed_out = 1;
-        reading_selection_reply = 0;
+       selection_reply_timed_out = 1;
+       reading_selection_reply = 0;
 
-        return Qnil;
+       return Qnil;
 }
 
 /*
@@ -941,192 +941,192 @@ DEFUN("x-selection-reply-timeout-internal", Fx_selection_reply_timeout_internal,
 static Lisp_Object
 x_get_foreign_selection(Lisp_Object selection_symbol, Lisp_Object target_type)
 {
-        /* This function can GC */
-        struct device *d = decode_x_device(Qnil);
-        Display * display = DEVICE_X_DISPLAY(d);
-        struct frame *sel_frame = selected_frame();
-        Window requestor_window = XtWindow(FRAME_X_TEXT_WIDGET(sel_frame));
-        Time requestor_time = CurrentTime;
-        Atom target_property = DEVICE_XATOM_EMACS_TMP(d);
-        Atom selection_atom = symbol_to_x_atom(d, selection_symbol, 0);
-        int speccount;
-        Atom type_atom = symbol_to_x_atom(d, (CONSP(target_type) ? XCAR(target_type) : target_type), 0);
-
-        XConvertSelection(display, selection_atom, type_atom, target_property,
-                          requestor_window, requestor_time);
-        /* Block until the reply has been read. */
-        reading_selection_reply = requestor_window;
-        reading_which_selection = selection_atom;
-        selection_reply_timed_out = 0;
-        speccount = specpdl_depth();
-        /* add a timeout handler */
-        if (x_selection_timeout > 0) {
-                Lisp_Object id = Fadd_timeout(make_int(x_selection_timeout),
-                                              Qx_selection_reply_timeout_internal,
-                                              Qnil, Qnil);
-                record_unwind_protect(Fdisable_timeout, id);
-        }
-
-        /* This is ^Gable */
-        wait_delaying_user_input(selection_reply_done, 0);
-        if (selection_reply_timed_out)
-                error("timed out waiting for reply from selection owner");
-        unbind_to(speccount, Qnil);
-        /* otherwise, the selection is waiting for us on the requested property. */
-        return select_convert_in(selection_symbol, target_type,
-                                 x_get_window_property_as_lisp_data (display, requestor_window,
-                                                                     target_property, target_type,
-                                                                     selection_atom));
+       /* This function can GC */
+       struct device *d = decode_x_device(Qnil);
+       Display * display = DEVICE_X_DISPLAY(d);
+       struct frame *sel_frame = selected_frame();
+       Window requestor_window = XtWindow(FRAME_X_TEXT_WIDGET(sel_frame));
+       Time requestor_time = CurrentTime;
+       Atom target_property = DEVICE_XATOM_EMACS_TMP(d);
+       Atom selection_atom = symbol_to_x_atom(d, selection_symbol, 0);
+       int speccount;
+       Atom type_atom = symbol_to_x_atom(d, (CONSP(target_type) ? XCAR(target_type) : target_type), 0);
+
+       XConvertSelection(display, selection_atom, type_atom, target_property,
+                         requestor_window, requestor_time);
+       /* Block until the reply has been read. */
+       reading_selection_reply = requestor_window;
+       reading_which_selection = selection_atom;
+       selection_reply_timed_out = 0;
+       speccount = specpdl_depth();
+       /* add a timeout handler */
+       if (x_selection_timeout > 0) {
+               Lisp_Object id = Fadd_timeout(make_int(x_selection_timeout),
+                                             Qx_selection_reply_timeout_internal,
+                                             Qnil, Qnil);
+               record_unwind_protect(Fdisable_timeout, id);
+       }
+
+       /* This is ^Gable */
+       wait_delaying_user_input(selection_reply_done, 0);
+       if (selection_reply_timed_out)
+               error("timed out waiting for reply from selection owner");
+       unbind_to(speccount, Qnil);
+       /* otherwise, the selection is waiting for us on the requested property. */
+       return select_convert_in(selection_symbol, target_type,
+                                x_get_window_property_as_lisp_data (display, requestor_window,
+                                                                    target_property, target_type,
+                                                                    selection_atom));
 }
 
 static void
 x_get_window_property(Display * display, Window window, Atom property,
-                      Extbyte ** data_ret, int *bytes_ret, Atom * actual_type_ret,
-                      int *actual_format_ret, unsigned long *actual_size_ret,
-                      int delete_p)
+                     Extbyte ** data_ret, int *bytes_ret, Atom * actual_type_ret,
+                     int *actual_format_ret, unsigned long *actual_size_ret,
+                     int delete_p)
 {
-        size_t total_size;
-        unsigned long bytes_remaining;
-        int offset = 0; unsigned char *tmp_data = 0;
-        int result;
-        int buffer_size = SELECTION_QUANTUM(display);
-
-        if (buffer_size > MAX_SELECTION_QUANTUM)
-                buffer_size = MAX_SELECTION_QUANTUM;
-        /* First probe the thing to find out how big it is. */
-        result = XGetWindowProperty(display, window, property, 0, 0,
-                                    False, AnyPropertyType, actual_type_ret,
-                                   actual_format_ret, actual_size_ret,
-                                   &bytes_remaining, &tmp_data);
-        if (result != Success) {
-                *data_ret = 0;
-                *bytes_ret = 0;
-                return;
-        }
-        XFree((char *)tmp_data);
-        if (*actual_type_ret == None || *actual_format_ret == 0) {
-                if (delete_p)
-                        XDeleteProperty(display, window, property);
-                *data_ret = 0;
-                *bytes_ret = 0;
-                return;
-        }
-
-        total_size = bytes_remaining + 1;
-        *data_ret = (Extbyte *) xmalloc_atomic(total_size);
-        /* Now read, until we've gotten it all. */
-        while (bytes_remaining) {
-                result = XGetWindowProperty(display, window, property,
-                                           offset / 4, buffer_size / 4,
-                                           (delete_p ? True : False),
-                                           AnyPropertyType, actual_type_ret,
-                                           actual_format_ret, actual_size_ret,
-                                           &bytes_remaining, &tmp_data);
-
-                /* If this doesn't return Success at this point, it means that
-                   some clod deleted the selection while we were in the midst of
-                   reading it.  Deal with that, I guess....
-                */
-                if (result != Success)
-                        break;
-                *actual_size_ret *= *actual_format_ret / 8;
-                memcpy((*data_ret) + offset, tmp_data, *actual_size_ret);
-                offset += *actual_size_ret;
-                XFree((char *)tmp_data);
-        }
-        *bytes_ret = offset;
+       size_t total_size;
+       unsigned long bytes_remaining;
+       int offset = 0; unsigned char *tmp_data = 0;
+       int result;
+       int buffer_size = SELECTION_QUANTUM(display);
+
+       if (buffer_size > MAX_SELECTION_QUANTUM)
+               buffer_size = MAX_SELECTION_QUANTUM;
+       /* First probe the thing to find out how big it is. */
+       result = XGetWindowProperty(display, window, property, 0, 0,
+                                   False, AnyPropertyType, actual_type_ret,
+                                  actual_format_ret, actual_size_ret,
+                                  &bytes_remaining, &tmp_data);
+       if (result != Success) {
+               *data_ret = 0;
+               *bytes_ret = 0;
+               return;
+       }
+       XFree((char *)tmp_data);
+       if (*actual_type_ret == None || *actual_format_ret == 0) {
+               if (delete_p)
+                       XDeleteProperty(display, window, property);
+               *data_ret = 0;
+               *bytes_ret = 0;
+               return;
+       }
+
+       total_size = bytes_remaining + 1;
+       *data_ret = (Extbyte *) xmalloc_atomic(total_size);
+       /* Now read, until we've gotten it all. */
+       while (bytes_remaining) {
+               result = XGetWindowProperty(display, window, property,
+                                          offset / 4, buffer_size / 4,
+                                          (delete_p ? True : False),
+                                          AnyPropertyType, actual_type_ret,
+                                          actual_format_ret, actual_size_ret,
+                                          &bytes_remaining, &tmp_data);
+
+               /* If this doesn't return Success at this point, it means that
+                  some clod deleted the selection while we were in the midst of
+                  reading it.  Deal with that, I guess....
+               */
+               if (result != Success)
+                       break;
+               *actual_size_ret *= *actual_format_ret / 8;
+               memcpy((*data_ret) + offset, tmp_data, *actual_size_ret);
+               offset += *actual_size_ret;
+               XFree((char *)tmp_data);
+       }
+       *bytes_ret = offset;
 }
 
 static void
 receive_incremental_selection(Display * display, Window window, Atom property,
-                              /* this one is for error messages only */
-                              Lisp_Object target_type, unsigned int min_size_bytes,
-                              Extbyte ** data_ret, int *size_bytes_ret,
-                              Atom * type_ret, int *format_ret,
-                              unsigned long *size_ret)
+                             /* this one is for error messages only */
+                             Lisp_Object target_type, unsigned int min_size_bytes,
+                             Extbyte ** data_ret, int *size_bytes_ret,
+                             Atom * type_ret, int *format_ret,
+                             unsigned long *size_ret)
 {
-        /* This function can GC */
-        int offset = 0;
-        int prop_id;
-
-        *size_bytes_ret = min_size_bytes;
-        *data_ret = (Extbyte *) xmalloc_atomic(*size_bytes_ret);
-
-        /* At this point, we have read an INCR property, and deleted it (which
-           is how we ack its receipt: the sending window will be selecting
-           PropertyNotify events on our window to notice this).
-
-           Now, we must loop, waiting for the sending window to put a value on
-           that property, then reading the property, then deleting it to ack.
-           We are done when the sender places a property of length 0.
-        */
-        prop_id = expect_property_change(display, window, property, PropertyNewValue);
-        while (1) {
-                Extbyte * tmp_data; int tmp_size_bytes;
-                wait_for_property_change(prop_id);
-                /* expect it again immediately, because x_get_window_property may
-                   .. no it won't, I don't get it.
-                   .. Ok, I get it now, the Xt code that implements INCR is broken.
-                */
-                prop_id = expect_property_change(display, window, property, PropertyNewValue);
-                x_get_window_property(display, window, property, &tmp_data, &tmp_size_bytes,
-                                      type_ret, format_ret, size_ret, 1);
-                if (tmp_size_bytes == 0) {     /* we're done */
-                        unexpect_property_change(prop_id);
-                        if (tmp_data) xfree(tmp_data);
-                        break;
-                }
-                if (*size_bytes_ret < offset + tmp_size_bytes) {
-                        *size_bytes_ret = offset + tmp_size_bytes;
-                        *data_ret = (Extbyte *) xrealloc(*data_ret, *size_bytes_ret);
-                }
-                memcpy((*data_ret) + offset, tmp_data, tmp_size_bytes);
-                offset += tmp_size_bytes; xfree(tmp_data);
-        }
+       /* This function can GC */
+       int offset = 0;
+       int prop_id;
+
+       *size_bytes_ret = min_size_bytes;
+       *data_ret = (Extbyte *) xmalloc_atomic(*size_bytes_ret);
+
+       /* At this point, we have read an INCR property, and deleted it (which
+          is how we ack its receipt: the sending window will be selecting
+          PropertyNotify events on our window to notice this).
+
+          Now, we must loop, waiting for the sending window to put a value on
+          that property, then reading the property, then deleting it to ack.
+          We are done when the sender places a property of length 0.
+       */
+       prop_id = expect_property_change(display, window, property, PropertyNewValue);
+       while (1) {
+               Extbyte * tmp_data; int tmp_size_bytes;
+               wait_for_property_change(prop_id);
+               /* expect it again immediately, because x_get_window_property may
+                  .. no it won't, I don't get it.
+                  .. Ok, I get it now, the Xt code that implements INCR is broken.
+               */
+               prop_id = expect_property_change(display, window, property, PropertyNewValue);
+               x_get_window_property(display, window, property, &tmp_data, &tmp_size_bytes,
+                                     type_ret, format_ret, size_ret, 1);
+               if (tmp_size_bytes == 0) {      /* we're done */
+                       unexpect_property_change(prop_id);
+                       if (tmp_data) xfree(tmp_data);
+                       break;
+               }
+               if (*size_bytes_ret < offset + tmp_size_bytes) {
+                       *size_bytes_ret = offset + tmp_size_bytes;
+                       *data_ret = (Extbyte *) xrealloc(*data_ret, *size_bytes_ret);
+               }
+               memcpy((*data_ret) + offset, tmp_data, tmp_size_bytes);
+               offset += tmp_size_bytes; xfree(tmp_data);
+       }
 }
 
 static Lisp_Object
 x_get_window_property_as_lisp_data(Display * display, Window window, Atom property,
-                                   /* next two for error messages only */
-                                   Lisp_Object target_type, Atom selection_atom)
+                                  /* next two for error messages only */
+                                  Lisp_Object target_type, Atom selection_atom)
 {
-        /* This function can GC */
-        Atom actual_type;
-        int actual_format;
-        unsigned long actual_size;
-        Extbyte * data = NULL;
-        int bytes = 0;
-        Lisp_Object val;
-        struct device *d = get_device_from_display(display);
-
-        x_get_window_property(display, window, property, &data, &bytes, &actual_type,
-                              &actual_format, &actual_size, 1);
-        if (!data) {
-                if (XGetSelectionOwner(display, selection_atom))
-                        /* there is a selection owner */
-                        signal_error(Qselection_conversion_error,
-                                     Fcons(build_string("selection owner couldn't convert"),
-                                           Fcons(x_atom_to_symbol (d, selection_atom),
-                                                 actual_type ? list2(target_type, x_atom_to_symbol (d, actual_type))
-                                                 : list1(target_type))));
-                        else
-                                signal_error(Qerror, list2(build_string ("no selection"),
-                                                           x_atom_to_symbol(d, selection_atom)));
-        }
-
-        if (actual_type == DEVICE_XATOM_INCR(d)) {
-                /* Ok, that data wasn't *the* data, it was just the beginning. */
-                unsigned int min_size_bytes = *((unsigned int *)data); xfree(data);
-                receive_incremental_selection(display, window, property, target_type,
-                                              min_size_bytes, &data, &bytes, &actual_type,
-                                              &actual_format, &actual_size);
-        }
-
-        /* It's been read.  Now convert it to a lisp object in some semi-rational
-           manner. */
-        val = selection_data_to_lisp_data(d, data, bytes, actual_type, actual_format);
-        xfree(data);
-        return val;
+       /* This function can GC */
+       Atom actual_type;
+       int actual_format;
+       unsigned long actual_size;
+       Extbyte * data = NULL;
+       int bytes = 0;
+       Lisp_Object val;
+       struct device *d = get_device_from_display(display);
+
+       x_get_window_property(display, window, property, &data, &bytes, &actual_type,
+                             &actual_format, &actual_size, 1);
+       if (!data) {
+               if (XGetSelectionOwner(display, selection_atom))
+                       /* there is a selection owner */
+                       signal_error(Qselection_conversion_error,
+                                    Fcons(build_string("selection owner couldn't convert"),
+                                          Fcons(x_atom_to_symbol (d, selection_atom),
+                                                actual_type ? list2(target_type, x_atom_to_symbol (d, actual_type))
+                                                : list1(target_type))));
+                       else
+                               signal_error(Qerror, list2(build_string ("no selection"),
+                                                          x_atom_to_symbol(d, selection_atom)));
+       }
+
+       if (actual_type == DEVICE_XATOM_INCR(d)) {
+               /* Ok, that data wasn't *the* data, it was just the beginning. */
+               unsigned int min_size_bytes = *((unsigned int *)data); xfree(data);
+               receive_incremental_selection(display, window, property, target_type,
+                                             min_size_bytes, &data, &bytes, &actual_type,
+                                             &actual_format, &actual_size);
+       }
+
+       /* It's been read.  Now convert it to a lisp object in some semi-rational
+          manner. */
+       val = selection_data_to_lisp_data(d, data, bytes, actual_type, actual_format);
+       xfree(data);
+       return val;
 }
 
 \f
@@ -1166,70 +1166,70 @@ x_get_window_property_as_lisp_data(Display * display, Window window, Atom proper
 
 static Lisp_Object
 selection_data_to_lisp_data(struct device *d, Extbyte * data,
-                            size_t size, Atom type, int format)
+                           size_t size, Atom type, int format)
 {
-        if (type == DEVICE_XATOM_NULL(d))
-                return QNULL;
-        /* Convert any 8-bit data to a string, for compactness. */
-        else if (format == 8)
-                return make_ext_string(data, size, type == DEVICE_XATOM_TEXT(d)
-                                       || type == DEVICE_XATOM_COMPOUND_TEXT(d) ? Qctext : Qbinary);
-        /* Convert a single atom to a Lisp Symbol.
-           Convert a set of atoms to a vector of symbols. */
-        else if (type == XA_ATOM) {
-                if (size == sizeof(Atom))
-                        return x_atom_to_symbol(d, *((Atom *) data));
-                else {
-                        int i;
-                        int len = size / sizeof(Atom);
-                        Lisp_Object v = Fmake_vector(make_int(len), Qzero);
-                        for (i = 0; i < len; i++)
-                                Faset(v, make_int(i), x_atom_to_symbol(d, ((Atom *) data)[i]));
-                        return v;
-                }
-        }
-
-        /* Convert a single 16 or small 32 bit number to a Lisp Int.
-           If the number is > 16 bits, convert it to a cons of integers,
-           16 bits in each half.
-        */
-        else if (format == 32 && size == sizeof(long))
-                return word_to_lisp(((unsigned long *)data)[0]);
-        else if (format == 16 && size == sizeof(short))
-                return make_int((int)(((unsigned short *)data)[0]));
-        /* Convert any other kind of data to a vector of numbers, represented
-           as above (as an integer, or a cons of two 16 bit integers).
-
-           #### Perhaps we should return the actual type to lisp as well.
-
-           (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-           ==> [4 4]
-
-           and perhaps it should be
-
-           (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-           ==> (SPAN . [4 4])
-
-           Right now the fact that the return type was SPAN is discarded before
-           lisp code gets to see it.
-        */
-        else if (format == 16) {
-                int i;
-                Lisp_Object v = make_vector(size / 4, Qzero);
-                for (i = 0; i < (int)size / 4; i++) {
-                        int j = (int)((unsigned short *)data)[i];
-                        Faset(v, make_int(i), make_int(j));
-                }
-                return v;
-        } else {
-                int i;
-                Lisp_Object v = make_vector(size / 4, Qzero);
-                for (i = 0; i < (int)size / 4; i++) {
-                        unsigned long j = ((unsigned long *)data)[i];
-                        Faset(v, make_int(i), word_to_lisp(j));
-                }
-                return v;
-        }
+       if (type == DEVICE_XATOM_NULL(d))
+               return QNULL;
+       /* Convert any 8-bit data to a string, for compactness. */
+       else if (format == 8)
+               return make_ext_string(data, size, type == DEVICE_XATOM_TEXT(d)
+                                      || type == DEVICE_XATOM_COMPOUND_TEXT(d) ? Qctext : Qbinary);
+       /* Convert a single atom to a Lisp Symbol.
+          Convert a set of atoms to a vector of symbols. */
+       else if (type == XA_ATOM) {
+               if (size == sizeof(Atom))
+                       return x_atom_to_symbol(d, *((Atom *) data));
+               else {
+                       int i;
+                       int len = size / sizeof(Atom);
+                       Lisp_Object v = Fmake_vector(make_int(len), Qzero);
+                       for (i = 0; i < len; i++)
+                               Faset(v, make_int(i), x_atom_to_symbol(d, ((Atom *) data)[i]));
+                       return v;
+               }
+       }
+
+       /* Convert a single 16 or small 32 bit number to a Lisp Int.
+          If the number is > 16 bits, convert it to a cons of integers,
+          16 bits in each half.
+       */
+       else if (format == 32 && size == sizeof(long))
+               return word_to_lisp(((unsigned long *)data)[0]);
+       else if (format == 16 && size == sizeof(short))
+               return make_int((int)(((unsigned short *)data)[0]));
+       /* Convert any other kind of data to a vector of numbers, represented
+          as above (as an integer, or a cons of two 16 bit integers).
+
+          #### Perhaps we should return the actual type to lisp as well.
+
+          (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+          ==> [4 4]
+
+          and perhaps it should be
+
+          (x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+          ==> (SPAN . [4 4])
+
+          Right now the fact that the return type was SPAN is discarded before
+          lisp code gets to see it.
+       */
+       else if (format == 16) {
+               int i;
+               Lisp_Object v = make_vector(size / 4, Qzero);
+               for (i = 0; i < (int)size / 4; i++) {
+                       int j = (int)((unsigned short *)data)[i];
+                       Faset(v, make_int(i), make_int(j));
+               }
+               return v;
+       } else {
+               int i;
+               Lisp_Object v = make_vector(size / 4, Qzero);
+               for (i = 0; i < (int)size / 4; i++) {
+                       unsigned long j = ((unsigned long *)data)[i];
+                       Faset(v, make_int(i), word_to_lisp(j));
+               }
+               return v;
+       }
 }
 
 #define tmp_err_1                              \
@@ -1243,25 +1243,25 @@ selection_data_to_lisp_data(struct device *d, Extbyte * data,
 
 static void
 lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
-                            unsigned char **data_ret, Atom * type_ret,
-                            unsigned int *size_ret, int *format_ret)
+                           unsigned char **data_ret, Atom * type_ret,
+                           unsigned int *size_ret, int *format_ret)
 {
-        Lisp_Object type = Qnil;
-
-        if (CONSP(obj) && SYMBOLP(XCAR(obj))) {
-                type = XCAR(obj); obj = XCDR(obj);
-                if (CONSP(obj) && NILP(XCDR(obj)))
-                        obj = XCAR(obj);
-        }
-        if (EQ(obj, QNULL) || (EQ(type, QNULL))) {
+       Lisp_Object type = Qnil;
+
+       if (CONSP(obj) && SYMBOLP(XCAR(obj))) {
+               type = XCAR(obj); obj = XCDR(obj);
+               if (CONSP(obj) && NILP(XCDR(obj)))
+                       obj = XCAR(obj);
+       }
+       if (EQ(obj, QNULL) || (EQ(type, QNULL))) {
                /* This is not the same as declining */
-                *format_ret = 32;
-                *size_ret = 0; *data_ret = 0; type = QNULL;
-        } else if (STRINGP(obj)) {
-                const Extbyte * extval = NULL;
-                Extcount extvallen;
-                TO_EXTERNAL_FORMAT(LISP_STRING, obj, ALLOCA, (extval, extvallen),
-                                   (NILP(type) ? Qctext : Qbinary));
+               *format_ret = 32;
+               *size_ret = 0; *data_ret = 0; type = QNULL;
+       } else if (STRINGP(obj)) {
+               const Extbyte * extval = NULL;
+               Extcount extvallen;
+               TO_EXTERNAL_FORMAT(LISP_STRING, obj, ALLOCA, (extval, extvallen),
+                                  (NILP(type) ? Qctext : Qbinary));
                if ( extval != NULL ) {
                        *format_ret = 8;
                        *size_ret = extvallen;
@@ -1271,20 +1271,20 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
                        error("Could not transcode string");
                }
 #ifdef MULE
-                if (NILP(type))
-                        type = QCOMPOUND_TEXT;
+               if (NILP(type))
+                       type = QCOMPOUND_TEXT;
 #else
-                if (NILP(type)) type = QSTRING;
+               if (NILP(type)) type = QSTRING;
 #endif
-        } else if (CHARP(obj)) {
-                Bufbyte buf[MAX_EMCHAR_LEN];
-                Bytecount len;
-                const Extbyte * extval = NULL;
-                Extcount extvallen;
-                *format_ret = 8;
-                len = set_charptr_emchar(buf, XCHAR(obj));
-                TO_EXTERNAL_FORMAT(DATA, (buf, len), ALLOCA, (extval, extvallen),
-                                   Qctext);
+       } else if (CHARP(obj)) {
+               Bufbyte buf[MAX_EMCHAR_LEN];
+               Bytecount len;
+               const Extbyte * extval = NULL;
+               Extcount extvallen;
+               *format_ret = 8;
+               len = set_charptr_emchar(buf, XCHAR(obj));
+               TO_EXTERNAL_FORMAT(DATA, (buf, len), ALLOCA, (extval, extvallen),
+                                  Qctext);
                if ( extval != NULL ) {
                        *size_ret = extvallen;
                        *data_ret = (unsigned char *)xmalloc_atomic(*size_ret);
@@ -1293,61 +1293,61 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
                        error("Could not transcode data");
                }
 #ifdef MULE
-                if (NILP(type))
-                        type = QCOMPOUND_TEXT;
+               if (NILP(type))
+                       type = QCOMPOUND_TEXT;
 #else
-                if (NILP(type))
-                        type = QSTRING;
+               if (NILP(type))
+                       type = QSTRING;
 #endif
-        } else if (SYMBOLP(obj)) {
-                *format_ret = 32;
-                *size_ret = 1;
-                *data_ret =
-                        (unsigned char *)xmalloc_atomic(sizeof(Atom) + 1);
-                (*data_ret)[sizeof(Atom)] = 0;
-                (*(Atom **) data_ret)[0] =
-                        symbol_to_x_atom(d, obj, 0);
-                if (NILP(type)) type = QATOM;
-        } else if (INTP(obj) && XINT(obj) <= 0x7FFF && XINT(obj) >= -0x8000) {
-                *format_ret = 16;
-                *size_ret = 1;
-                *data_ret = (unsigned char *)xmalloc_atomic(sizeof(short) + 1);
-                (*data_ret)[sizeof(short)] = 0;
-                (*(short **)data_ret)[0] = (short)XINT(obj);
-                if (NILP(type))
-                        type = QINTEGER;
-        } else if (INTP(obj) || CONSP(obj)) {
-                *format_ret = 32;
-                *size_ret = 1;
-                *data_ret = (unsigned char *)xmalloc_atomic(sizeof(long) + 1);
-                (*data_ret)[sizeof(long)] = 0;
-                (*(unsigned long **)data_ret)[0] = lisp_to_word(obj);
-                if (NILP(type))
-                        type = QINTEGER;
-        } else if (VECTORP(obj)) {
-                /* Lisp Vectors may represent a set of ATOMs;
-                   a set of 16 or 32 bit INTEGERs;
-                   or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
-                */
-                int i;
-                if (SYMBOLP(XVECTOR_DATA(obj)[0])) {
-                        /* This vector is an ATOM set */
-                        if (NILP(type)) {
-                                type = QATOM;
+       } else if (SYMBOLP(obj)) {
+               *format_ret = 32;
+               *size_ret = 1;
+               *data_ret =
+                       (unsigned char *)xmalloc_atomic(sizeof(Atom) + 1);
+               (*data_ret)[sizeof(Atom)] = 0;
+               (*(Atom **) data_ret)[0] =
+                       symbol_to_x_atom(d, obj, 0);
+               if (NILP(type)) type = QATOM;
+       } else if (INTP(obj) && XINT(obj) <= 0x7FFF && XINT(obj) >= -0x8000) {
+               *format_ret = 16;
+               *size_ret = 1;
+               *data_ret = (unsigned char *)xmalloc_atomic(sizeof(short) + 1);
+               (*data_ret)[sizeof(short)] = 0;
+               (*(short **)data_ret)[0] = (short)XINT(obj);
+               if (NILP(type))
+                       type = QINTEGER;
+       } else if (INTP(obj) || CONSP(obj)) {
+               *format_ret = 32;
+               *size_ret = 1;
+               *data_ret = (unsigned char *)xmalloc_atomic(sizeof(long) + 1);
+               (*data_ret)[sizeof(long)] = 0;
+               (*(unsigned long **)data_ret)[0] = lisp_to_word(obj);
+               if (NILP(type))
+                       type = QINTEGER;
+       } else if (VECTORP(obj)) {
+               /* Lisp Vectors may represent a set of ATOMs;
+                  a set of 16 or 32 bit INTEGERs;
+                  or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
+               */
+               int i;
+               if (SYMBOLP(XVECTOR_DATA(obj)[0])) {
+                       /* This vector is an ATOM set */
+                       if (NILP(type)) {
+                               type = QATOM;
                        }
-                        *size_ret = XVECTOR_LENGTH(obj);
-                        *format_ret = 32;
-                        *data_ret = (unsigned char *)xmalloc_atomic(
+                       *size_ret = XVECTOR_LENGTH(obj);
+                       *format_ret = 32;
+                       *data_ret = (unsigned char *)xmalloc_atomic(
                                (*size_ret) * sizeof(Atom));
-                        for (i = 0; i < (int)(*size_ret); i++) {
-                                if (SYMBOLP(XVECTOR_DATA(obj)[i])) {
-                                        (*(Atom **) data_ret)[i] =
+                       for (i = 0; i < (int)(*size_ret); i++) {
+                               if (SYMBOLP(XVECTOR_DATA(obj)[i])) {
+                                       (*(Atom **) data_ret)[i] =
                                                symbol_to_x_atom(
                                                        d,
                                                        XVECTOR_DATA(obj)[i], 0);
-                                } else {
+                               } else {
                                        /* was: Qselection_error */
-                                        signal_error(
+                                       signal_error(
                                                Qerror,
                                                list2(build_string(tmp_err_1),
                                                      obj));
@@ -1356,32 +1356,32 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
 
 #if 0                          /* #### MULTIPLE doesn't work yet */
                } else if (VECTORP(XVECTOR_DATA(obj)[0])) {
-                        /* This vector is an ATOM_PAIR set */
-                        if (NILP(type)) type = QATOM_PAIR;
-                        *size_ret = XVECTOR_LENGTH(obj);
-                        *format_ret = 32;
-                        *data_ret = (unsigned char *)
-                                xmalloc_atomic((*size_ret) * sizeof(Atom) * 2);
-                        for (i = 0; i < *size_ret; i++) {
-                                if (VECTORP(XVECTOR_DATA(obj)[i])) {
-                                        Lisp_Object pair = XVECTOR_DATA(obj)[i];
-                                        if (XVECTOR_LENGTH(pair) != 2) {
-                                                signal_error(
+                       /* This vector is an ATOM_PAIR set */
+                       if (NILP(type)) type = QATOM_PAIR;
+                       *size_ret = XVECTOR_LENGTH(obj);
+                       *format_ret = 32;
+                       *data_ret = (unsigned char *)
+                               xmalloc_atomic((*size_ret) * sizeof(Atom) * 2);
+                       for (i = 0; i < *size_ret; i++) {
+                               if (VECTORP(XVECTOR_DATA(obj)[i])) {
+                                       Lisp_Object pair = XVECTOR_DATA(obj)[i];
+                                       if (XVECTOR_LENGTH(pair) != 2) {
+                                               signal_error(
                                                        Qerror,
                                                        list2(build_string(
                                                                      tmp_err_2),
                                                              pair));
                                        }
-                                        (*(Atom **) data_ret)[i * 2] =
-                                                symbol_to_x_atom(
+                                       (*(Atom **) data_ret)[i * 2] =
+                                               symbol_to_x_atom(
                                                        d,
                                                        XVECTOR_DATA(pair)[0], 0);
-                                        (*(Atom **) data_ret)[(i * 2) + 1] =
-                                                symbol_to_x_atom(
+                                       (*(Atom **) data_ret)[(i * 2) + 1] =
+                                               symbol_to_x_atom(
                                                        d,
                                                        XVECTOR_DATA(pair)[1], 0);
-                                } else {
-                                        signal_error(Qerror,
+                               } else {
+                                       signal_error(Qerror,
                                                     list2(build_string(
                                                                   tmp_err_3),
                                                           obj));
@@ -1389,19 +1389,19 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
                        }
 #endif
                } else {
-                        /* This vector is an INTEGER set or something like it */
-                        *size_ret = XVECTOR_LENGTH(obj);
-                        if (NILP(type)) {
-                                type = QINTEGER;
+                       /* This vector is an INTEGER set or something like it */
+                       *size_ret = XVECTOR_LENGTH(obj);
+                       if (NILP(type)) {
+                               type = QINTEGER;
                        }
-                        *format_ret = 16;
-                        for (i = 0; i < (int)(*size_ret); i++) {
-                                if (CONSP(XVECTOR_DATA(obj)[i])) {
-                                        * format_ret = 32;
-                                } else {
-                                        if (!INTP(XVECTOR_DATA(obj)[i])) {
+                       *format_ret = 16;
+                       for (i = 0; i < (int)(*size_ret); i++) {
+                               if (CONSP(XVECTOR_DATA(obj)[i])) {
+                                       * format_ret = 32;
+                               } else {
+                                       if (!INTP(XVECTOR_DATA(obj)[i])) {
                                                /* was: Qselection_error */
-                                                signal_error(
+                                               signal_error(
                                                        Qerror,
                                                        list2(build_string(
                                                                      tmp_err_4),
@@ -1409,22 +1409,22 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
                                        }
                                }
                        }
-                        *data_ret = xmalloc_atomic(*size_ret *
+                       *data_ret = xmalloc_atomic(*size_ret *
                                                   (*format_ret / 8));
-                        for (i = 0; i < (int)(*size_ret); i++)
-                                if (*format_ret == 32)
-                                        (*((unsigned long **)data_ret))[i] =
-                                                lisp_to_word(XVECTOR_DATA(obj)[i]);
-                                else
-                                        (*((unsigned short **)data_ret))[i] =
-                                                (unsigned short) lisp_to_word(XVECTOR_DATA(obj)[i]);
-                }
-        } else {
-                signal_error(Qerror,   /* Qselection_error */
-                             list2(build_string("unrecognized selection data"),
+                       for (i = 0; i < (int)(*size_ret); i++)
+                               if (*format_ret == 32)
+                                       (*((unsigned long **)data_ret))[i] =
+                                               lisp_to_word(XVECTOR_DATA(obj)[i]);
+                               else
+                                       (*((unsigned short **)data_ret))[i] =
+                                               (unsigned short) lisp_to_word(XVECTOR_DATA(obj)[i]);
+               }
+       } else {
+               signal_error(Qerror,    /* Qselection_error */
+                            list2(build_string("unrecognized selection data"),
                                   obj));
        }
-        *type_ret = symbol_to_x_atom(d, type, 0);
+       *type_ret = symbol_to_x_atom(d, type, 0);
 }
 
 \f
@@ -1434,47 +1434,47 @@ lisp_data_to_selection_data(struct device *d, Lisp_Object obj,
 void
 x_handle_selection_notify(XSelectionEvent * event)
 {
-        if (!reading_selection_reply)
-                message("received an unexpected SelectionNotify event");
-        else if (event->requestor != reading_selection_reply)
-                message("received a SelectionNotify event for the wrong window");
-        else if (event->selection != reading_which_selection)
-                message("received the wrong selection type in SelectionNotify!");
-        else
-                reading_selection_reply = 0;   /* we're done now. */
+       if (!reading_selection_reply)
+               message("received an unexpected SelectionNotify event");
+       else if (event->requestor != reading_selection_reply)
+               message("received a SelectionNotify event for the wrong window");
+       else if (event->selection != reading_which_selection)
+               message("received the wrong selection type in SelectionNotify!");
+       else
+               reading_selection_reply = 0;    /* we're done now. */
 }
 
 static void
 x_disown_selection(Lisp_Object selection, Lisp_Object timeval)
 {
-        struct device *d = decode_x_device(Qnil);
-        Display * display = DEVICE_X_DISPLAY(d);
-        Time timestamp;
-        Atom selection_atom;
-
-        CHECK_SYMBOL(selection);
-        if (NILP(timeval))
-                timestamp = DEVICE_X_MOUSE_TIMESTAMP(d);
-        else {
-                /* #### This is bogus.  See the comment above about problems
-                   on OSF/1 and DEC Alphas.  Yet another reason why it sucks
-                   to have the implementation (i.e. cons of two 16-bit
-                   integers) exposed. */
-                time_t the_time;
-                lisp_to_time(timeval, &the_time);
-                timestamp = (Time) the_time;
-        }
-
-        selection_atom = symbol_to_x_atom(d, selection, 0);
-        XSetSelectionOwner(display, selection_atom, None, timestamp);
+       struct device *d = decode_x_device(Qnil);
+       Display * display = DEVICE_X_DISPLAY(d);
+       Time timestamp;
+       Atom selection_atom;
+
+       CHECK_SYMBOL(selection);
+       if (NILP(timeval))
+               timestamp = DEVICE_X_MOUSE_TIMESTAMP(d);
+       else {
+               /* #### This is bogus.  See the comment above about problems
+                  on OSF/1 and DEC Alphas.  Yet another reason why it sucks
+                  to have the implementation (i.e. cons of two 16-bit
+                  integers) exposed. */
+               time_t the_time;
+               lisp_to_time(timeval, &the_time);
+               timestamp = (Time) the_time;
+       }
+
+       selection_atom = symbol_to_x_atom(d, selection, 0);
+       XSetSelectionOwner(display, selection_atom, None, timestamp);
 }
 
 static Lisp_Object
 x_selection_exists_p(Lisp_Object selection, Lisp_Object selection_type)
 {
-        struct device *d = decode_x_device(Qnil);
-        Display * dpy = DEVICE_X_DISPLAY(d);
-        return XGetSelectionOwner(dpy, symbol_to_x_atom(d, selection, 0)) != None ? Qt : Qnil;
+       struct device *d = decode_x_device(Qnil);
+       Display * dpy = DEVICE_X_DISPLAY(d);
+       return XGetSelectionOwner(dpy, symbol_to_x_atom(d, selection, 0)) != None ? Qt : Qnil;
 }
 
 \f
@@ -1485,32 +1485,32 @@ static int cut_buffers_initialized;     /* Whether we're sure they all exist */
 static void
 initialize_cut_buffers(Display * display, Window window)
 {
-        static unsigned const char *const data = (unsigned const char *)"";
+       static unsigned const char *const data = (unsigned const char *)"";
 #define FROB(atom) XChangeProperty (display, window, atom, XA_STRING, 8, \
                                    PropModeAppend, data, 0)
-        FROB(XA_CUT_BUFFER0);
-        FROB(XA_CUT_BUFFER1);
-        FROB(XA_CUT_BUFFER2);
-        FROB(XA_CUT_BUFFER3);
-        FROB(XA_CUT_BUFFER4);
-        FROB(XA_CUT_BUFFER5);
-        FROB(XA_CUT_BUFFER6);
-        FROB(XA_CUT_BUFFER7);
+       FROB(XA_CUT_BUFFER0);
+       FROB(XA_CUT_BUFFER1);
+       FROB(XA_CUT_BUFFER2);
+       FROB(XA_CUT_BUFFER3);
+       FROB(XA_CUT_BUFFER4);
+       FROB(XA_CUT_BUFFER5);
+       FROB(XA_CUT_BUFFER6);
+       FROB(XA_CUT_BUFFER7);
 #undef FROB
-        cut_buffers_initialized = 1;
+       cut_buffers_initialized = 1;
 }
 
 #define CHECK_CUTBUFFER(symbol) do {                                    \
-        CHECK_SYMBOL (symbol);                                                  \
-        if (! (EQ (symbol, QCUT_BUFFER0) ||                                     \
-               EQ (symbol, QCUT_BUFFER1) ||                                     \
-               EQ (symbol, QCUT_BUFFER2) ||                                     \
-               EQ (symbol, QCUT_BUFFER3) ||                                     \
-               EQ (symbol, QCUT_BUFFER4) ||                                     \
-               EQ (symbol, QCUT_BUFFER5) ||                                     \
-               EQ (symbol, QCUT_BUFFER6) ||                                     \
-               EQ (symbol, QCUT_BUFFER7)))                                      \
-                signal_simple_error ("Doesn't name a cutbuffer", symbol);       \
+       CHECK_SYMBOL (symbol);                                                  \
+       if (! (EQ (symbol, QCUT_BUFFER0) ||                                     \
+              EQ (symbol, QCUT_BUFFER1) ||                                     \
+              EQ (symbol, QCUT_BUFFER2) ||                                     \
+              EQ (symbol, QCUT_BUFFER3) ||                                     \
+              EQ (symbol, QCUT_BUFFER4) ||                                     \
+              EQ (symbol, QCUT_BUFFER5) ||                                     \
+              EQ (symbol, QCUT_BUFFER6) ||                                     \
+              EQ (symbol, QCUT_BUFFER7)))                                      \
+               signal_simple_error ("Doesn't name a cutbuffer", symbol);       \
 } while (0)
 
 DEFUN("x-get-cutbuffer-internal", Fx_get_cutbuffer_internal, 1, 1, 0, /*
@@ -1518,33 +1518,33 @@ Return the value of the named CUTBUFFER (typically CUT_BUFFER0).
 */
       (cutbuffer))
 {
-        struct device *d = decode_x_device(Qnil);
-        Display * display = DEVICE_X_DISPLAY(d);
-        Window window = RootWindow(display, 0); /* Cutbuffers are on frame 0 */
-        Atom cut_buffer_atom;
-        Extbyte * data;
-        int bytes;
-        Atom type;
-        int format;
-        unsigned long size;
-        Lisp_Object ret;
-
-        CHECK_CUTBUFFER(cutbuffer);
-        cut_buffer_atom = symbol_to_x_atom(d, cutbuffer, 0);
-        x_get_window_property(display, window, cut_buffer_atom, &data,
-                              &bytes, &type, &format, &size, 0);
-        if (!data)
-                return Qnil;
-        if (format != 8 || type != XA_STRING)
-                signal_simple_error_2("Cut buffer doesn't contain 8-bit STRING data",
-                                      x_atom_to_symbol(d, type), make_int(format));
-        /* We cheat - if the string contains an ESC character, that's
-           technically not allowed in a STRING, so we assume it's
-           COMPOUND_TEXT that we stored there ourselves earlier,
-           in x-store-cutbuffer-internal  */
-        ret = (bytes ? make_ext_string(data, bytes, memchr(data, 0x1b, bytes) ? Qctext : Qbinary) : Qnil);
-        xfree(data);
-        return ret;
+       struct device *d = decode_x_device(Qnil);
+       Display * display = DEVICE_X_DISPLAY(d);
+       Window window = RootWindow(display, 0); /* Cutbuffers are on frame 0 */
+       Atom cut_buffer_atom;
+       Extbyte * data;
+       int bytes;
+       Atom type;
+       int format;
+       unsigned long size;
+       Lisp_Object ret;
+
+       CHECK_CUTBUFFER(cutbuffer);
+       cut_buffer_atom = symbol_to_x_atom(d, cutbuffer, 0);
+       x_get_window_property(display, window, cut_buffer_atom, &data,
+                             &bytes, &type, &format, &size, 0);
+       if (!data)
+               return Qnil;
+       if (format != 8 || type != XA_STRING)
+               signal_simple_error_2("Cut buffer doesn't contain 8-bit STRING data",
+                                     x_atom_to_symbol(d, type), make_int(format));
+       /* We cheat - if the string contains an ESC character, that's
+          technically not allowed in a STRING, so we assume it's
+          COMPOUND_TEXT that we stored there ourselves earlier,
+          in x-store-cutbuffer-internal  */
+       ret = (bytes ? make_ext_string(data, bytes, memchr(data, 0x1b, bytes) ? Qctext : Qbinary) : Qnil);
+       xfree(data);
+       return ret;
 }
 
 DEFUN("x-store-cutbuffer-internal", Fx_store_cutbuffer_internal, 2, 2, 0,      /*
@@ -1552,64 +1552,64 @@ Set the value of the named CUTBUFFER (typically CUT_BUFFER0) to STRING.
 */
       (cutbuffer, string))
 {
-        struct device *d = decode_x_device(Qnil);
-        Display * display = DEVICE_X_DISPLAY(d);
-        Window window = RootWindow(display, 0);        /* Cutbuffers are on frame 0 */
-        Atom cut_buffer_atom;
-        const Bufbyte * data = XSTRING_DATA(string);
-        Bytecount bytes = XSTRING_LENGTH(string);
-        Bytecount bytes_remaining;
-        int max_bytes = SELECTION_QUANTUM(display);
+       struct device *d = decode_x_device(Qnil);
+       Display * display = DEVICE_X_DISPLAY(d);
+       Window window = RootWindow(display, 0); /* Cutbuffers are on frame 0 */
+       Atom cut_buffer_atom;
+       const Bufbyte * data = XSTRING_DATA(string);
+       Bytecount bytes = XSTRING_LENGTH(string);
+       Bytecount bytes_remaining;
+       int max_bytes = SELECTION_QUANTUM(display);
 #ifdef MULE
-        const Bufbyte * ptr, *end;
-        enum { ASCII, LATIN_1, WORLD } chartypes = ASCII;
+       const Bufbyte * ptr, *end;
+       enum { ASCII, LATIN_1, WORLD } chartypes = ASCII;
 #endif
-        if (max_bytes > MAX_SELECTION_QUANTUM)
-                max_bytes = MAX_SELECTION_QUANTUM;
-        CHECK_CUTBUFFER(cutbuffer);
-        CHECK_STRING(string);
-        cut_buffer_atom =
-                symbol_to_x_atom(d, cutbuffer, 0);
-        if (!cut_buffers_initialized)
-                initialize_cut_buffers(display, window);
-        /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT.
-           We cheat and use type = `STRING' even when using COMPOUND_TEXT.
-           The ICCCM requires that this be so, and other clients assume it,
-           as we do ourselves in initialize_cut_buffers.  */
+       if (max_bytes > MAX_SELECTION_QUANTUM)
+               max_bytes = MAX_SELECTION_QUANTUM;
+       CHECK_CUTBUFFER(cutbuffer);
+       CHECK_STRING(string);
+       cut_buffer_atom =
+               symbol_to_x_atom(d, cutbuffer, 0);
+       if (!cut_buffers_initialized)
+               initialize_cut_buffers(display, window);
+       /* We use the STRING encoding (Latin-1 only) if we can, else COMPOUND_TEXT.
+          We cheat and use type = `STRING' even when using COMPOUND_TEXT.
+          The ICCCM requires that this be so, and other clients assume it,
+          as we do ourselves in initialize_cut_buffers.  */
 #ifdef MULE
-        /* Optimize for the common ASCII case */
-        for (ptr = data, end = ptr + bytes; ptr <= end;) {
-                if (BYTE_ASCII_P(*ptr)) {
-                        ptr++;
-                        continue;
-                }
-
-                if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1
-                    || (*ptr) == LEADING_BYTE_CONTROL_1) {
-                        chartypes = LATIN_1;
-                        ptr += 2;
-                        continue;
-                }
-
-                chartypes = WORLD;
-                break;
-        }
-
-        if (chartypes == LATIN_1)
-                TO_EXTERNAL_FORMAT(LISP_STRING, string, ALLOCA, (data, bytes), Qbinary);
-        else if (chartypes == WORLD)
-                TO_EXTERNAL_FORMAT(LISP_STRING, string, ALLOCA, (data, bytes), Qctext);
+       /* Optimize for the common ASCII case */
+       for (ptr = data, end = ptr + bytes; ptr <= end;) {
+               if (BYTE_ASCII_P(*ptr)) {
+                       ptr++;
+                       continue;
+               }
+
+               if ((*ptr) == LEADING_BYTE_LATIN_ISO8859_1
+                   || (*ptr) == LEADING_BYTE_CONTROL_1) {
+                       chartypes = LATIN_1;
+                       ptr += 2;
+                       continue;
+               }
+
+               chartypes = WORLD;
+               break;
+       }
+
+       if (chartypes == LATIN_1)
+               TO_EXTERNAL_FORMAT(LISP_STRING, string, ALLOCA, (data, bytes), Qbinary);
+       else if (chartypes == WORLD)
+               TO_EXTERNAL_FORMAT(LISP_STRING, string, ALLOCA, (data, bytes), Qctext);
 #endif                         /* MULE */
-        bytes_remaining = bytes;
-        while (bytes_remaining) {
-                int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes;
-                XChangeProperty(display, window, cut_buffer_atom, XA_STRING, 8,
-                                (bytes_remaining == bytes ? PropModeReplace : PropModeAppend),
-                                data, chunk);
-                data += chunk;
-                bytes_remaining -= chunk;
-        }
-        return string;
+       bytes_remaining = bytes;
+       while (bytes_remaining) {
+               int chunk = bytes_remaining < max_bytes ? bytes_remaining : max_bytes;
+               XChangeProperty(display, window, cut_buffer_atom, XA_STRING, 8,
+                               (bytes_remaining == bytes ? PropModeReplace : PropModeAppend),
+                               data, chunk);
+               data += chunk;
+               bytes_remaining -= chunk;
+       }
+       return string;
 }
 
 DEFUN("x-rotate-cutbuffers-internal", Fx_rotate_cutbuffers_internal, 1, 1, 0,  /*
@@ -1618,26 +1618,26 @@ positive means move values forward, negative means backward.
 */
       (n))
 {
-        struct device *d = decode_x_device(Qnil);
-        Display * display = DEVICE_X_DISPLAY(d);
-        Window window = RootWindow(display, 0);        /* Cutbuffers are on frame 0 */
-        Atom props[8];
-
-        CHECK_INT(n);
-        if (XINT(n) == 0)
-                return n;
-        if (!cut_buffers_initialized)
-                initialize_cut_buffers(display, window);
-        props[0] = XA_CUT_BUFFER0;
-        props[1] = XA_CUT_BUFFER1;
-        props[2] = XA_CUT_BUFFER2;
-        props[3] = XA_CUT_BUFFER3;
-        props[4] = XA_CUT_BUFFER4;
-        props[5] = XA_CUT_BUFFER5;
-        props[6] = XA_CUT_BUFFER6;
-        props[7] = XA_CUT_BUFFER7;
-        XRotateWindowProperties(display, window, props, 8, XINT(n));
-        return n;
+       struct device *d = decode_x_device(Qnil);
+       Display * display = DEVICE_X_DISPLAY(d);
+       Window window = RootWindow(display, 0); /* Cutbuffers are on frame 0 */
+       Atom props[8];
+
+       CHECK_INT(n);
+       if (XINT(n) == 0)
+               return n;
+       if (!cut_buffers_initialized)
+               initialize_cut_buffers(display, window);
+       props[0] = XA_CUT_BUFFER0;
+       props[1] = XA_CUT_BUFFER1;
+       props[2] = XA_CUT_BUFFER2;
+       props[3] = XA_CUT_BUFFER3;
+       props[4] = XA_CUT_BUFFER4;
+       props[5] = XA_CUT_BUFFER5;
+       props[6] = XA_CUT_BUFFER6;
+       props[7] = XA_CUT_BUFFER7;
+       XRotateWindowProperties(display, window, props, 8, XINT(n));
+       return n;
 }
 #endif                         /* CUT_BUFFER_SUPPORT */
 
@@ -1650,54 +1650,54 @@ void
 syms_of_select_x(void)
 {
 #ifdef CUT_BUFFER_SUPPORT
-        DEFSUBR(Fx_get_cutbuffer_internal);
-        DEFSUBR(Fx_store_cutbuffer_internal);
-        DEFSUBR(Fx_rotate_cutbuffers_internal);
+       DEFSUBR(Fx_get_cutbuffer_internal);
+       DEFSUBR(Fx_store_cutbuffer_internal);
+       DEFSUBR(Fx_rotate_cutbuffers_internal);
 #endif                         /* CUT_BUFFER_SUPPORT */
-        /* Unfortunately, timeout handlers must be lisp functions. */
-        defsymbol (&Qx_selection_reply_timeout_internal,
-                   "x-selection-reply-timeout-internal");
-        DEFSUBR(Fx_selection_reply_timeout_internal);
+       /* Unfortunately, timeout handlers must be lisp functions. */
+       defsymbol (&Qx_selection_reply_timeout_internal,
+                  "x-selection-reply-timeout-internal");
+       DEFSUBR(Fx_selection_reply_timeout_internal);
 #ifdef CUT_BUFFER_SUPPORT
-        defsymbol(&QCUT_BUFFER0, "CUT_BUFFER0");
-        defsymbol(&QCUT_BUFFER1, "CUT_BUFFER1");
-        defsymbol(&QCUT_BUFFER2, "CUT_BUFFER2");
-        defsymbol(&QCUT_BUFFER3, "CUT_BUFFER3");
-        defsymbol(&QCUT_BUFFER4, "CUT_BUFFER4");
-        defsymbol(&QCUT_BUFFER5, "CUT_BUFFER5");
-        defsymbol(&QCUT_BUFFER6, "CUT_BUFFER6");
-        defsymbol(&QCUT_BUFFER7, "CUT_BUFFER7");
+       defsymbol(&QCUT_BUFFER0, "CUT_BUFFER0");
+       defsymbol(&QCUT_BUFFER1, "CUT_BUFFER1");
+       defsymbol(&QCUT_BUFFER2, "CUT_BUFFER2");
+       defsymbol(&QCUT_BUFFER3, "CUT_BUFFER3");
+       defsymbol(&QCUT_BUFFER4, "CUT_BUFFER4");
+       defsymbol(&QCUT_BUFFER5, "CUT_BUFFER5");
+       defsymbol(&QCUT_BUFFER6, "CUT_BUFFER6");
+       defsymbol(&QCUT_BUFFER7, "CUT_BUFFER7");
 #endif                         /* CUT_BUFFER_SUPPORT */
 }
 
 void
 console_type_create_select_x(void)
 {
-        CONSOLE_HAS_METHOD(x, own_selection);
-        CONSOLE_HAS_METHOD(x, disown_selection);
-        CONSOLE_HAS_METHOD(x, get_foreign_selection);
-        CONSOLE_HAS_METHOD(x, selection_exists_p);
+       CONSOLE_HAS_METHOD(x, own_selection);
+       CONSOLE_HAS_METHOD(x, disown_selection);
+       CONSOLE_HAS_METHOD(x, get_foreign_selection);
+       CONSOLE_HAS_METHOD(x, selection_exists_p);
 }
 
 void
 reinit_vars_of_select_x(void)
 {
-        reading_selection_reply = 0;
-        reading_which_selection = 0;
-        selection_reply_timed_out = 0;
-        for_whom_the_bell_tolls = 0;
-        prop_location_tick = 0;
+       reading_selection_reply = 0;
+       reading_which_selection = 0;
+       selection_reply_timed_out = 0;
+       for_whom_the_bell_tolls = 0;
+       prop_location_tick = 0;
 }
 
 void
 vars_of_select_x(void)
 {
-        reinit_vars_of_select_x();
+       reinit_vars_of_select_x();
 #ifdef CUT_BUFFER_SUPPORT
-        cut_buffers_initialized = 0;
-        Fprovide(intern("cut-buffer"));
+       cut_buffers_initialized = 0;
+       Fprovide(intern("cut-buffer"));
 #endif
-        DEFVAR_LISP("x-sent-selection-hooks", &Vx_sent_selection_hooks /*
+       DEFVAR_LISP("x-sent-selection-hooks", &Vx_sent_selection_hooks  /*
 A function or functions to be called after we have responded to some
 other client's request for the value of a selection that we own.  The
 function(s) will be called with four arguments:
@@ -1710,17 +1710,17 @@ including being asked for a selection that we no longer own, or being asked
 to convert into a type that we don't know about or that is inappropriate.
 This hook doesn't let you change the behavior of emacs's selection replies,
 it merely informs you that they have happened.
-                                                                        */ );
-        Vx_sent_selection_hooks = Qunbound;
+                                                                       */ );
+       Vx_sent_selection_hooks = Qunbound;
 
-        DEFVAR_INT("x-selection-timeout", &x_selection_timeout /*
+       DEFVAR_INT("x-selection-timeout", &x_selection_timeout  /*
 If the selection owner doesn't reply in this many seconds, we give up.
 A value of 0 means wait as long as necessary.  This is initialized from the
-\"*selectionTimeout\" resource (which is expressed in milliseconds). 
-                                                                */ );
-        x_selection_timeout = 0;
+\"*selectionTimeout\" resource (which is expressed in milliseconds).
+                                                               */ );
+       x_selection_timeout = 0;
 
-        DEFVAR_BOOL("x-selection-strict-motif-ownership", &x_selection_strict_motif_ownership  /*
+       DEFVAR_BOOL("x-selection-strict-motif-ownership", &x_selection_strict_motif_ownership   /*
 *If nil and SXEmacs already owns the clipboard, don't own it again in the
 Motif way. Owning the selection on the Motif way does a huge amount of
 X protocol, and it makes killing text incredibly slow when using an
@@ -1728,36 +1728,36 @@ X terminal.  However, when enabled Motif text fields don't bother to look up
 the new value, and you can't Copy from a buffer, Paste into a text
 field, then Copy something else from the buffer and paste it into the
 text field; it pastes the first thing again.
-                                                                                                */ );
-        x_selection_strict_motif_ownership = 1;
+                                                                                               */ );
+       x_selection_strict_motif_ownership = 1;
 }
 
 void
 Xatoms_of_select_x(struct device *d)
 {
-        Display * D = DEVICE_X_DISPLAY(d);
-        /* Non-predefined atoms that we might end up using a lot */
-        DEVICE_XATOM_CLIPBOARD(d) =
-                XInternAtom(D, "CLIPBOARD", False);
-        DEVICE_XATOM_TIMESTAMP(d) =
-                XInternAtom(D, "TIMESTAMP", False);
-        DEVICE_XATOM_TEXT(d) =
-                XInternAtom(D, "TEXT", False);
-        DEVICE_XATOM_DELETE(d) =
-                XInternAtom(D, "DELETE", False);
-        DEVICE_XATOM_MULTIPLE(d) =
-                XInternAtom(D, "MULTIPLE", False);
-        DEVICE_XATOM_INCR(d) =
-                XInternAtom(D, "INCR", False);
-        DEVICE_XATOM_TARGETS(d) =
-                XInternAtom(D, "TARGETS", False);
-        DEVICE_XATOM_NULL(d) =
-                XInternAtom(D, "NULL", False);
-        DEVICE_XATOM_ATOM_PAIR(d) =
-                XInternAtom(D, "ATOM_PAIR", False);
-        DEVICE_XATOM_COMPOUND_TEXT(d) =
-                XInternAtom(D, "COMPOUND_TEXT", False);
-        /* #### I don't like the looks of this... what is it for? - ajh */
-        DEVICE_XATOM_EMACS_TMP(d) =
-                XInternAtom(D, "_EMACS_TMP_", False);
+       Display * D = DEVICE_X_DISPLAY(d);
+       /* Non-predefined atoms that we might end up using a lot */
+       DEVICE_XATOM_CLIPBOARD(d) =
+               XInternAtom(D, "CLIPBOARD", False);
+       DEVICE_XATOM_TIMESTAMP(d) =
+               XInternAtom(D, "TIMESTAMP", False);
+       DEVICE_XATOM_TEXT(d) =
+               XInternAtom(D, "TEXT", False);
+       DEVICE_XATOM_DELETE(d) =
+               XInternAtom(D, "DELETE", False);
+       DEVICE_XATOM_MULTIPLE(d) =
+               XInternAtom(D, "MULTIPLE", False);
+       DEVICE_XATOM_INCR(d) =
+               XInternAtom(D, "INCR", False);
+       DEVICE_XATOM_TARGETS(d) =
+               XInternAtom(D, "TARGETS", False);
+       DEVICE_XATOM_NULL(d) =
+               XInternAtom(D, "NULL", False);
+       DEVICE_XATOM_ATOM_PAIR(d) =
+               XInternAtom(D, "ATOM_PAIR", False);
+       DEVICE_XATOM_COMPOUND_TEXT(d) =
+               XInternAtom(D, "COMPOUND_TEXT", False);
+       /* #### I don't like the looks of this... what is it for? - ajh */
+       DEVICE_XATOM_EMACS_TMP(d) =
+               XInternAtom(D, "_EMACS_TMP_", False);
 }
index 67eb9a1..fe28f39 100644 (file)
@@ -304,7 +304,7 @@ x_get_button_size(struct frame *f, Lisp_Object window,
        if (left && tb->pushright)                                      \
          break;                                                        \
                                                                        \
-        size = x_get_button_size (f, window, tb, vert, pos);           \
+       size = x_get_button_size (f, window, tb, vert, pos);            \
                                                                        \
        if (vert)                                                       \
          {                                                             \
@@ -336,17 +336,17 @@ x_get_button_size(struct frame *f, Lisp_Object window,
                tb->y = y;                                              \
                tb->width = width;                                      \
                tb->height = height;                                    \
-               tb->border_width = border_width;                        \
-               tb->vertical = vert;                                    \
+               tb->border_width = border_width;                        \
+               tb->vertical = vert;                                    \
                                                                        \
-                if (tb->blank || NILP (tb->up_glyph))                  \
+               if (tb->blank || NILP (tb->up_glyph))                   \
                  {                                                     \
                    int threed = (EQ (Qt, tb->up_glyph) ? 1 : 0);       \
                    x_draw_blank_toolbar_button (f, x, y, width,        \
                                                 height, threed,        \
                                                 border_width, vert);   \
                  }                                                     \
-               else                                                    \
+               else                                                    \
                  x_output_toolbar_button (f, button);                  \
              }                                                         \
          }                                                             \
index 068ce4b..2512b1f 100644 (file)
@@ -151,7 +151,7 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
        struct gc_cache_cell *cell = NULL, *next = NULL, *prev = NULL;
        struct gcv_and_mask gcvm;
 
-       if (cache == NULL) 
+       if (cache == NULL)
                abort();
        else if ((!!cache->head) != (!!cache->tail))
                abort();
@@ -163,12 +163,12 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
 
 #ifdef GCCACHE_HASH
 
-               if (gethash(&gcvm, cache->table, 
+               if (gethash(&gcvm, cache->table,
                            (const void **)((void*)&cell)))
 #else                          /* !GCCACHE_HASH */
 
                /* start at the end (most recently used) */
-               cell = cache->tail;     
+               cell = cache->tail;
                while (cell) {
                        if (gc_cache_eql(&gcvm, &cell->gcvm))
                                break;
@@ -189,7 +189,7 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
                           be collected than a cell that was accessed
                           less recently.
                        */
-                       
+
                        if (!cell) {
                                abort();
                                return NULL;
@@ -222,7 +222,7 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
                                return cell->gc;
                        }
                }
-               
+
                /* else, cache miss. */
                if (cache == NULL)
                        abort();
@@ -255,7 +255,7 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
                           it in. */
                        memcpy(&cell->gcvm.gcv, gcv, sizeof(XGCValues));
                        cell->gcvm.mask = mask;
-               
+
                        /* Put the cell on the end of the list. */
                        cell->next = 0;
                        cell->prev = cache->tail;
@@ -270,7 +270,7 @@ GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
                        puthash(&cell->gcvm, cell, cache->table);
 #endif
                        /* Now make and return the GC. */
-                       cell->gc = XCreateGC(cache->dpy, cache->window, 
+                       cell->gc = XCreateGC(cache->dpy, cache->window,
                                             mask, gcv);
                        /* debug */
                        assert(cell->gc == gc_cache_lookup(cache, gcv, mask));
index 1201462..90864e6 100644 (file)
@@ -442,7 +442,7 @@ int XmuPrintDefaultErrorMessage(Display * dpy, XErrorEvent * event, FILE * fp)
                                      "Request Minor code %d", mesg, BUFSIZ);
                fprintf(fp, mesg, event->minor_code);
                if (ext) {
-                       in sz = snprintf(mesg, sizeof(mesg), "%s.%d", ext->name, 
+                       in sz = snprintf(mesg, sizeof(mesg), "%s.%d", ext->name,
                                         event->minor_code);
                        assert(sz >= 0 && sz < sizeof(mesg));
                        XGetErrorDatabaseText(dpy, "XRequest", mesg, "", buffer,
@@ -470,7 +470,7 @@ int XmuPrintDefaultErrorMessage(Display * dpy, XErrorEvent * event, FILE * fp)
                                break;
                }
                if (buffer[0]) {
-                       int sz = snprintf(buffer, sizeof(buffer), "%s.%d", 
+                       int sz = snprintf(buffer, sizeof(buffer), "%s.%d",
                                          ext->name,
                                          event->error_code - ext->codes.first_error);
                        assert(sz >= 0 && sz < sizeof(buffer));