help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs fails to create frame at boot of OSX


From: Guido Van Hoecke
Subject: Re: Emacs fails to create frame at boot of OSX
Date: Mon, 3 Nov 2014 10:44:53 +0100

Hi Marc

On 26 October 2014 12:56, Mark Simpson <verdammelt@gmail.com> wrote:

> >>>>> On Sun, 26 Oct 2014 11:25:23 +0100, Guido Van Hoecke <
> guivho@gmail.com> said:
>
>     Guido> When I boot my iMAC all apps that were running at the
>     Guido> previous shutdown are restarted by OSX. So Emacs is also
>     Guido> started, but fails to create its frame. It just hangs without
>     Guido> frame. I have to kill it and restart it. That always
>     Guido> succeeds.
>
> Guido -
>
> You are not the only person with this problem - I have it too. Also it
> sometimes happens after simply closing Emacs and trying to restart it,
>
​
Fortunately this is utterly rare here, but then, I seldom close Emacs :)
​


> without rebooting the machine.


​Just describing my current workaround, maybe it can help people suffering
from this problem.

Moved /usr/bin/emacs to /usr/bin/emacs_OSX and created a /usr/bin/emacs
script with following one-liner:
      open -a /Applications/Emacs.app

Used Automator to create a 'Utilities, Runs Shell Script' Application to
run following script:
    sleep 60 # wait long enough to ensure the frozen emacs is started
    pids=`/bin/ps -axo pid,command | grep [E]macs | awk '{ print $1 }' | tr
'\n' ' '`
    if [ "no$pids" != "no" ]; then
        kill -KILL $pids
    fi
    /usr/bin/emacs
Saved this as killAndRestartTheGodOfEditors.app and added it to my Login
Items.
(Note: having `open -a /Applications/Emacs.app` directly in the script
rather than via my `/usr/bin/emacs` to launch Emacs fails for some reason
that I have not yet investigated!)

So now the boot-time emacs (which lately always hangs) is killed off and a
new emacs is started. It's not ideal, but at least I've got a working emacs
when my iMac finishes booting. And I don't mind the 1 minute wait to ensure
it doesn't try to kill a not yet running emacs: I usually power on the Mac
and then only I brew some coffee, go get the newspaper etc etc while it's
booting anyhow.

​Hope this helps,

Guido​


I have been too lazy to investigate or even post here - so thank you for
> doing so.
>
> Ciao
> Mark
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]