help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open files on startup


From: Pascal J. Bourguignon
Subject: Re: open files on startup
Date: Thu, 19 Nov 2009 20:31:11 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

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__


reply via email to

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