From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: How can I change the default loading buffer? Date: Sun, 02 Aug 2015 16:56:01 +0100 Message-ID: <87mvy93cry.fsf@robertthorpeconsulting.com> References: <871tfq1k58.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438530993 14309 80.91.229.3 (2 Aug 2015 15:56:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 15:56:33 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 02 17:56:22 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 1ZLvcc-0001ci-1k for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 17:56:22 +0200 Original-Received: from localhost ([::1]:56246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvcb-0006yu-G8 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Aug 2015 11:56:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvcP-0006yl-UT for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:56:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLvcM-0003p2-Ms for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:56:09 -0400 Original-Received: from outbound-smtp04.blacknight.com ([81.17.249.35]:50558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLvcM-0003op-Gj for help-gnu-emacs@gnu.org; Sun, 02 Aug 2015 11:56:06 -0400 Original-Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp04.blacknight.com (Postfix) with ESMTPS id CA88D98776 for ; Sun, 2 Aug 2015 15:56:04 +0000 (UTC) Original-Received: (qmail 1730 invoked from network); 2 Aug 2015 15:56:04 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.77.154.208]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 2 Aug 2015 15:56:04 -0000 In-Reply-To: <871tfq1k58.fsf@nl106-137-147.student.uu.se> (message from Emanuel Berg on Thu, 30 Jul 2015 03:58:27 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.35 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:106210 Archived-At: Emanuel Berg writes: > OK, so what is the method to find out (or rule of > thumb) what you shouldn't put directly into .emacs but > instead into `emacs-startup-hook'? Have a look at (info "(elisp)Startup Summary") and see if any of it applies to you. Check from the bottom of the list up. You can only delay things as far at step 24, so there's little use in worrying much about the earlier steps. For people who use the session manager and --daemon they could cause problems though. This is how it is for me, going backwards, last step first: * 24. `emacs-startup-hook' and `term-setup-hook' are run. * 23. initial-buffer-choice. Because the initial-buffer-choice is set here, what happens in emacs-startup-hook can change it. What happens in the init file can't though. I use this feature. I setup initial-buffer-choice to my ToDo file. In emacs-startup-hook I look for a bookmark into my init file, if it exists then I jump to it. * 22. Exit point for --batch. If you use Emacs a lot in batch mode it's worth doing a lot of visual stuff in emacs-startup-hook because that way it won't slow down your batch programs. * 21. Other command line options. I think this includes files specified on the command line. * 20. Initial echo area message. Not very important. * 19. Terminal specific lisp library. This can be important if you use terminal emulation and need one of these. I've never had to worry about this. * 18. Set the mode of *scratch*. * 17. Run after-init-hook. * 16. Set after-init-time. I think this is used in measuring how fast Emacs init is. If you use after-init-hook or emacs-startup-hook then the stuff in those isn't measured. In different situations you may want that or not want it. You can always put everything into the init file temporarily just to see how long the full init takes. * 15. Initialize packages. This is important, packages aren't initialized in the init file. There has been some discussion about changing this. Many people change it by putting package-initialize in their init file. * 14. Load abbrevs. Abbrevs are rarely used programmatically so I don't think this matters much. * 13. Load "default" library. I've never used that. * 12. Loading of the init file. BR, Robert Thorpe