Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

making Emacs 22 startup like Emacs 21

21 views
Skip to first unread message

Will Parsons

unread,
Nov 9, 2007, 6:03:11 PM11/9/07
to
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

Sven Joachim

unread,
Nov 10, 2007, 2:56:00 AM11/10/07
to
Will Parsons <oud...@nodomain.invalid> writes:

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 Parsons

unread,
Nov 10, 2007, 2:19:42 PM11/10/07
to
Thanks, that works for me.

- Will

Kevin Rodgers

unread,
Nov 16, 2007, 1:11:17 PM11/16/07
to help-gn...@gnu.org

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

unread,
Nov 16, 2007, 1:57:27 PM11/16/07
to
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.

> 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

Johan Bockgård

unread,
Nov 16, 2007, 8:00:28 PM11/16/07
to
Sven Joachim <sven...@gmx.de> writes:

> 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

Kevin Rodgers

unread,
Nov 22, 2007, 2:14:29 AM11/22/07
to help-gn...@gnu.org
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))))

David Brodbeck

unread,
Nov 26, 2007, 1:22:10 PM11/26/07
to help-gn...@gnu.org

On Nov 21, 2007, at 11:14 PM, Kevin Rodgers wrote:

> 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.

David Kastrup

unread,
Nov 26, 2007, 1:34:29 PM11/26/07
to
David Brodbeck <bro...@u.washington.edu> writes:

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

0 new messages