The daemon feature of Emacs is great. But when should the daemon be started?

At one time I used an '@reboot' line in my crontab. But when you want to use things like Tramp mode (for editing files on remote servers transparently), you very quickly wish that emacs could talk to your ssh-agent.

So if you accept that you will be running a desktop environment (not always true), you can add the daemon to your equivalent of "System >> Preferences >> Startup Programs".

But then you find that Flymake (when used with cperl-mode) is not picking up any of your uninstalled, work-in-progress Perl modules. Wouldn't it be great if you could set $PERL5LIB to fix this? And doesn't M-x copyright require you to set "$ORGANIZATION"?

Ever since Debian bug #411639 was fixed at the end of 2007, we have the option of "~/.xsessionrc" for setting environment variables that will cover everything in your desktop session, including things launched from panels and startup scripts.

So now that's what I do. But I've yet to figure out a good equivalent for console-only systems. Maybe I don't need one?