- Will
I've just put these 2¢ into my .emacs, which seem to do the trick:
(when (> (length command-line-args) 1)
(setq inhibit-splash-screen t))
Cheers,
Sven
- Will
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.
--
Kevin Rodgers
Denver, Colorado, USA
> Sven Joachim wrote:
>> 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.
True, but those options are already deleted from command-line-args when
the user's init file is processed.
> A better test might be
>
> (> (length (buffer-list) 2)
>
> assuming that with no file name arguments just the *scratch* and
> *Messages* buffers exist.
That assumption is mistaken, a freshly started Emacs has six buffers:
(buffer-list)
=> (#<buffer *scratch*> #<buffer *Minibuf-0*> #<buffer *Messages*>
#<buffer *Echo Area 0*> #<buffer *Echo Area 1*>
#<buffer *code-conversion-work*>)
So you'd need to test (> (length (buffer-list) 6).
Regards,
Sven
> Kevin Rodgers <kevin.d...@gmail.com> writes:
>
>> Sven Joachim wrote:
>>> 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.
>
> True, but those options are already deleted from command-line-args when
> the user's init file is processed.
Some options are deleted, some are not. (It's reasonable to have any
arguments disable the splash screen though.)
>> A better test might be
>>
>> (> (length (buffer-list) 2)
>>
>> assuming that with no file name arguments just the *scratch* and
>> *Messages* buffers exist.
>
> That assumption is mistaken, a freshly started Emacs has six buffers:
>
> (buffer-list)
> => (#<buffer *scratch*> #<buffer *Minibuf-0*> #<buffer *Messages*>
> #<buffer *Echo Area 0*> #<buffer *Echo Area 1*>
> #<buffer *code-conversion-work*>)
>
> So you'd need to test (> (length (buffer-list) 6).
Better test whether there are any file visiting buffers
(delq nil (mapcar 'buffer-file-name (buffer-list)))
--
Johan Bockgård
Indeed, I was looking at an old version of my ~/.emacs. Here's
what I have now:
(catch 'inhibit-splash-screen
(dolist (buffer (buffer-list) nil)
(when (buffer-file-name buffer)
(throw 'inhibit-splash-screen t))))
> Johan Bockgård wrote:
>> Better test whether there are any file visiting buffers
>> (delq nil (mapcar 'buffer-file-name (buffer-list)))
>
> Indeed, I was looking at an old version of my ~/.emacs. Here's
> what I have now:
>
> (catch 'inhibit-splash-screen
> (dolist (buffer (buffer-list) nil)
> (when (buffer-file-name buffer)
> (throw 'inhibit-splash-screen t))))
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.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum