From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: open files on startup
Date: Fri, 20 Nov 2009 02:09:32 +0100 [thread overview]
Message-ID: <87pr7egfxv.fsf@galatea.local> (raw)
In-Reply-To: 91deba46-374f-487c-bdfd-c7081a9989ea@k4g2000yqb.googlegroups.com
JT Fleming <jeff.fleming@halliburton.com> writes:
> On Nov 19, 1:31 pm, p...@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> JT Fleming <jeff.flem...@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__
> 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__
prev parent reply other threads:[~2009-11-20 1:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-19 18:44 open files on startup JT Fleming
2009-11-19 19:31 ` Pascal J. Bourguignon
2009-11-19 21:42 ` JT Fleming
2009-11-20 1:09 ` Pascal J. Bourguignon [this message]
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=87pr7egfxv.fsf@galatea.local \
--to=pjb@informatimago.com \
--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).