From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: Simple question on loading programs in emacs Date: Sat, 01 Dec 2012 01:04:57 +0530 Message-ID: <87r4nahoke.fsf@gmail.com> References: <87lidjgf3v.fsf@engels.HistoricalMaterialism.info> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354303951 28877 80.91.229.3 (30 Nov 2012 19:32:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2012 19:32:31 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Haines Brown Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 30 20:32:44 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TeWKD-0003d2-Kb for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Nov 2012 20:32:37 +0100 Original-Received: from localhost ([::1]:47373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeWK2-0002II-5g for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Nov 2012 14:32:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeWJw-0002I8-SK for help-gnu-emacs@gnu.org; Fri, 30 Nov 2012 14:32:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TeWJv-0005z1-KT for help-gnu-emacs@gnu.org; Fri, 30 Nov 2012 14:32:20 -0500 Original-Received: from mail-pa0-f41.google.com ([209.85.220.41]:59039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TeWJv-0005ys-7o for help-gnu-emacs@gnu.org; Fri, 30 Nov 2012 14:32:19 -0500 Original-Received: by mail-pa0-f41.google.com with SMTP id bj3so566918pad.0 for ; Fri, 30 Nov 2012 11:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=93QIt1xRa9Pr2BViaqKWiJMLXhJ6HAfCvlzGjkNeuvY=; b=schuNURQYyUHC/qCcmgUqjScvegmWkg6ioTcw5ZRk3DybAss1H8oUNlemMCL18Bnyk DDZCkQQQuja/zHZ41ZA0Wx+CuHXzIWUT92ba57lIr1iBnIArHgLFLbYCVPdiE6LDjoW2 w6WRIaG+/prn1W9QPWcqxgxbBYxsbAD6tsZUV3jT/ETNGDHnT+QYAZlilbAeKJbI9dJd 4Kc0EmWWDfLQSbhBw4IiKp01BuktFlySwXbOhrR6jJ5GUwC0Rm7vQy0sU/Eyyi5tR1Jt 3hxQTSR3RADSwGo6iWZRXf5LaMwznIu/D9upPHxp9r+ESjsf9Urnl0z7fJp5ANBZpIRw 77tA== Original-Received: by 10.68.189.102 with SMTP id gh6mr8296615pbc.37.1354303938417; Fri, 30 Nov 2012 11:32:18 -0800 (PST) Original-Received: from debian-6.05 ([115.184.88.49]) by mx.google.com with ESMTPS id is6sm3466554pbc.55.2012.11.30.11.32.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Nov 2012 11:32:18 -0800 (PST) In-Reply-To: <87lidjgf3v.fsf@engels.HistoricalMaterialism.info> (Haines Brown's message of "Fri, 30 Nov 2012 12:44:36 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87978 Archived-At: 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 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 > --