I find the new Emacs 22 startup behaviour quite annoying in that it puts up a splash screen even when Emacs is invoked with a file name. I've found the inhibit-splash-screen variable to inhibit the splash screen entirely, but I'd like to keep the splash screen if Emacs is invoked without arguments - just inhibit it if a file is specified. Is there any way to get this to work like Emacs 21?
Will Parsons <oud...@nodomain.invalid> writes: > I find the new Emacs 22 startup behaviour quite annoying in that it puts > up a splash screen even when Emacs is invoked with a file name. I've > found the inhibit-splash-screen variable to inhibit the splash screen > entirely, but I'd like to keep the splash screen if Emacs is invoked > without arguments - just inhibit it if a file is specified. Is there > any way to get this to work like Emacs 21?
I've just put these 2¢ into my .emacs, which seem to do the trick:
Sven Joachim wrote: > Will Parsons <oud...@nodomain.invalid> writes:
>> I find the new Emacs 22 startup behaviour quite annoying in that it puts >> up a splash screen even when Emacs is invoked with a file name. I've >> found the inhibit-splash-screen variable to inhibit the splash screen >> entirely, but I'd like to keep the splash screen if Emacs is invoked >> without arguments - just inhibit it if a file is specified. Is there >> any way to get this to work like Emacs 21?
> I've just put these 2¢ into my .emacs, which seem to do the trick:
Sven Joachim wrote: > Will Parsons <oud...@nodomain.invalid> writes:
>> I find the new Emacs 22 startup behaviour quite annoying in that it puts >> up a splash screen even when Emacs is invoked with a file name. I've >> found the inhibit-splash-screen variable to inhibit the splash screen >> entirely, but I'd like to keep the splash screen if Emacs is invoked >> without arguments - just inhibit it if a file is specified. Is there >> any way to get this to work like Emacs 21?
> I've just put these 2¢ into my .emacs, which seem to do the trick:
> (when (> (length command-line-args) 1)
That doesn't distinguish file names from other command line arguments such as options. A better test might be
(> (length (buffer-list) 2)
assuming that with no file name arguments just the *scratch* and *Messages* buffers exist.
> Hmm, when I paste this into my .emacs I still get the splash screen, > even if I supply a filename on the command line. I must be doing > something wrong.
The above sequence only replaces the single line quoted above from the previous recipe. The other parts of the recipe must stay around as well.