all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* open files on startup
@ 2009-11-19 18:44 JT Fleming
  2009-11-19 19:31 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 4+ messages in thread
From: JT Fleming @ 2009-11-19 18:44 UTC (permalink / raw)
  To: help-gnu-emacs

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"))


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: open files on startup
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-19 19:31 UTC (permalink / raw)
  To: help-gnu-emacs

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__


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: open files on startup
  2009-11-19 19:31 ` Pascal J. Bourguignon
@ 2009-11-19 21:42   ` JT Fleming
  2009-11-20  1:09     ` Pascal J. Bourguignon
  0 siblings, 1 reply; 4+ messages in thread
From: JT Fleming @ 2009-11-19 21:42 UTC (permalink / raw)
  To: help-gnu-emacs

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.
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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: open files on startup
  2009-11-19 21:42   ` JT Fleming
@ 2009-11-20  1:09     ` Pascal J. Bourguignon
  0 siblings, 0 replies; 4+ messages in thread
From: Pascal J. Bourguignon @ 2009-11-20  1:09 UTC (permalink / raw)
  To: help-gnu-emacs

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__


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-20  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.