Fix some uses of int instead of EMACS_INT.
[bpt/emacs.git] / src / keyboard.c
index cac051f..4785036 100644 (file)
@@ -1493,6 +1493,11 @@ cancel_hourglass_unwind (Lisp_Object arg)
 }
 #endif
 
+/* FIXME: This is wrong rather than test window-system, we should call
+   a new set-selection, which will then dispatch to x-set-selection, or
+   tty-set-selection, or w32-set-selection, ...  */
+EXFUN (Fwindow_system, 1);
+
 Lisp_Object
 command_loop_1 (void)
 {
@@ -1799,14 +1804,16 @@ command_loop_1 (void)
            {
              /* Even if not deactivating the mark, set PRIMARY if
                 `select-active-regions' is non-nil.  */
-             if ((EQ (Vselect_active_regions, Qonly)
-                  ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
-                  : (!NILP (Vselect_active_regions)
-                     && !NILP (Vtransient_mark_mode)))
+             if (!NILP (Fwindow_system (Qnil))
+                 && (EQ (Vselect_active_regions, Qonly)
+                     ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
+                     : (!NILP (Vselect_active_regions)
+                        && !NILP (Vtransient_mark_mode)))
                  && !EQ (Vthis_command, Qhandle_switch_frame))
                {
-                 int beg = XINT (Fmarker_position (current_buffer->mark));
-                 int end = XINT (make_number (PT));
+                 EMACS_INT beg =
+                   XINT (Fmarker_position (current_buffer->mark));
+                 EMACS_INT end = PT;
                  if (beg < end)
                    call2 (Qx_set_selection, QPRIMARY,
                           make_buffer_string (beg, end, 0));
@@ -8299,7 +8306,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
         {
           const char *bad_label = "!!?GARBLED ITEM?!!";
           /* `:label LABEL-STRING'.  */
-          PROP (TOOL_BAR_ITEM_HELP) = STRINGP (value)
+          PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value)
             ? value
             : make_string (bad_label, strlen (bad_label));
           have_label = 1;