Date: Fri, 20 Jun 1997 05:32:15 +1000 (EST) From: Andrew <andrew@sally.ugh.net.au> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: gnu/3918: Line wrapping in send-pr Message-ID: <199706191932.FAA02048@sally.ugh.net.au> Resent-Message-ID: <199706202020.NAA22647@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jun 20 13:20:05 PDT 1997 >Last-Modified: >Originator: Andrew >Organization: UgH! >Release: FreeBSD 2.2.2-RELEASE i386 >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 - <andrew@ugh.net.au> + 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 ""` >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706191932.FAA02048>