diff options
| author | Stefan Monnier | 2010-12-13 10:27:36 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-12-13 10:27:36 -0500 |
| commit | f49d1f52b2e368ef67dcfececd426de958548f4e (patch) | |
| tree | ce24ced92f2acc976daf4b69e3634c8bd600e44e /src/xsmfns.c | |
| parent | 07176b2a9e63a0d3933b167f987475d8a18da5cc (diff) | |
| parent | 11aad4e9f9f54ce8e9ecc66347e512b20a3cdf39 (diff) | |
| download | emacs-f49d1f52b2e368ef67dcfececd426de958548f4e.tar.gz emacs-f49d1f52b2e368ef67dcfececd426de958548f4e.zip | |
Merge from emacs-23
Diffstat (limited to 'src/xsmfns.c')
| -rw-r--r-- | src/xsmfns.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/xsmfns.c b/src/xsmfns.c index 7b82fd4e61e..561fd5ee51a 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -172,6 +172,7 @@ smc_interact_CB (SmcConn smcConn, SmPointer clientData) | |||
| 172 | { | 172 | { |
| 173 | doing_interact = True; | 173 | doing_interact = True; |
| 174 | emacs_event.kind = SAVE_SESSION_EVENT; | 174 | emacs_event.kind = SAVE_SESSION_EVENT; |
| 175 | emacs_event.arg = Qnil; | ||
| 175 | } | 176 | } |
| 176 | 177 | ||
| 177 | /* This is called when the session manager tells us to save ourselves. | 178 | /* This is called when the session manager tells us to save ourselves. |
| @@ -308,8 +309,8 @@ smc_save_yourself_CB (SmcConn smcConn, | |||
| 308 | static void | 309 | static void |
| 309 | smc_die_CB (SmcConn smcConn, SmPointer clientData) | 310 | smc_die_CB (SmcConn smcConn, SmPointer clientData) |
| 310 | { | 311 | { |
| 311 | SmcCloseConnection (smcConn, 0, 0); | 312 | emacs_event.kind = SAVE_SESSION_EVENT; |
| 312 | ice_connection_closed (); | 313 | emacs_event.arg = Qt; |
| 313 | } | 314 | } |
| 314 | 315 | ||
| 315 | /* We don't use the next two but they are mandatory, leave them empty. | 316 | /* We don't use the next two but they are mandatory, leave them empty. |
| @@ -522,9 +523,12 @@ is told to abort the window system shutdown. | |||
| 522 | Do not call this function yourself. */) | 523 | Do not call this function yourself. */) |
| 523 | (Lisp_Object event) | 524 | (Lisp_Object event) |
| 524 | { | 525 | { |
| 526 | int kill_emacs = CONSP (event) && CONSP (XCDR (event)) | ||
| 527 | && EQ (Qt, XCAR (XCDR (event))); | ||
| 528 | |||
| 525 | /* Check doing_interact so that we don't do anything if someone called | 529 | /* Check doing_interact so that we don't do anything if someone called |
| 526 | this at the wrong time. */ | 530 | this at the wrong time. */ |
| 527 | if (doing_interact) | 531 | if (doing_interact && ! kill_emacs) |
| 528 | { | 532 | { |
| 529 | Bool cancel_shutdown = False; | 533 | Bool cancel_shutdown = False; |
| 530 | 534 | ||
| @@ -535,9 +539,20 @@ Do not call this function yourself. */) | |||
| 535 | 539 | ||
| 536 | doing_interact = False; | 540 | doing_interact = False; |
| 537 | } | 541 | } |
| 542 | else if (kill_emacs) | ||
| 543 | { | ||
| 544 | /* We should not do user interaction here, but it is not easy to | ||
| 545 | prevent. Fix this in next version. */ | ||
| 546 | Fkill_emacs (Qnil); | ||
| 538 | 547 | ||
| 548 | /* This will not be reached, but we want kill-emacs-hook to be run. */ | ||
| 549 | SmcCloseConnection (smc_conn, 0, 0); | ||
| 550 | ice_connection_closed (); | ||
| 551 | } | ||
| 552 | |||
| 539 | return Qnil; | 553 | return Qnil; |
| 540 | } | 554 | } |
| 555 | |||
| 541 | 556 | ||
| 542 | 557 | ||
| 543 | /*********************************************************************** | 558 | /*********************************************************************** |