From owner-freebsd-bugs Fri Jun 20 13:20:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA22683 for bugs-outgoing; Fri, 20 Jun 1997 13:20:11 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA22647; Fri, 20 Jun 1997 13:20:07 -0700 (PDT) Resent-Date: Fri, 20 Jun 1997 13:20:07 -0700 (PDT) Resent-Message-Id: <199706202020.NAA22647@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, andrew@ugh.net.au 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 X-Send-Pr-Version: 3.2 Subject: gnu/3918: Line wrapping in send-pr Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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 - + 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: