emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104493: * src/xselect.c (x_get_forei


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104493: * src/xselect.c (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
Date: Sat, 04 Jun 2011 18:08:32 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104493
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2011-06-04 18:08:32 -0400
message:
  * src/xselect.c (x_get_foreign_selection): Reduce scope of x_catch_errors 
(Bug#8790).
modified:
  src/ChangeLog
  src/xselect.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-06-04 21:02:42 +0000
+++ b/src/ChangeLog     2011-06-04 22:08:32 +0000
@@ -8,6 +8,7 @@
        Obey Vx_select_enable_clipboard_manager.  Catch errors in
        x_clipboard_manager_save (Bug#8779).
        (Vx_select_enable_clipboard_manager): New variable.
+       (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
 
 2011-06-04  Dan Nicolaescu  <address@hidden>
 

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2011-06-04 21:02:42 +0000
+++ b/src/xselect.c     2011-06-04 22:08:32 +0000
@@ -1207,7 +1207,6 @@
                    ? symbol_to_x_atom (dpyinfo, XCAR (target_type))
                    : symbol_to_x_atom (dpyinfo, target_type));
   int secs, usecs;
-  int count = SPECPDL_INDEX ();
 
   if (!FRAME_LIVE_P (f))
     return Qnil;
@@ -1225,20 +1224,15 @@
     }
 
   BLOCK_INPUT;
-
-  /* The protected block contains wait_reading_process_output, which
-     can run random lisp code (process handlers) or signal.
-     Therefore, we put the x_uncatch_errors call in an unwind.  */
-  record_unwind_protect (x_catch_errors_unwind, Qnil);
-  x_catch_errors (display);
-
   TRACE2 ("Get selection %s, type %s",
          XGetAtomName (display, type_atom),
          XGetAtomName (display, target_property));
 
+  x_catch_errors (display);
   XConvertSelection (display, selection_atom, type_atom, target_property,
                     requestor_window, requestor_time);
-  XFlush (display);
+  x_check_errors (display, "Can't convert selection: %s");
+  x_uncatch_errors ();
 
   /* Prepare to block until the reply has been read.  */
   reading_selection_window = requestor_window;
@@ -1264,13 +1258,6 @@
                               reading_selection_reply, NULL, 0);
   TRACE1 ("  Got event = %d", !NILP (XCAR (reading_selection_reply)));
 
-  BLOCK_INPUT;
-  if (x_had_errors_p (display))
-    error ("Cannot get selection");
-  /* This calls x_uncatch_errors.  */
-  unbind_to (count, Qnil);
-  UNBLOCK_INPUT;
-
   if (NILP (XCAR (reading_selection_reply)))
     error ("Timed out waiting for reply from selection owner");
   if (EQ (XCAR (reading_selection_reply), Qlambda))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]