Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!j.cc.purdue.edu!nwd From: nwd@j.cc.purdue.edu (Daniel Lawrence) Newsgroups: comp.emacs Subject: Re: MicroEmacs' $readhook Summary: uEMACS $readhook Keywords: MicroEmacs 3.10 VMS $readhook Mail.rc Message-ID: <9785@j.cc.purdue.edu> Date: 24 Jul 89 14:43:09 GMT References: <809@eutrc3.urc.tue.nl> Reply-To: nwd@j.cc.purdue.edu (Daniel Lawrence) Organization: Purdue University Lines: 51 In article <809@eutrc3.urc.tue.nl> wsincc@eutrc3.urc.tue.nl (Wim van Dorst) writes: >Hello Everybody, > >I have set up as indicated in the manual, the proper things in >order to use MicroEmacs as my mail-editor. This works great sofar. > >I have made a file mail.rc to use as startup file while using >MicroEmacs as mail-editor. It makes use of $writehook to add >my signature to the typed-in letter. I now want it to insert >things like "> " in front of each line of the letter I am >replying to, using $readhook. I have in mail.rc this: [Macro Deleted] >When I open a letter (Mail, send, me, subject) it gives me an >empty file and no message. [More confusion..] >How come I don't get the results I expect? Is it something I have >not yet understood about the use of the $readhook, or is it a >bug, or....? $readhook executes on the new buffer BEFORE the file is read in. It is meant primarily to allow you to set up an environment for a file (by looking at it's file name or extention) before reading it in. To do what you want, it seems simple enough to just set up a command to read the file in and then do the quoting. For example: store-procedure mailread find-file @"Mail file to read: " beginning-of-file insert-string "> " replace-string "~n" "~n> " beginning-of-file unmark-buffer !endm macro-to-key mailread ^XR (This is not tested.....) So, when you want to read a mail file in order to replay, just strike the ^X-R command, or build in a call to this inside your mail macroes. >I hope to see this discussed in this newsgroup, please. > >Met vriendelijke groeten, Wim van Dorst >(wsincc@tuerc3.urc.tue.nl or wsincc@tuerc3.uucp) Daniel Lawrence voice: (317) 742-5153 arpa: dan@midas.mgmt.purdue.edu The Programmer's Room Fido: 1:201/10 - (317) 742-5533