Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!pyrltd!tetrauk!rick From: rick@tetrauk.UUCP (Rick Jones) Newsgroups: comp.editors Subject: Re: Vi macro strangeness Keywords: vi macro lowercase Message-ID: <1026@tetrauk.UUCP> Date: 16 Nov 90 17:36:22 GMT References: <9400@b11.ingr.com> Reply-To: rick@tetrauk.UUCP (Rick Jones) Organization: Tetra Ltd., Maidenhead, UK Lines: 38 In article <9400@b11.ingr.com> brad@b11.ingr.com (Brad Maxwell) writes: > >I was playing with the recent macro to lowercase or uppercase the >last word typed and found something strange in my vi. > >The macro starts something like > >map! ^B ^]bywPb....(so on and so on) > >which is supposed to back up, yank the word, put it in front of itself, >and back up to the beginning again ( hello --> hello hello ). > >Anyway, this much of the macro gives ( hello --> bhello hello ). The >P command inserts the 'b' onto the line itself. The keystrokes work >fine by themselves, and the macro was posted by someone who really >uses it. What causes this and how do I fix it? > >Any ideers are appreciated, I found this problem myself a while back, and also posted it looking for help. It appears to be a bug in the general version of vi released with Unix V.3, and is all to do with the macro code getting confused about what bits of its buffers are commands and which are text. Earlier versions of vi don't have this problem - I was annoyed when it broke some previously working macros on my system when I upgraded! It seems the only real cure is to fix the source if you have it, or get another version of vi. I believe some versions will work if you use a named buffer instead of the default one (e.g. put "z in front of the y and P), but mine (SCO Unix V/386) doesn't. A source patch was posted when I reported this, but I'm afraid I didn't keep it (not having source code). No doubt you will get other replies from those with more inside knowledge. -- Rick Jones Tetra Ltd. Maidenhead, Berks, UK rick@tetrauk.uucp Absence of .signature is not .signature of absence