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: Fri, 20 Nov 2009 02:09:32 +0100 Organization: Informatimago Message-ID: <87pr7egfxv.fsf@galatea.local> References: <2f0772e5-7fc4-4a6a-b3a5-782033418e9c@e23g2000yqd.googlegroups.com> <87tywqgvls.fsf@galatea.local> <91deba46-374f-487c-bdfd-c7081a9989ea@k4g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1258681251 21320 80.91.229.12 (20 Nov 2009 01:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2009 01:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 20 02:40:44 2009 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 1NBIUN-0004Nt-Rn for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Nov 2009 02:40:44 +0100 Original-Received: from localhost ([127.0.0.1]:47695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBIUN-0001Gd-9l for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Nov 2009 20:40:43 -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: 61 Original-X-Trace: individual.net gimx3egYlb4QsW4+I0S0swzqG6uQ6Rd4BC7NvQpvnaXHoxh4j8 Cancel-Lock: sha1:ZWRmM2M5YWU4YWI3YWYxY2E5ZTZmMDAyNjZlZDU3NTdmZGU0MzRjZQ== sha1:qTP9vuZlnyx5faLHXq24ZmDEZRI= 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 User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:174880 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:69951 Archived-At: JT Fleming writes: > On Nov 19, 1:31 pm, p...@informatimago.com (Pascal J. Bourguignon) > wrote: >> JT Fleming 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__ > Thanks for the suggestions Pascal > > Your first suggestion opened the files but they are not visible. > The second suggestion caused an error that defun was not recognized. Perhaps it was loop that wasn't defined? You must prefix all the code I give with a (require 'cl), if I forget to mention it. > but it did create two windows > I forgot to mention that I'm running emacs in Windows xp. > > What would be the command to have it open the programmable calculator. You can know what command is called when you type some keys with C-h k followed by the keypresses you use to call it. -- __Pascal Bourguignon__