[comp.editors] vi:Too much macro text

pete@TIRS.oz.au (Peter Bartel) (03/05/91)

Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
into my .exrc, I now find that when I start vi or source .exrc I get:
    Too much macro text
As far as I can tell, all of the macros work as expected. I'm
running SunOS 4.1 and using the standard vi that comes with the
system.

Any ideas what this means? Is there an inconsistency in my .exrc? Or
is there limit to the memory used for storing macros?
_______________________________________________________________________
Peter Bartel	Senior Software Engineer	International
Phone:		+61-8-232-1740			Railroad
Faxstream:	+61-8-232-2274			Systems
E-mail:		pete@TIRS.oz.au			(Electronics)
Snail:		209-217 Wakefield St, Adelaide, South Australia, 5000

tchrist@convex.COM (Tom Christiansen) (03/06/91)

From the keyboard of pete@TIRS.oz.au (Peter Bartel):
:Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
:into my .exrc, I now find that when I start vi or source .exrc I get:
:    Too much macro text
:As far as I can tell, all of the macros work as expected. I'm
:running SunOS 4.1 and using the standard vi that comes with the
:system.
:
:Any ideas what this means? Is there an inconsistency in my .exrc? Or
:is there limit to the memory used for storing macros?

Not all versions of vi have the same limit on macro space, but to my 
knowledge all have some limit.  I upped mine a bunch.  It's a stupid 
way of doing things, but going in and making it infinite wasn't worth it.
Too easy just to add a zero. :-)

--tom
--
	I get so tired of utilities with arbitrary, undocumented,
	compiled-in limits.  Don't you?

Tom Christiansen		tchrist@convex.com	convex!tchrist

carl@mugwump.UK.Sun.COM (Carl Johnson - Sun EHQ - MIS) (03/06/91)

In article <1991Mar06.034417.17186@convex.com>, tchrist@convex.COM (Tom Christiansen) writes:
> From the keyboard of pete@TIRS.oz.au (Peter Bartel):
> :Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
> :into my .exrc, I now find that when I start vi or source .exrc I get:
> :    Too much macro text
> 
> Not all versions of vi have the same limit on macro space, but to my 
> knowledge all have some limit.  I upped mine a bunch.  It's a stupid 
> way of doing things, but going in and making it infinite wasn't worth it.
> Too easy just to add a zero. :-)
> 
> --tom

I am _sure_ Tom's answer is applicable in some instances (make that most :-)
 however in this case, having had the same problem when I first started using
 his macros, I think the problem is due to the fact that you have missed out
 some escape sequences.  For instance, where you see an  symbol make sure
 it is a proper one not a ^ followed by a [.  One way to do this is to move
 your cursor over the symbol you think is suspect and if it moves from the ^
 to the [ it is not a correct escape, what it should do is jump from the ^ over
 the [ to the next character.
 
 BTW if anyone (Tom?) knows why this is....
 Cheers,
 Carl.

tchrist@convex.COM (Tom Christiansen) (03/07/91)

From the keyboard of carl@mugwump.UK.Sun.COM (Carl Johnson - Sun EHQ - MIS):
: BTW if anyone (Tom?) knows why this is....

As posted, the exrc had beeen run through cat -v.  I'll send a uuencoded
version to anyone who asks.

--tom
--
	I get so tired of utilities with arbitrary, undocumented,
	compiled-in limits.  Don't you?

Tom Christiansen		tchrist@convex.com	convex!tchrist

edp328j@monu6.cc.monash.edu.au (3B Systems Support) (03/08/91)

pete@TIRS.oz.au (Peter Bartel) writes:

> Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
> into my .exrc, I now find that when I start vi or source .exrc I get:
>     Too much macro text

A common cause of this is editing a file in $HOME when $HOME/.exrc
exists - vi happily grabs .exrc twice (the one in $HOME and the one
in the current working directory).

Ralphe Neill

tchrist@convex.COM (Tom Christiansen) (03/09/91)

From the keyboard of edp328j@monu6.cc.monash.edu.au (3B Systems Support):
:
:pete@TIRS.oz.au (Peter Bartel) writes:
:
:> Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
:> into my .exrc, I now find that when I start vi or source .exrc I get:
:>     Too much macro text
:
:A common cause of this is editing a file in $HOME when $HOME/.exrc
:exists - vi happily grabs .exrc twice (the one in $HOME and the one
:in the current working directory).

Crap.  I'd forgotten that one.  I fixed it in ours.  The ****ing Sun 
code gets this one wrong, too.  I guess on Suns you better use /bin/ed.

--tom

jmm@eci386.uucp (John Macdonald) (03/13/91)

In article <1991Mar09.003517.5155@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
|From the keyboard of edp328j@monu6.cc.monash.edu.au (3B Systems Support):
|:
|:pete@TIRS.oz.au (Peter Bartel) writes:
|:
|:> Having incorporated a lot of Tom Christiansen's macros (thanks Tom)
|:> into my .exrc, I now find that when I start vi or source .exrc I get:
|:>     Too much macro text
|:
|:A common cause of this is editing a file in $HOME when $HOME/.exrc
|:exists - vi happily grabs .exrc twice (the one in $HOME and the one
|:in the current working directory).
|
|Crap.  I'd forgotten that one.  I fixed it in ours.  The ****ing Sun 
|code gets this one wrong, too.  I guess on Suns you better use /bin/ed.
|
|--tom

While I've never tripped over that particular problem, I
would suggest that it can probably be worked around by
setting environment variable EXINIT to "source $HOME/.exglobalrc"
so that it is being included explicitly by name instead of
implicitly because it matches the default name.  However,
I'm not sure offhand whether this will interfere with the
automatic inclusion of a .exrc file that *is* in the
current directory, if you ever really want that to occur.
-- 
Cure the common code...                      | John Macdonald
...Ban Basic      - Christine Linge          |   jmm@eci386

wyle@inf.ethz.ch (Mitchell Wyle) (03/14/91)

In <1991Mar12.184615.3940@eci386.uucp> jmm@eci386.UUCP (John Macdonald) says:

>While I've never tripped over that particular problem, I
>would suggest that it can probably be worked around by
>setting environment variable EXINIT to "source $HOME/.exglobalrc"
>so that it is being included explicitly by name instead of
>implicitly because it matches the default name.  However,
>I'm not sure offhand whether this will interfere with the
>automatic inclusion of a .exrc file that *is* in the
>current directory, if you ever really want that to occur.

I personally don't like directory-specific .exrc files; I don't think
the vi designers did, either.

In keeping with this same philosophy, I create macro families in
/usr/local/lib/vi/.  When you are in the middle of an edit session and
type reach for that wonderful macro --and it isn't there-- you just
source (:so) the appropriate macro family.  Our library currently
contains a family for modula-2, one for LaTeX, a few different ones for
C, and m6 (mitch's minimal mail message manipulating mechanism). I
think it's the most effective way to deal with the macro text limit.
That directory also has Maaaaaarten Litmath's reference guide, the
berkely tutorials, and some template files.

De gustebus non est disputandem.