[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8760: 24.0.50; Cannot kill emacs after killing text to kill-ring
From: |
Chong Yidong |
Subject: |
bug#8760: 24.0.50; Cannot kill emacs after killing text to kill-ring |
Date: |
Wed, 01 Jun 2011 15:01:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
David De La Harpe Golden <david@harpegolden.net> writes:
> I can simulate this failure by pausing (kill -STOP/-CONT) my desktop
> environment's clipboard manager - that way, it looks like there's an
> owner of the clipboard manager selection that is unresponsive.
>
> Arguably, emacs, if it's in the middle of exiting, could just carry on
> exiting after the selection timeout period in case it fails to
> interact with a present but uncommunicative clipboard manager, not
> fail to exit. Then the worst that happens in case of a malfunctioning
> desktop clipboard manager is a brief pause on exit (and of course a
> failure to persist clipboard contents after exit, but, well, one can't
> expect that to work if the desktop clipboard manager isn't working).
Right. Does this patch handle your test case properly?
One concern I have is that even if the clipboard manager is screwing up,
it will appear as though it's Emacs' fault for taking ages to delete a
frame and/or shut down. Dunno how we can inform the user, though.
=== modified file 'src/xselect.c'
*** src/xselect.c 2011-05-29 05:23:24 +0000
--- src/xselect.c 2011-06-01 18:55:25 +0000
***************
*** 2112,2122 ****
UTF8_STRING property, as described by
http://www.freedesktop.org/wiki/ClipboardManager */
! static void
! x_clipboard_manager_save (struct x_display_info *dpyinfo,
! Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
Atom data = dpyinfo->Xatom_UTF8_STRING;
XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
--- 2112,2122 ----
UTF8_STRING property, as described by
http://www.freedesktop.org/wiki/ClipboardManager */
! static Lisp_Object
! x_clipboard_manager_save (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
+ struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Atom data = dpyinfo->Xatom_UTF8_STRING;
XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
***************
*** 2148,2154 ****
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (local_selection)))))
&& XGetSelectionOwner (dpyinfo->display,
dpyinfo->Xatom_CLIPBOARD_MANAGER))
! x_clipboard_manager_save (dpyinfo, frame);
}
}
--- 2148,2155 ----
&& EQ (frame, XCAR (XCDR (XCDR (XCDR (local_selection)))))
&& XGetSelectionOwner (dpyinfo->display,
dpyinfo->Xatom_CLIPBOARD_MANAGER))
! internal_condition_case_1 (x_clipboard_manager_save,
! frame, Qt, Fidentity);
}
}
***************
*** 2172,2178 ****
local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
if (FRAME_LIVE_P (XFRAME (local_frame)))
! x_clipboard_manager_save (dpyinfo, local_frame);
}
}
--- 2173,2180 ----
local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
if (FRAME_LIVE_P (XFRAME (local_frame)))
! internal_condition_case_1 (x_clipboard_manager_save,
! local_frame, Qt, Fidentity);
}
}
- bug#8760: 24.0.50; Cannot kill emacs after killing text to kill-ring,
Chong Yidong <=