unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: making Emacs 22 startup like Emacs 21
Date: Fri, 16 Nov 2007 19:57:27 +0100	[thread overview]
Message-ID: <87sl3681d4.fsf@gmx.de> (raw)
In-Reply-To: mailman.3671.1195236694.18990.help-gnu-emacs@gnu.org

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

  parent reply	other threads:[~2007-11-16 18:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 23:03 making Emacs 22 startup like Emacs 21 Will Parsons
2007-11-10  7:56 ` Sven Joachim
2007-11-10 19:19   ` Will Parsons
2007-11-16 18:11   ` Kevin Rodgers
     [not found]   ` <mailman.3671.1195236694.18990.help-gnu-emacs@gnu.org>
2007-11-16 18:57     ` Sven Joachim [this message]
2007-11-17  1:00       ` Johan Bockgård
2007-11-22  7:14         ` Kevin Rodgers
2007-11-26 18:22           ` David Brodbeck
     [not found]           ` <mailman.4136.1196101342.18990.help-gnu-emacs@gnu.org>
2007-11-26 18:34             ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sl3681d4.fsf@gmx.de \
    --to=svenjoac@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).