Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Load macro file, then apply to another file

15 views
Skip to first unread message

lars.br...@gmail.com

unread,
Oct 26, 2018, 9:48:27 AM10/26/18
to
Hello,

I have a file "instll teco" with a TECO macro, and another file "pdp10 gtout"
which is data. The macro needs to run when the data file is in the buffer.

I came up with this for ITS TECO:

ERinstll teco$ @Y HXx HK$$
ERpdp10 gtout$ @Y Mx$$

This is ok, but I wonder if there is a better way to do this?

Alan Bawden

unread,
Oct 26, 2018, 3:53:26 PM10/26/18
to
lars.br...@gmail.com writes:
> I have a file "instll teco" with a TECO macro, and another file "pdp10 gtout"
> which is data. The macro needs to run when the data file is in the buffer.
>
> I came up with this for ITS TECO:

If I only needed to do this once, I would just do it all from inside EMACS.
Read the data file into an EMACS buffer. Type <alt><alt> to get a
minibuffer. Yank the macro into the minibuffer. Type <alt><alt> to run
it.

If I had to do it with some regularity, I would just define the macro as a
command in my personal EMACS environment. Although I find that I no longer
remember the details about how one does that...

--
Alan Bawden

Lars Brinkhoff

unread,
Oct 26, 2018, 5:00:41 PM10/26/18
to
Alan Bawden wrote:
> > I have a file "instll teco" with a TECO macro, and another file "pdp10 gtout"
> > which is data. The macro needs to run when the data file is in the buffer.
>
> If I only needed to do this once, I would just do it all from inside EMACS.
> If I had to do it with some regularity, I would just define the macro as a
> command in my personal EMACS environment.

This is part of building Alan Snyder's C compiler. The machine description
is processed to generate PDP10 GTOUT. Snippets of this file is distributed
to the compiler source files using the TECO code. This is done very rarely
manually, if ever. I have an automated script to build the compiler, so
this is the context in which the macro is used.

The interactions the script does with TECO to load the macro, save it, load
the data, and call the macro is about the same as doing it with EMACS.

I wonder, though, if there's maybe some way have the data in the buffer and
then M(...get macro file as string...). Can't you read from a file directly
to a q-reg? I haven't found anything in TECMAN or TECORD.


One minor improvement. I see HXx HK can be written shorter as HFXx. But
then, Y deletes the previous buffer contents, so there's no need for K.

ERpdp10 gtout$ @Y HXx ERinstll teco$ @Y Mx$$

Alan Bawden

unread,
Oct 26, 2018, 8:06:31 PM10/26/18
to
Lars Brinkhoff <lars.br...@gmail.com> writes:
> I wonder, though, if there's maybe some way have the data in the buffer and
> then M(...get macro file as string...). Can't you read from a file directly
> to a q-reg? I haven't found anything in TECMAN or TECORD.

Perhaps what you want is :EJ, which is the usual way to load TECO code into
memory. That reqires you to "compile" your code into an :EJ file first.
If I recall, there are two competing tools for doing that: PURIFY and
IVORY. I used to use IVORY, but I no longer remember anything about how to
use it...

--
Alan Bawden
0 new messages