Like a lot of people I think I activated inhibit-startup-screen
because it’s ugly and tedious to always have your emacs horizontally split when you open a file with half taken by an useless startup screen… But I notice I find it better/more beautifull/helpfull/useful than just an unique void scratch buffer when I open Emacs without opening a file…
So is there a way so that this startup screen shows up only when there’s nothing else to show up? as when the scratch buffer is displayed at startup? instead of it? and not to show up if I open a file or run a command like gnus
or erc
?
inhibit-startup-screen
, not like « I want gnus if no file opened », but « I want the default startup sceer if no-file-opened-OR-gnus/erc-ran » – galex-713 Mar 20 '16 at 13:59display-splash-screen
does what I want. And temporary I can still test(equal "*scratch*" (buffer-name))
… But two questions: first, why to useafter-init-hook
and not just put the code in the.emacs.d
(is there any difference?)? and second, is there a “real” way to test if a buffer is the scratch buffer, other than if its name is*scratch*
(for example that wouldn’t work if I open a file like/home/galex-713/*scratch*
, and something cleaner than use(and (equal "*scratch*" (buffer-name)) (not (buffer-file-name)))
)? – galex-713 Mar 20 '16 at 14:08after-init-hook
instead of setting it directly in.emacs
has to do with the Emacs startup order. Basically,after-init-hook
happens quite a few steps after loading your.emacs
file, and at that time you can take advantage of Emacs having parsed and set various runtime options. – Xaldew Mar 20 '16 at 14:33*scratch*
: you can still use a test such as(string= "*scratch*" (buffer-name))
. When emacs starts,*scratch*
is 'always' created and opening a new file named*scratch*
will pass that buffer throughuniquify-buffer-file-name
, giving it a new, proper, and unique buffer name. – Xaldew Mar 20 '16 at 14:45M-x report-emacs-bug
. You should be able, for example, to use a function likedisplay-startup-screen
as the value ofinitial-buffer-choice
, to show the startup screen only when you do not provide a file/dir argument toemacs
. Right now, if you useinitial-buffer-choice
to specify a buffer (and possibly other behavior, but ending with a buffer value), that buffer is just added to the list of files etc. provided on the command line. There should be a way to not use that buffer if there are such files. – Drew Mar 20 '16 at 15:55