Subject: Re: bug#16859: tty-setup-hook can run twice

From: Glenn Morris <[email-masked]>
Date: Tue, 25 Feb 2014 17:24:38 -0500

Stefan Monnier wrote:

>> 1) Let-bind tty-setup-hook to nil round all calls to
>> tty-run-terminal-initialization in term/*.el.
>
> I don't like let-binding hooks (e.g. it doesn't work right when the hook
> has both a global and a buffer-local value).
>
>> 2) Move running of tty-setup-hook out of tty-run-terminal-initialization,
>> into tty-create-frame-with-faces and command-line.
>
> I haven't looked at it, but it sounds preferable, yes,

Or you can have option 3:

3) Add optional DO-NOT-RUN-HOOK (or the inverse) argument to
tty-run-terminal-initialization.

BTW, I also noticed that the hook runs when emacs --daemon is started,
which seems odd?