Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.emacs,net.text Subject: Re: M-x spell buffer with TeX files Message-ID: <3327@umcp-cs.UUCP> Date: Sat, 22-Feb-86 15:21:49 EST Article-I.D.: umcp-cs.3327 Posted: Sat Feb 22 15:21:49 1986 Date-Received: Mon, 24-Feb-86 20:55:00 EST References: <188@bu-cs.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 221 Xref: linus net.emacs:1707 net.text:895 Our solution to the various spell problems was to write a local version of the `spell' shell script. Here are the diffs from a vanilla 4.2 spell to our local version, /usr/local/bin/spell, and then from that to spelltex and to spelllatex. The local script also handles local dictionaries as specified by the environment variable $SPELL_LISTS. Note that the script below will only work on 4.2 systems and derivatives due to long file names. : Run this shell script with "sh" not "csh" PATH=/bin:/usr/bin:/usr/ucb:/etc:$PATH export PATH all=FALSE if [ x$1 = x-a ]; then all=TRUE fi echo 'Extracting spell.diff' sed 's/^X//' <<'//go.sysin dd *' >spell.diff *** /usr/4.2/usr/bin/spell Tue Sep 27 12:49:27 1983 --- spell.sh Mon Jan 13 04:18:40 1986 *************** *** 2,11 **** # # @(#)spell.sh 1.3 (Berkeley) 83/09/10 # : V data for -v, B flags, D dictionary, S stop, H history, F files, T temp V=/dev/null B= F= S=/usr/dict/hstop H=/dev/null T=/tmp/spell.$$ next="F=$F@" ! trap "rm -f $T ${T}a ; exit" 0 for A in $* do --- 2,22 ---- # # @(#)spell.sh 1.3 (Berkeley) 83/09/10 + # @(#)spell.sh (U of M Hacked: 10-Aug-84) # : V data for -v, B flags, D dictionary, S stop, H history, F files, T temp + + PATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin + V=/dev/null B= F= S=/usr/dict/hstop H=/dev/null T=/tmp/spell.$$ + T1=/tmp/spell1.$$ + + # next two are so that spell, spelltex, and spelllatex are almost identical, + # except of course for these lines: + ME=spell + DE="deroff@-w" # @ is IFS when this is eval'd + next="F=$F@" ! trap "rm -f $T $T1 ${T}a ; exit" 0 for A in $* do *************** *** 19,25 **** -s) next="S=" ;; -h) next="H=" ;; ! -*) echo "Bad flag for spell: $A" ! echo "Usage: spell [ -v ] [ -b ] [ -d hlist ] [ -s hstop ] [ -h spellhist ]" ! exit ;; *) eval $next"$A" next="F=$F@" ;; --- 30,36 ---- -s) next="S=" ;; -h) next="H=" ;; ! -*) echo "Bad flag for $ME: $A" 1>&2 ! echo "Usage: $ME [ -v ] [ -b ] [ -d hlist ] [ -s hstop ] [ -h spellhist ]" 1>&2 ! exit 1;; *) eval $next"$A" next="F=$F@" ;; *************** *** 27,39 **** done IFS=@ ! case $H in ! /dev/null) deroff -w $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T ;; ! *) deroff -w $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T | tee -a $H ! who am i >> $H 2> /dev/null ;; ! esac case $V in /dev/null) exit ;; --- 38,92 ---- done IFS=@ ! ! # Cull out any words appearing in any file named in the environment ! # variable ``SPELL_LISTS''. Note that ``comm'' can't be instructed to ! # ignore case, so we must lower-caseify everything. (18-Jan-83 FLB) ! ! if ! private_lists=`printenv SPELL_LISTS` ! then ! ! # Handle as in default, but dump output to T1 ! case $H in ! /dev/null) $DE $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T > $T1 ;; ! *) $DE $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T | tee -a $H > $T1 ! who am i >> $H 2> /dev/null ;; ! esac ! ! # Lower-caseify everything (ugh!) ! mv $T1 $T ! tr '[A-Z]' '[a-z]' < $T | sort -u +0f +0 > $T1 ! ! # Comb out words appearing in user's private lists. ! for list in $private_lists ! do ! if ! [ -r "$list" ] ! then ! mv $T1 $T ! comm -23 $T "$list" > $T1 ! else ! echo "$0: $list unreadable" ! fi ! done ! cat $T1 ! ! else ! # Default case: handle as distributed by Berkeley ! case $H in ! /dev/null) $DE $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T ;; ! *) $DE $F | sort -u | /usr/lib/spell $S $T | ! /usr/lib/spell ${D-/usr/dict/hlista} $V $B | ! sort -u +0f +0 - $T | tee -a $H ! who am i >> $H 2> /dev/null ;; ! esac ! fi ! case $V in /dev/null) exit ;; //go.sysin dd * if [ `wc -c < spell.diff` != 3322 ]; then made=FALSE echo 'error transmitting "spell.diff" --' echo 'length should be 3322, not' `wc -c < spell.diff` else made=TRUE fi if [ $made = TRUE ]; then chmod 644 spell.diff echo -n ' '; ls -ld spell.diff fi echo 'Extracting spell.vs.spelllatex.diff' sed 's/^X//' <<'//go.sysin dd *' >spell.vs.spelllatex.diff *** spell.sh Mon Jan 13 04:18:40 1986 --- spelllatex.sh Sun Jan 5 16:54:24 1986 *************** *** 14,19 **** # next two are so that spell, spelltex, and spelllatex are almost identical, # except of course for these lines: ! ME=spell ! DE="deroff@-w" # @ is IFS when this is eval'd next="F=$F@" --- 14,19 ---- # next two are so that spell, spelltex, and spelllatex are almost identical, # except of course for these lines: ! ME=spelllatex ! DE=delatex next="F=$F@" //go.sysin dd * if [ `wc -c < spell.vs.spelllatex.diff` != 485 ]; then made=FALSE echo 'error transmitting "spell.vs.spelllatex.diff" --' echo 'length should be 485, not' `wc -c < spell.vs.spelllatex.diff` else made=TRUE fi if [ $made = TRUE ]; then chmod 644 spell.vs.spelllatex.diff echo -n ' '; ls -ld spell.vs.spelllatex.diff fi echo 'Extracting spell.vs.spelltex.diff' sed 's/^X//' <<'//go.sysin dd *' >spell.vs.spelltex.diff *** spell.sh Mon Jan 13 04:18:40 1986 --- spelltex.sh Sun Jan 5 16:54:39 1986 *************** *** 14,19 **** # next two are so that spell, spelltex, and spelllatex are almost identical, # except of course for these lines: ! ME=spell ! DE="deroff@-w" # @ is IFS when this is eval'd next="F=$F@" --- 14,19 ---- # next two are so that spell, spelltex, and spelllatex are almost identical, # except of course for these lines: ! ME=spelltex ! DE=detex next="F=$F@" //go.sysin dd * if [ `wc -c < spell.vs.spelltex.diff` != 479 ]; then made=FALSE echo 'error transmitting "spell.vs.spelltex.diff" --' echo 'length should be 479, not' `wc -c < spell.vs.spelltex.diff` else made=TRUE fi if [ $made = TRUE ]; then chmod 644 spell.vs.spelltex.diff echo -n ' '; ls -ld spell.vs.spelltex.diff fi -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu