X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/8e6ca83dfede41bbc8d060a4aaa72f2a414f59ae..1dd3c2d9b2466eb6dc379da6a67074dbd4c13fa5:/src/emacs.c diff --git a/src/emacs.c b/src/emacs.c index 8c4490b0a5..090fddada5 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1959,6 +1959,11 @@ sort_args (int argc, char **argv) xfree (priority); } +#ifdef HAVE_X_WINDOWS +/* Defined in xselect.c. */ +extern void x_clipboard_manager_save_all (void); +#endif + DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P", doc: /* Exit the Emacs job and kill it. If ARG is an integer, return ARG as the exit program code. @@ -1985,6 +1990,11 @@ all of which are called before Emacs is actually killed. */) UNGCPRO; +#ifdef HAVE_X_WINDOWS + /* Transfer any clipboards we own to the clipboard manager. */ + x_clipboard_manager_save_all (); +#endif + shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); /* If we have an auto-save list file,