Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site luke.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!bene!luke!itkin From: itkin@luke.UUCP (Steven List) Newsgroups: net.unix Subject: Re: Vi query Message-ID: <336@luke.UUCP> Date: Wed, 11-Sep-85 16:23:31 EDT Article-I.D.: luke.336 Posted: Wed Sep 11 16:23:31 1985 Date-Received: Fri, 13-Sep-85 03:43:52 EDT References: <220@ur-cvsvax.UUCP> <183@graffiti.UUCP> Reply-To: itkin@luke.UUCP (Steven List) Distribution: net Organization: Benetics Corp, Mt.View, CA Lines: 46 Summary: In article <183@graffiti.UUCP> peter@graffiti.UUCP (Peter da Silva) writes: >> This would be a nice command to have while doing spelling corrections >> in a file. The following alias puts one into 'vi' with the list >> of 'misspelled' words appended. The cursor is on the last word. > >Change it to: > >alias sp 'spell \!* | tee /tmp/new$$ >> \!* ;\ > mv tags /tmp/old$$;\ > sed 's/^\(.*\)/\1 ?\1?/' > tags;\ > rm /tmp/new$$;\ > vi + \!*\ > mv /tmp/old$$ tags' >[...] >Thank you very much for showing *me* a great new application! One small detail - where's the input to sed? Also, the tags file needs to include the file name. This should therefore probably be a shell script, as follows: : # spell - generate a list of misspelled words and find them # # This script loops through each file named in its argument list # `spell'ing that file and adding to a tags file. The files must # be processed individually in order to include the file name in # the tags file. # rm spelltags # clear out the old, if any for file # get errors in each file do spell $file | sed "s/.*/& $file ?\<&\>?" >> spelltags done mv tags tags.old mv spelltags tags sort +0 -1 -o tags tags vi + $* Thanks to both of you for finally helping me to understand the use and power of tags! The light shines! -- *** * Steven List @ Benetics Corporation, Mt. View, CA * Just part of the stock at "Uncle Bene's Farm" * {cdp,greipa,idi,oliveb,sun,tolerant}!bene!luke!itkin ***