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

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

Re: Simple question on loading programs in emacs


From: Jambunathan K
Subject: Re: Simple question on loading programs in emacs
Date: Sat, 01 Dec 2012 01:04:57 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Most of the emacs programs don't have a `main' function (as in C
programs).  First you load a file, then you run a command.

For a fun example, consider tetris.

,----
| First you load the file with
|    M-x load-library RET tetris RET
| 
| Then you run the tetris program with
|    M-x tetris TAB TAB (there are two tabs)
| 
| So now you know what all you could do.  If you click on tetris with a
| mouse the game will start.
| 
| Now you find that you are losing fast and you want to stop the game.  So
| again you do
|    M-x tetris TAB TAB 
| 
| You click on tetris-end-game and you are done.
`----

,----
| For another fun example, you can do
|     M-x butterfly RET
`----

,----
| Now you do 
|     M-x list-command-history RET
| 
| You will see what all you did.  You will see lines like 
| 
|     (tetris)
|     (tetris-end-game)
`----

,----
| For automatically running tetris, create a file with name .emacs in your
| home directory and copy paste the first line.
| 
|     (tetris)
| 
| and then start emacs normally.
`----

You are done.

Now you have to do
    C-h t

and read the manual.  

Haines Brown <address@hidden> writes:

> A simple question, but I'm lost in the manual. I want to start a session
> of emacs that automatically loads an emacs program automatically instead
> of having to do M-x program during the emacs session. I want to do this
> because I have a custom emacs init file just for that emacs program.
>
> I tried (autoload 'program "ProgramName" t), but this only sets it in
> the environment. 
>
> A related question: When I close that program within emacs, I want
> it to close the emacs session as well. 
>
> Haines Brown
>

-- 



reply via email to

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