ka@hou3c.UUCP (Kenneth Almquist) (10/29/84)
Some people have objected to the automatic inclusion of the parent article in followups by postnews, so I will release a few goodies from 2.11 vnews. My belief is that it should be possible to request the parent of the article be included in the followup while you are editing your followup. If you run Gosling's emacs, bind the macro given below to ^X^Y. Then typing ^X^Y will read in the body of the parent article and leave you at the beginning of it. I translated this macro to work with Warren Montgomery's EMACS; translations to other versions of EMACS should be straightforward. Ed does not have a macro facility, so I wrote a shell procedure called gparent which should be invoked from ed as "r !gparent". Vi has a macro facility, but I don't know how to use it. You could invoke the gparent shell procedure just like you do from ed, but that leaves the cursor at the end of the included article rather than the beginning. Any vi wizards want to work on this one? All these routines assume that $A is set to the file containing the parent article. It is easy to patch postnews to do this. In the routine edit, somewhere around line 294, you should see the line: sprintf(buf, "exec %s %s %s", editor, endflag, tempfname); If you use sh or ksh, change this to if (orignal) sprintf(buf, "A=%s exec %s %s %s", original, editor, endflag, tempfname); else sprintf(buf, "exec %s %s %s", editor, endflag, tempfname); If you use csh, add a call to setenv instead. Kenneth Almquist --------- here is the gparent macro for Gosling's EMACS --------- ; This mlisp macro reads in the body of the article being followed up, ; preceding each line with a "> ". ; It is intended to be bound to ^X^Y. (defun (gparent (end-of-file) (save-excursion (set-mark) (insert-file (getenv "A")) (re-search-forward "^$") (next-line) (erase-region) (re-replace-string "^" "> ") ) ) ) ------- here is the gparent macro for Warren Mongomery's EMACS ------ Since the gparent macro for Warren Montgomery's emacs contains control characters, it cannot be distributed directly over the net. Here is a listing of the macro in octal: 030 031 034 147 160 141 162 145 156 164 040 055 040 151 156 163 145 162 164 040 142 157 144 171 040 157 146 040 157 162 151 147 151 156 141 154 040 141 162 164 151 143 154 145 012 276 000 030 074 101 012 305 025 030 022 030 030 000 030 074 136 044 012 223 016 027 030 055 033 061 064 000 030 074 076 040 012 030 074 136 012 222 122 033 062 010 030 055 033 061 064 030 030 032 012 ------ here is the gparent shell procedure for users of ed ------ #!/bin/sh a=${1-${A?}} sed -e '1,/^$/d' -e 's/^/> /' $a
ka@hou3c.UUCP (Kenneth Almquist) (11/11/84)
This is only a test. I apologize in advance if it escapes to the net. -- This is my signature file. Please ignore it.