From: Jambunathan K <kjambunathan@gmail.com>
To: Haines Brown <haines@histomat.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Simple question on loading programs in emacs
Date: Sat, 01 Dec 2012 01:04:57 +0530 [thread overview]
Message-ID: <87r4nahoke.fsf@gmail.com> (raw)
In-Reply-To: <87lidjgf3v.fsf@engels.HistoricalMaterialism.info> (Haines Brown's message of "Fri, 30 Nov 2012 12:44:36 -0500")
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 <haines@histomat.net> 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
>
--
next prev parent reply other threads:[~2012-11-30 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 17:44 Simple question on loading programs in emacs Haines Brown
2012-11-30 17:53 ` Bastien
2012-11-30 18:54 ` Pascal J. Bourguignon
2012-11-30 19:34 ` Jambunathan K [this message]
2012-12-01 0:55 ` Barry Margolin
2012-12-01 9:44 ` Pascal J. Bourguignon
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4nahoke.fsf@gmail.com \
--to=kjambunathan@gmail.com \
--cc=haines@histomat.net \
--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.
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.