From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Newsgroups: gmane.emacs.help Subject: Re: how to tell graphical Emacs to shutdown cleanly from tty1? Date: Tue, 17 Nov 2015 10:32:08 -0500 Message-ID: <87mvuc3amf.fsf@yale.edu> References: <87si45wbp2.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1447774594 22799 80.91.229.3 (17 Nov 2015 15:36:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 15:36:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 17 16:36:26 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZyiHw-0000pg-6p for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Nov 2015 16:35:20 +0100 Original-Received: from localhost ([::1]:59124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiHv-0007o9-B4 for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Nov 2015 10:35:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiHd-0007jO-KT for help-gnu-emacs@gnu.org; Tue, 17 Nov 2015 10:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyiHZ-0003KW-K1 for help-gnu-emacs@gnu.org; Tue, 17 Nov 2015 10:35:01 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:53082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyiHZ-0003JX-D3 for help-gnu-emacs@gnu.org; Tue, 17 Nov 2015 10:34:57 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZyiGR-0007Xt-1M for help-gnu-emacs@gnu.org; Tue, 17 Nov 2015 16:33:47 +0100 Original-Received: from 130.132.236.141 ([130.132.236.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2015 16:33:47 +0100 Original-Received: from jorge.alfaro-murillo by 130.132.236.141 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Nov 2015 16:33:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 130.132.236.141 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:dIF1w7XNkzZ3wOuExuZ5aNeZWts= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108113 Archived-At: Tom Roche writes: > Lately I run GNU Emacs mostly as GUI on X/tty7 (which I'll call > "the desktop" as opposed to emacs-desktop) on one of my Debian > laptops. Occasionally the desktop hangs, in which case I usually > can goto tty1 and `sudo shutdown -whatever now`. Unfortunately > this does not seem to cause Emacs to shut down as cleanly as I'd > like: I'd like Emacs to (e.g.) save any unsaved buffers and save > its emacs-desktop, but that doesn't seem to get done. (Am I > missing something?) > > So I'm thinking that, in this usecase, I should utter something > from tty1 (before `shutdown`) to tell Emacs to shutdown cleanly > ... but I don't know what to say. How to do this? Start a server every time that you start your computer, from a terminal you can do: #+BEGIN_SRC shell emacsclient -c -a '' #+END_SRC every time that you want to open emacs. That will start a server if there is none or connect if there is one already. You will be able to connect to that server even from TTY1, and M-x save-buffers-kill-emacs if you want a clean exit. But I guess the relevant question is, why is your X hanging? -- Jorge.