From andrew@sally.ugh.net.au Fri Jun 20 13:14:44 1997 Received: from css.tuu.utas.edu.au (root@css.tuu.utas.edu.au [131.217.115.65]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA22186 for ; Fri, 20 Jun 1997 13:14:42 -0700 (PDT) Received: from sally.ugh.net.au (dialin6.hbt.utas.tassie.net.au [203.57.208.6]) by css.tuu.utas.edu.au (8.8.5/8.8.5) with ESMTP id GAA00845 for ; Sat, 21 Jun 1997 06:11:10 +1000 (EST) Received: (from andrew@localhost) by sally.ugh.net.au (8.8.5/8.8.5) id FAA02048; Fri, 20 Jun 1997 05:32:15 +1000 (EST) Message-Id: <199706191932.FAA02048@sally.ugh.net.au> Date: Fri, 20 Jun 1997 05:32:15 +1000 (EST) From: Andrew Reply-To: andrew@ugh.net.au To: FreeBSD-gnats-submit@freebsd.org Subject: Line wrapping in send-pr X-Send-Pr-Version: 3.2 >Number: 3918 >Category: gnu >Synopsis: vi dosnt wrap lines when called from send-pr >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 20 13:20:05 PDT 1997 >Closed-Date: Sun Mar 8 06:47:20 PST 1998 >Last-Modified: Sun Mar 8 06:53:39 PST 1998 >Originator: Andrew >Release: FreeBSD 2.2.2-RELEASE i386 >Organization: UgH! >Environment: The EDITOR variable in my environment is set to vi. >Description: If you use send-pr with vi as the editor it dosnt wrap lines automatically. They should eb as they have to go through the mail. >How-To-Repeat: setenv EDITOR vi;send-pr in a csh derivative. >Fix: The attached patch seems to fix it while still retaining the users initial vi settings. It allows for .nexrc, .exrc files, EXINIT environment settings with and without set already in them. If it is not possible to have a valid EXINIT variable without set in it it could simplyfy things a fair bit. Also is there a utility that could replace perl -e? Something that matches regex and then exits with a 0 or 1 depending on match? *** send-pr.orig Fri Jun 20 04:12:12 1997 --- send-pr Fri Jun 20 05:24:46 1997 *************** *** 131,136 **** --- 131,158 ---- EDIT="$VISUAL" fi + + # If they're using vi make the lines wrap at 72 characters - + if [ $EDIT = "vi" ] ; then + if [ "x$EXINIT" = x ] ; then + if [ -f $HOME/.nexrc ] ; then + EXINIT=`cat $HOME/.nexrc` + elif [ -f $HOME/.exrc ] ; then + EXINIT=`cat $HOME/.exrc` + else + EXINIT=set + fi + EXINIT="$EXINIT wl=72" + else + if ( perl -e "if (\"$EXINIT\" !~ m/set/) { exit(1) };" ) ; then + EXINIT="$EXINIT wl=72" + else + EXINIT="$EXINIT set wl=72" + fi + fi + fi + export EXINIT + # Find out some information. SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \ ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""` >Release-Note: >Audit-Trail: From: Bill Fenner To: andrew@ugh.net.au Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: gnu/3918: Line wrapping in send-pr Date: Fri, 20 Jun 1997 17:36:03 PDT I think a simpler solution is probably "vi +"set wl=72" filename". There are any number of things wrong with trying to do this via EXINIT; the code you suggested causes a syntax error when vi starts up with my ~/.nexrc, which is about the worst thing it could possibly do. In any case, I'm not sure I'm a big believer in having a script auto-set a variable for me in vi. I don't turn wraplen on when I'm composing mail, so probably don't want it on when I'm composing a bug report, either. Bill State-Changed-From-To: open->closed State-Changed-By: hoek State-Changed-When: Sun Mar 8 06:47:20 PST 1998 State-Changed-Why: The concensus seems to be, between J Wunsch, Bill Fenner, and I'll add myself that if you are going to set EDITOR=vi, you should know how to use ${EDITOR}. Msg-Id: 199706210040.RAA05089@hub.freebsd.org, 19970621161318.VW56687@uriah.heep.sax.de >Unformatted: