From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: pjb@informatimago.com (Pascal J. Bourguignon)
Newsgroups: gmane.emacs.help
Subject: Re: open files on startup
Date: Thu, 19 Nov 2009 20:31:11 +0100
Organization: Informatimago
Message-ID: <87tywqgvls.fsf@galatea.local>
References: <2f0772e5-7fc4-4a6a-b3a5-782033418e9c@e23g2000yqd.googlegroups.com>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: ger.gmane.org 1258659930 13499 80.91.229.12 (19 Nov 2009 19:45:30 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 19 Nov 2009 19:45:30 +0000 (UTC)
To: help-gnu-emacs@gnu.org
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 20:45:23 2009
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>
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 1NBCwM-0006Mv-5d
	for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 20:45:14 +0100
Original-Received: from localhost ([127.0.0.1]:38208 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1NBCwL-0003go-Ko
	for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 14:45:13 -0500
Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Original-Newsgroups: gnu.emacs.help
Original-Lines: 38
Original-X-Trace: individual.net EyCKrkRMI4O7kMKFXKY6iw4rh25xGIVxDvHMZ6sDCzFNR/y+xp
Cancel-Lock: sha1:MTdjNDk0NTQ1OGNiNjE5OTk5ZTM2MzA4NzFlOTNhMGNiMGRjOTEzOA==
	sha1:cB5ytAUvQj9uMNVl2qVcyrZkgSk=
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA
	oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9
	033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac
	l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR
	mV+hO/VvFAAAAABJRU5ErkJggg==
X-Accept-Language: fr, es, en
X-Disabled: X-No-Archive: no
Importance: high
User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)
Original-Xref: news.stanford.edu gnu.emacs.help:174870
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 <help-gnu-emacs.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=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:69942
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/69942>

JT Fleming <jeff.fleming@halliburton.com> writes:

> I am trying to open 2 files and the programmable calculator on
> startup.
> I can open 1 file but can't figure out how to get the other and the
> calculator.
> Any help would be appreciated.
> Here is what is currently used to open a file
> (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  '(initial-buffer-choice "~/diary"))

You could just put:

    (dolist (file '("~/diary" "~/some-other-file"))
       (find-file file))

at the end of your ~/.emacs file.

You can also use split-window-vertically, other-window and
balance-windows to have them spread over several windows.

(defun open-files (files)
   (delete-other-windows)
   (loop repeat (1- (length files)) 
         do (split-window-vertically) 
            (balance-windows))
   (loop for file in files
         do (find-file file) 
            (other-window 1)))

(open-files '("/tmp/a" "/tmp/b" "/tmp/c"))

-- 
__Pascal Bourguignon__