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: Sven Joachim
Subject: Re: making Emacs 22 startup like Emacs 21
Date: Fri, 16 Nov 2007 19:57:27 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

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.

>  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


reply via email to

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