help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making Emacs 22 startup like Emacs 21


From: Johan Bockgård
Subject: Re: making Emacs 22 startup like Emacs 21
Date: Sat, 17 Nov 2007 02:00:28 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

Sven Joachim <svenjoac@gmx.de> writes:

> Kevin Rodgers <kevin.d.rodgers@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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]