From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: making Emacs 22 startup like Emacs 21 Date: Sat, 17 Nov 2007 02:00:28 +0100 Organization: Chalmers University of Technology, Sweden Message-ID: References: <87ejey4jqn.fsf@gmx.de> <87sl3681d4.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1195263649 18334 80.91.229.12 (17 Nov 2007 01:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2007 01:40:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 17 02:40:54 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ItCg2-0003Wp-Ae for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2007 02:40:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItCfp-0003S9-9U for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 20:40:41 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.germany.com!border1.nntp.ams.giganews.com!nntp.giganews.com!tudelft.nl!binfeed2.tudelft.nl!newsfeed.sunet.se!news01.sunet.se!129.16.222.141.MISMATCH!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: remote4.student.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1195261228 18959 129.16.29.77 (17 Nov 2007 01:00:28 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Sat, 17 Nov 2007 01:00:28 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:/Ss30+WkzfvZ+zVp6Oh/Pnikjso= Original-Xref: shelby.stanford.edu gnu.emacs.help:153868 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49297 Archived-At: Sven Joachim writes: > Kevin Rodgers 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) > => (# # # > # # > #) > > 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