Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!rochester!cornell!batcomputer!itsgw!nysernic!rutgers!iuvax!pur-ee!j.cc.purdue.edu!nwd From: nwd@j.cc.purdue.edu (Daniel Lawrence) Newsgroups: comp.sys.atari.st Subject: Re: Emacs, microEMACS, microGnuEMACS Message-ID: <5686@j.cc.purdue.edu> Date: Wed, 21-Oct-87 11:43:56 EDT Article-I.D.: j.5686 Posted: Wed Oct 21 11:43:56 1987 Date-Received: Sat, 24-Oct-87 15:29:02 EDT References: <1180@water.waterloo.edu> Reply-To: nwd@j.cc.purdue.edu.UUCP (Daniel Lawrence) Organization: Purdue University Lines: 103 Keywords: answers Summary: MicroEMACS answers In article <1180@water.waterloo.edu> ljdickey@water.waterloo.edu (Lee Dickey) writes: >I have been experimenting with three different versions of EMACS >on my ST, >one is called simply EMACS.PRG, one is called MG, and the third is >called microEMACS and comes as a part of the Gulam shell. > MG is Micro GNU Emacs, ie it is an emacs which is very compatable with GNU Emacs on many UNIX mainframes. EMACS.PRG is actually MicroEMACS 3.x (7 or 8 or 9) and is an extensive emacs with a macro language and a lot of features. All three of the above EMACS were originally derived from Dave Conroy's microEMACS (which is essentially what is inside GULAM) written in 1984/1985. >So far, I feel that I have not progressed very far on the learning curve. >because I can not make any of them do much more than some primitive >word processors. > >(I have used and written about two powerful programmable editors, and >am looking for some of the same capabilities.) > Since I have been programming MicroEMACS 3.x for a couple of years, I can only answer your questions for that one. >I have a few questions that maybe someone can help me with, please :-) . >I know that I am revealing my ignorance here, but that is exactly >what it is, ignorance. > > How can I read a file into an existing buffer? > (This is what VI users do by typing > the command ".r file".) > ^X ^I (insert-file) inserts a disk file into the current buffer at the location of the cursor. ^X ^R (read-file) reads a file into a buffer replacing its original contents ^X ^F (find-file) finds a file already in a buffer and switches to it, or creates a new buffer and reads the file in. > How do I change in lines with "exp1", all instance of "exp2" > to "text3". (This is what VI users by typing > the command "1,$ g/exp1/ s/exp2/text3/". ) > This one is difficult..... 30 store-macro set %savebuf $cbufname set %exp1 @"Selection string: " set %exp2 @"Search string: " set %text3 @"Replacement String: " *nexts search-forward %exp1 ;when this fails, the macro aborts... beginning-of-line 1 kill-to-end-of-line ;grab the line select-buffer "[temp]" ;stash it... yank beginning-of-file ;do the replacement (ignoring a failure) !force replace-string %exp2 %text3 beginning-of-file ;grab it again 1 kill-to-end-of-line select-buffer %savebuf ;and put it back yank ;we are now positioned at the next line !goto nexts !endm bind-to-key execute-macro-30 M-S ;bind this to Meta-S (too pick one) now the META-S keystroke will do what you ask from the current cursor in the current buffer to the end of that buffer. > How do I define a macro when starting the editor? > Place it in your emacs.rc file (or .emacsrc on UNIX or the AMIGA) > Can I define a macros from a text file after the editor > is running? > Yes, the execute-file command executes a file of macros A close look at the emacs.mss file that comes in the standard distribution package should answer most of your questions. >Thanks! > >-- > L. J. Dickey, Faculty of Mathematics, University of Waterloo. > ljdickey@watmath.UUCP UUCP: ...!uunet!watmath!ljdickey > ljdickey%water@waterloo.edu ljdickey@watdcs.BITNET > ljdickey%water%waterloo.csnet@csnet-relay.ARPA Daniel Lawrence (317) 742-5153 UUCP: {ihnp4!pur-ee!}j.cc.purdue.edu!nwd ARPA: nwd@j.cc.purdue.edu FIDO: 201/2 The Programmer's Room (317) 742-5533