unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to tell graphical Emacs to shutdown cleanly from tty1?
@ 2015-11-17  3:23 Tom Roche
  2015-11-17  4:05 ` Emanuel Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tom Roche @ 2015-11-17  3:23 UTC (permalink / raw)
  To: help-gnu-emacs


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?

TIA, Tom Roche <Tom_Roche@pobox.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to tell graphical Emacs to shutdown cleanly from tty1?
  2015-11-17  3:23 how to tell graphical Emacs to shutdown cleanly from tty1? Tom Roche
@ 2015-11-17  4:05 ` Emanuel Berg
  2015-11-17  4:34 ` Yuri Khan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2015-11-17  4:05 UTC (permalink / raw)
  To: help-gnu-emacs

Tom Roche <Tom_Roche@pobox.com> 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.

Yes - the pecking order is:

(boot) -> ... -> tty6 -> X (in tty7) -> GNOME or KDE with
a window manager -> GUI Emacs

The "desktop" is the GNOME/KDE/whatever part. You can
do without it like this:

1. Disable the login manager (google your desktop to
   find out what it is).

2. Now the computer won't start X.

3. So instead you do it with manually with startx(1)
   or xinit(1) (put such a call is the shell's
   "profile" file - e.g., ~/.zprofile for zsh - to
   have it automatized if you want it on every boot).

4. In ~/.xinitrc, start a window manager, e.g.
   openbox(1), in the *background* (with "&" after the
   command) - last, add a call to a terminal emulator
   (e.g., xterm), *not* running in the background.

Done - either start Emacs in xinitrc as well, or do it
from xterm. Now you have the same GUI Emacs but
without the diffuse desktop stuff!

> Occasionally the desktop hangs

Try my method and see if it still does. It "shouldn't"
in either case, but if it does, it does.

> 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?)

Well, the problem isn't "how to shut Emacs down
gracefully when the desktop is hanged" but "why does
the desktop hang and how can I fix it?" That said, the
man page for kill(1) may help you.

> 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?

You can hope to do something with IPC and kill in
particular, but again, get the desktop working or get
it away is the actual solution.

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to tell graphical Emacs to shutdown cleanly from tty1?
  2015-11-17  3:23 how to tell graphical Emacs to shutdown cleanly from tty1? Tom Roche
  2015-11-17  4:05 ` Emanuel Berg
@ 2015-11-17  4:34 ` Yuri Khan
  2015-11-17 15:32 ` Jorge A. Alfaro-Murillo
  2015-11-17 19:01 ` Tom Roche
  3 siblings, 0 replies; 5+ messages in thread
From: Yuri Khan @ 2015-11-17  4:34 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org, Tom Roche

On Tue, Nov 17, 2015 at 9:23 AM, Tom Roche <Tom_Roche@pobox.com> wrote:

> 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?

Assuming that your Emacs is running a server, you can connect to it
with emacs-client and then execute (kill-emacs).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to tell graphical Emacs to shutdown cleanly from tty1?
  2015-11-17  3:23 how to tell graphical Emacs to shutdown cleanly from tty1? Tom Roche
  2015-11-17  4:05 ` Emanuel Berg
  2015-11-17  4:34 ` Yuri Khan
@ 2015-11-17 15:32 ` Jorge A. Alfaro-Murillo
  2015-11-17 19:01 ` Tom Roche
  3 siblings, 0 replies; 5+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2015-11-17 15:32 UTC (permalink / raw)
  To: help-gnu-emacs

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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: how to tell graphical Emacs to shutdown cleanly from tty1?
  2015-11-17  3:23 how to tell graphical Emacs to shutdown cleanly from tty1? Tom Roche
                   ` (2 preceding siblings ...)
  2015-11-17 15:32 ` Jorge A. Alfaro-Murillo
@ 2015-11-17 19:01 ` Tom Roche
  3 siblings, 0 replies; 5+ messages in thread
From: Tom Roche @ 2015-11-17 19:01 UTC (permalink / raw)
  To: help-gnu-emacs


Tom Roche http://lists.gnu.org/archive/html/help-gnu-emacs/2015-11/msg00215.html
>> Occasionally [my X] desktop hangs, in which case I usually can goto tty1 and `sudo shutdown -whatever now`. [But I believe] I should utter something from tty1 (before `shutdown`) to tell Emacs to shutdown cleanly ... but I don't know what to say.

Thanks all! To make this more findable, and to allow better annotation (since my not-quite-complete solution still has problems), I have made http://emacs.stackexchange.com/questions/18171/how-to-tell-graphical-emacs-to-shutdown-cleanly-from-tty1/18172#18172 . Your assistance cleaning up the remaining problems (indicated @ link target) would be much appreciated.

Jorge A. Alfaro-Murillo http://lists.gnu.org/archive/html/help-gnu-emacs/2015-11/msg00223.html
> [another] relevant question is, why is your X hanging?

Relevant, but not currently pressing, due to

- *much* bigger problems in my life :-(

+ my X hangs with f < monthly

~ I suspect it's due to the relative immaturity of Cinnamon (but ICBW--I'm certainly no expert in this domain)

Your assistance is appreciated! Tom Roche <Tom_Roche@pobox.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-17 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17  3:23 how to tell graphical Emacs to shutdown cleanly from tty1? Tom Roche
2015-11-17  4:05 ` Emanuel Berg
2015-11-17  4:34 ` Yuri Khan
2015-11-17 15:32 ` Jorge A. Alfaro-Murillo
2015-11-17 19:01 ` Tom Roche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).