home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / text / emacsdif.lha / emacs-18.58 / amiga.doc < prev    next >
Encoding:
Text File  |  1992-05-17  |  15.6 KB  |  413 lines

  1. 1. Introduction
  2. ---------------
  3.  
  4. Emacs is a powerful, but sometimes cryptic, editor. In this Amiga
  5. version, I have tried to make it easier to use with menus, mouse
  6. support and arrow key support, but it still requires some getting used
  7. to. I would recommend starting with the tutorial, which can be started
  8. from the Help menu (if it is missing, you didn't install emacs
  9. correctly. Check that the file s:.emacs-menu.el exists) or from the
  10. keyboard by typing Control-H and then t.
  11.  
  12. This file only describes the Amiga specific features of emacs, and it
  13. assumes a working knowledge of emacs. For more documentation you can
  14. consult the emacs help (Information in the Help menu, or C-h i) or
  15. read the emacs manual (which is the same document in a printed form).
  16. This manual can be bought from the
  17.  
  18.      Free Software Foundation
  19.      675 Mass Ave
  20.      Cambridge, MA 02139
  21.      USA
  22.  
  23. See the file gnuemacs:etc/DISTRIB for more information (you can type
  24. C-h C-d to view it).
  25.  
  26. To install emacs, read the file INSTALLATION.
  27.  
  28.  
  29. 2. Using emacs in a window
  30. --------------------------
  31.  
  32. Emacs runs in a window on the Workbench (this can be changed). It
  33. basically works like just any other version of GNU Emacs, using the
  34. same keys, etc. It uses the standard amiga keymap, but with some strange
  35. modifications:
  36.  
  37. o The left alt key is stolen as a meta key for emacs. This means you can't use
  38. it to enter accents. However, the right alt key remains untouched. Hence
  39. 'left alt-f e' moves forward one word and inserts an e, while
  40. 'right alt-f e' inserts an e acute. In the rest of the text, the meta key
  41. always means the 'left alt' key.
  42.  
  43. o C-space is always mapped to C-@, the set-mark command, for convenience.
  44.  
  45. o The backspace key always sends DEL (delete previous character in emacs),
  46. and DEL sends C-d (delete character under cursor). If you don't like this, 
  47. add the line
  48.     (setq amiga-remap-bsdel nil)
  49. to your .emacs file (in s:).
  50.  
  51. There are also a number of extra features:
  52.  
  53. a) Mouse support, similar to the X-Windows version.
  54.  
  55. You can position the cursor with the left mouse button. Other possibilites are:
  56.  
  57. action            result
  58. ------------------------------
  59. shift-left button    set mark at mouse position
  60. control-left button    cut between point and mouse position
  61. meta-left button    copy between point and mouse position
  62. middle button        paste
  63. shift-middle button    iconify emacs window (double click to deiconify)
  64.  
  65. Some of the control, meta, etc combinations may be stolen by Intuition or
  66. commodities programs, so don't be surprised if they don't all work.
  67.  
  68. All of these actions may be redefined (this is emacs after all!), see the
  69. file lisp/amiga-mouse.el for details (you will need to learn lisp if you don't
  70. already know it ...) [Note: this file is not included in the binary only
  71. distribution, you will need the source code version].
  72.  
  73. b) Clipboard
  74.  
  75. At first glance, emacs uses the Amiga clipboard, ie it cuts to the
  76. clipboard and pastes from it (via the menu operations or the C-w
  77. (kill-region), M-w (copy-region-as-kill) & C-y (yank) commands).
  78.  
  79. Things are actually complicated by emacs use of a "kill ring" (ie it
  80. remembers the last 30 things cut. The M-y (yank-pop, menu command
  81. Paste Previous) allows you to recover old cuts):
  82.  
  83. - When you cut (or copy) something in emacs it is placed in the
  84. clipboard.
  85.  
  86. - When you paste (yank) something in emacs, it checks the clipboard to
  87. see if it contains anything new. If so, it pastes that.
  88.  
  89. [Note: It also checks the clipboard when you cut something, and saves
  90. that in the kill-ring if necessary]
  91.  
  92. All this effort is used to make the clipboard appear to operate
  93. transparently in emacs.
  94.  
  95. c) Window
  96.  
  97. By default, emacs runs in a window on the workbench screen using the
  98. system default font and the standard colours. All this can be changed:
  99.  
  100. o The font can be specified with the -fn <font> <size> option when you
  101. run emacs. You can also use the amiga-set-font command interactively,
  102. or add a line like
  103.    (amiga-set-font "topaz" 11)
  104. to your s:.emacs file. The font must be non-proportional.
  105.  
  106. o The window size and screen can be changed with the
  107. amiga-set-geometry function. It takes 4 or 5 parameters, the (x,y)
  108. position of the window and its (width,height). The last optional
  109. parameter specifies the screen: a string gives the name of a public
  110. screen, t stands for the default public screen (normally the
  111. workbench) and nil means keep the same screen. For example, the lisp code
  112.   (amiga-set-geometry 0 0 640 400)
  113. resizes the emacs window to 640x400. If the screen would be too small
  114. given the current font (there must be room for 11x4 characters), the
  115. change is refused.
  116.  
  117. To use the a public screen requires an utility to create them ... (I
  118. known of none available).
  119.  
  120. o The foreground & background colours can be changed with the 
  121. amiga-set-foreground-color & amiga-set-background-color commands. You
  122. specify the pen and not the actual colour (from 0 to 7 only,
  123. because of restrictions in console.device).
  124.  
  125. o The emacs window can be iconified (onto the workbench) with the
  126. amiga-iconify command. This is bound to shift-middle button on a 3
  127. button mouse, and to C-z (which is normally bound to suspend-emacs,
  128. which doesn't work on the Amiga).
  129.  
  130. To deiconify emacs, double click on the icon.
  131.  
  132. [Note: while emacs is iconified, it won't answer ARexx commands]
  133.  
  134. d) Menus
  135.  
  136. If you have installed emacs correctly (see the INSTALLATION file), it
  137. will startup with some menus containing some useful basic
  138. functions (the layout was inspired from that of TurboText, another
  139. good editor which has the disadvantage of being more expensive than
  140. emacs ...). Alongside each item is the emacs key sequence which
  141. invokes that function, if any.
  142.  
  143. Using the Menu Help functionality of AmigaDOS 2.04, you can get help
  144. on any menu item by highlighting it with the mouse and pressing the
  145. Help key [This is easier if you're left handed :-)].
  146.  
  147. The menus are not fixed, they are defined by the s:.emacs-menu.el file
  148. (which isn't human-readable). To modify them, edit s:.emacs-menu.menu.
  149. This contains a lisp-like (but quite legible even for lisp-haters)
  150. representation of the menus, which you can modify by adding items or
  151. menus. The format should be obvious (just make sure that closing
  152. brackets correspond to the correct opening ones, emacs always shows
  153. the corresponding '(' when you type a ')'. Also the last bracket
  154. should correspond with the first).
  155.  
  156. When you have finished your changes, type C-c C-c. This will save your
  157. menus, and then generate a .el file from them (this takes several
  158. seconds even on an A3000. Be patient). Then save the resulting file.
  159. To have the new menus take effect immediately, type M-C-x while in the
  160. .el file.
  161.  
  162. Enterprising lisp programmers can customise the menus even more by
  163. modifying the functions amiga-menus-dispatch and/or amiga-menus-help
  164. in lisp/amiga-mouse.el. This code basically receives a (menu-number
  165. menu-item-number) list and must take the appropriate action
  166. (currently, execute the command associated with that particular menu
  167. item). The lack of comments will surely not deter these audacious
  168. pionneers ...
  169.  
  170. e) Command line options
  171.  
  172. Beyond the standard emacs command line options (for which
  173. documentation tends to be rather sketchy, not to say missing), you can
  174. also use:
  175.  
  176. -prealloc <n>: Reserve n bytes of memory for emacs exclusively. This
  177. option *must* be the first on the command line. On the A3000, chip
  178. memory can't be used for emacs (the details are complicated ...), so
  179. you will run out of memory sooner than expected. This option allows
  180. you to reserve some for emacs before it gets eaten by other programs.
  181.  
  182. -fn <font> <size>: Set the font that emacs uses, like the
  183. amiga-set-font command (see section c, on windows). Note that there
  184. must be enough room for 11x4 characters in the standard 640x200
  185. window. So avoid fonts bigger than 40 points ...
  186.  
  187. -nw: Don't use a window, use a serial port. See part 3, Using Emacs
  188. over a serial line.
  189.  
  190. f) ARexx
  191.  
  192. [Note: This interface has changed slightly since V1.24]
  193.  
  194. Emacs has a full ARexx interface. It can execute scripts and commands
  195. synchronously (waiting for the result) or asynchronously, and has an
  196. ARexx port from which it accepts commands. 
  197.  
  198. To execute a script, you use the amiga-arexx-do-command (synchronous)
  199. or amiga-arexx-send-command (asynchronous) commands. These ask for the
  200. script file name (the default extension is .elx). If you just want to
  201. execute a simple ARexx command, you can prefix those commands with C-u
  202. and specify the string to execute.
  203.  
  204. From lisp, you must use
  205.   (amiga-send-command "<file>" nil) for a script, and
  206.   (amiga-send-command "<commands>" t) for direct execution.
  207. (and the same for amiga-do-command). The result of amiga-send-command
  208. is an integer that can be passed to amiga-arexx-wait-command to wait
  209. for the completion of the script or command. It can also be used with 
  210. amiga-arexx-check-command to check if the script has finished. For
  211. example:
  212.  
  213.   (let ((arexx-id (amiga-send-command "start-fun" nil)))
  214.     ... do something here ...
  215.     ; and wait for arexx script to end
  216.     (amiga-arexx-wait-command arexx-id))
  217.  
  218. Emacs's ARexx port accepts commands in lisp, and is usually called
  219. EMACS1 (if you run emacs twice simulatenously, the second one will
  220. have EMACS2, and so on). For example (from a shell),
  221.  
  222.   rx "address EMACS1 '(beginning-of-buffer)'"
  223.  
  224. will set point to the beginning of the buffer.
  225.  
  226. ARexx commands are only processed at certain times, so be careful how
  227. you design your applications. These are:
  228.  
  229. o While waiting for commands from the keyboard (ie when emacs is
  230. idle).
  231. o While processing a synchronous (amiga-arexx-do-command) script.
  232. o When the amiga-arexx-process function is called.
  233.  
  234. They also affect the user visible state by default (ie calling
  235. beginning-of-buffer as above modifies the user's position). Avoid
  236. sending random commands at random times, or use save-excursion.
  237.  
  238. As usual, all this behaviour can be modified to some extent. Look in
  239. amiga-init.el for details [The source code is the documentation...].
  240.  
  241. I haven't written any significant examples yet, so ...
  242.  
  243.  
  244. 3. Using emacs over a serial line
  245. ---------------------------------
  246.  
  247. To use emacs over a serial port, you must do:
  248.  
  249.   setenv TERM <terminal type> (eg vt100)
  250.   emacs -nw
  251.  
  252. The setenv line can be put in your User-Startup, so as to avoid typing
  253. it every time.
  254.  
  255. Emacs cannot simply guess how your terminal works from its name, it
  256. needs a description of it. This is found in a termcap file, which
  257. emacs looks for in s:termcap. If you didn't install this file with emacs,
  258. you can do so by typing (in a CLI):
  259.  
  260.   join gnuemacs:etc/termcap.ucb gnuemacs:etc/termcap.amiga as s:termcap
  261.  
  262. [Note: These files only come with the source version]
  263.  
  264. The -nw prevents the use of a window.
  265.  
  266. If you have several serial ports, you can type
  267.  
  268.   emacs -t ser2.device 2
  269.  
  270. to use port 2 of device ser2.device. Use of the -t option implies -nw.
  271.  
  272. These options (-t & -nw) *must* be specified at the start of the
  273. command line.
  274.  
  275. The descriptions of the Clipboard, the command line options and the
  276. ARexx port in part 2 above also apply to use over a serial port.
  277.  
  278.  
  279. 4. Redumping emacs [This section for expert users only]
  280. -------------------------------------------------------
  281.  
  282. Enterprising users may want to change the lisp files which are loaded
  283. into the Emacs dump file. The procedure for doing this is very similar
  284. to that with the Unix version, except that the amount of pure storage
  285. can be changed without recompiling emacs. This will allow users
  286. without SAS C v5.10b to still make such changes.
  287.  
  288. The necessary lisp files are only included in the source distribution,
  289. so you will have to get that first. Once that is available, that you
  290. have made all your changes (eg adding some extra files to be dumped),
  291. use the following sequence to redump emacs:
  292.  
  293.   cd gnuemacs:etc
  294.   stack 20000
  295.   /temacs -pure <n> -malloc <m> -nl -batch -l loadup dump
  296.  
  297. The -pure <n> and -malloc <m> options should only be necessary if you
  298. add extra files to be dumped, see below how to choose values for n &
  299. m. The above order for the parameters must be preserved. Specifying
  300. dump without -nl & -batch will have unpredicatable consequences.
  301.  
  302. Once all the files are loaded, a new copy of gnuemacs:etc/EMACS-DATA
  303. will be saved, and all should work correctly. If you get one of the
  304. following messages:
  305.  
  306.   Pure Lisp storage exhausted
  307.  
  308.   Emacs dump: ran out of memory for malloc.
  309.  
  310. read the following description of the -pure & -malloc options:
  311.  
  312. When emacs is dumped, it saves (amongst other things) the copies of
  313. two zones of memory, called the pure storage area and the malloc hunk.
  314. These contain an internal representation of the lisp code, so the more
  315. code you include in a dumped emacs, the bigger these need to be. The
  316. default sizes of these are reasonable sizes for the standard lisp code
  317. which is dumped, but you will probably need to increase them if you
  318. add some more lisp modules. The best way to find the new values for n
  319. (size of pure area) and m (size of the malloc hunk), is to run the
  320. command
  321.  
  322.   cd gnuemacs:etc
  323.   stack 20000
  324.   /temacs -pure 200000 -malloc 200000 -nl -batch -l loadup dump
  325.  
  326. (these sizes should be largely sufficient, but if you still get one of
  327. the two error messages above, increase them). Then run emacs as usual,
  328. and look at the values of the 2 lisp variables
  329.  
  330.      pure-bytes-used
  331. and  amiga-malloc-bytes-used
  332.  
  333. pure-bytes used contains the minimum value for n, and
  334. amiga-malloc-bytes-used the minimum value for m. Add 1000 to these for
  335. luck to get values for n and m, and redump emacs using these (For
  336. reference, pure-bytes-used=127992 and amiga-malloc-bytes-used=86620 in
  337. my version).
  338.  
  339. For those who are into modifying the C source, the default values are
  340. 130000 for n (see DEF_PURESIZE in s-amiga.h) and 87000 for m (see
  341. MALLOC_HUNK_SIZE in amiga.h).
  342.  
  343.  
  344. 5. Problems
  345. -----------
  346.  
  347. If you see any problems in the redisplay, type control-L. They should
  348. go away (temporarily). If you can reproduce them, send me mail !!!
  349.  
  350. I am not aware of any other significant problems, but some features of
  351. emacs are still missing (mainly asynchronous processes). I hope to
  352. have some of these forthcoming in later releases.
  353.  
  354. Anyway, send any bug reports, enhancement requests, etc to:
  355.  
  356. Post:                E-mail:
  357. David Gay            dgay@di.epfl.ch
  358. 19 Chemin de la Source
  359. CH-1296 Coppet
  360. Vaud
  361. Switzerland
  362.  
  363. 6. Ordering Information
  364. -----------------------
  365.  
  366. I can provide a complete copy of my development directory, which
  367. includes:
  368.  
  369. o the standard emacs-18.58 files
  370. o modified and new lisp files
  371. o Amiga-specific source, as text and in RCS format (highlighting the
  372. changes from a standard unix distribution, and the different versions).
  373. o assorted lisp packages hacked for the Amiga (I will be posting some
  374. of these in due course):
  375.   - a tags-like access to the 2.0 autodocs (you must already have a
  376.     copy of these ...)
  377.   - gnus (a news reader) for use with Matt Dillon's uucp package. 
  378.   - getris, a tetris clone for emacs
  379.  
  380. All these as a tar file on a QIC-150 tape, for $200 (the same price as
  381. the FSF, so as not to undercut them), or 300SF. This price is valid
  382. until the 31st December 1993, and includes shipping by surface mail.
  383.  
  384. Please send all orders, by postal mail, to
  385.  
  386.   David Gay
  387.   19 Chemin de la Source
  388.   CH-1296 Coppet
  389.   Vaud
  390.   Switzerland
  391.  
  392.   Tel: +(41)-22 776 35 81 [Evenings, Central European Time]
  393.   Fax: +(41)-22 776 70 58
  394.  
  395. Include with your order:
  396. - A cheque, in dollars or Swiss francs.
  397. - Your *complete* address (don't forget the country, etc).
  398. - A phone or fax number so I can contact you if I have any problems.
  399.  
  400. I will be glad to include, on request, and with full source, some
  401. other pieces of software I have written:
  402. - An HP11 calculator (this is an update to the version available on
  403. fish disks, with some bug fixes and 2.0 specific features).
  404. - A scheme compiler for the Amiga, currently in an alpha state.
  405. - A fortune cookie program, including 1 megabyte of cookies (merged
  406. from various sources).
  407.  
  408.  
  409. Dvaid Gay
  410. dgay@di.epfl.ch
  411. Ecole Polytechnique Federale de Lausanne - Switzerland
  412. Laboratoire d'Informatique Technique
  413.