From owner-svn-ports-head@freebsd.org Thu Mar 21 17:17:50 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26F331548B4A; Thu, 21 Mar 2019 17:17:50 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCA556E182; Thu, 21 Mar 2019 17:17:49 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 904C8C02B; Thu, 21 Mar 2019 17:17:49 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2LHHnd9081452; Thu, 21 Mar 2019 17:17:49 GMT (envelope-from leres@FreeBSD.org) Received: (from leres@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2LHHnaU081450; Thu, 21 Mar 2019 17:17:49 GMT (envelope-from leres@FreeBSD.org) Message-Id: <201903211717.x2LHHnaU081450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leres set sender to leres@FreeBSD.org using -f From: Craig Leres Date: Thu, 21 Mar 2019 17:17:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r496476 - in head/editors/nvi-devel: . files X-SVN-Group: ports-head X-SVN-Commit-Author: leres X-SVN-Commit-Paths: in head/editors/nvi-devel: . files X-SVN-Commit-Revision: 496476 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BCA556E182 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 17:17:50 -0000 Author: leres Date: Thu Mar 21 17:17:48 2019 New Revision: 496476 URL: https://svnweb.freebsd.org/changeset/ports/496476 Log: For those of us who prefer vi over vim there are no good options for editing Python code. This patch (based on one by rokuyama at rk.phys.keio.ac.jp) that adds the EXPANDTAB option to nvi (defaults to off) which adds an expandtab option to nvi. PR: 235446 Approved by: johans (maintainer timeout, 6 weeks), matthew (mentor, implicit) Added: head/editors/nvi-devel/files/extra-patch-expandtab (contents, props changed) Modified: head/editors/nvi-devel/Makefile Modified: head/editors/nvi-devel/Makefile ============================================================================== --- head/editors/nvi-devel/Makefile Thu Mar 21 17:12:21 2019 (r496475) +++ head/editors/nvi-devel/Makefile Thu Mar 21 17:17:48 2019 (r496476) @@ -3,7 +3,7 @@ PORTNAME= nvi PORTVERSION= 1.81.6 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= editors MASTER_SITES= ftp://ftp.stack.nl/pub/users/johans/nvi/ @@ -12,9 +12,10 @@ COMMENT= Development snapshot of the world-renown nvi CONFLICTS_INSTALL= nvi-m17n-[0-9]* xnview-[0-9]* -OPTIONS_DEFINE= WIDECHAR +OPTIONS_DEFINE= EXPANDTAB WIDECHAR OPTIONS_DEFAULT=WIDECHAR WIDECHAR_DESC= Enable wide-character support (UTF-8) +EXPANDTAB_DESC= Apply the expandtab option patch WRKSRC= ${WRKDIR}/${DISTNAME}/build.unix GNU_CONFIGURE= yes @@ -24,6 +25,7 @@ CONFIGURE_ARGS+= --with-db-prefix=${LOCALBASE} \ --program-prefix=n CONFIGURE_SCRIPT= ../dist/configure +EXPANDTAB_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-expandtab WIDECHAR_CONFIGURE_ON= --enable-widechar CPPFLAGS+= -I${BDB_INCLUDE_DIR} -I${LOCALBASE}/include -I${NCURSESINC} Added: head/editors/nvi-devel/files/extra-patch-expandtab ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/nvi-devel/files/extra-patch-expandtab Thu Mar 21 17:17:48 2019 (r496476) @@ -0,0 +1,255 @@ +Adapted from: + + http://flex.phys.tohoku.ac.jp/~okuyama/nvi-m17n-expandtab.html + http://flex.phys.tohoku.ac.jp/~okuyama/src/nvi-m17n-expandtab.patch + +diff -u ../common/options.c.orig ../common/options.c +--- ../common/options.c.orig 2007-11-18 16:41:42.000000000 +0000 ++++ ../common/options.c 2019-02-01 23:18:48.173808000 +0000 +@@ -78,6 +78,10 @@ + {L("edcompatible"),NULL, OPT_0BOOL, 0}, + /* O_ESCAPETIME 4.4BSD */ + {L("escapetime"), NULL, OPT_NUM, 0}, ++#ifdef O_EXPANDTAB ++/* O_EXPANDTAB NetBSD 5.0 */ ++ {L("expandtab"), NULL, OPT_0BOOL, 0}, ++#endif + /* O_ERRORBELLS 4BSD */ + {L("errorbells"), NULL, OPT_0BOOL, 0}, + /* O_EXRC System V (undocumented) */ +diff -u ../common/options_def.h.orig ../common/options_def.h +--- ../common/options_def.h.orig 2007-11-18 16:43:54.000000000 +0000 ++++ ../common/options_def.h 2019-02-01 23:18:48.174244000 +0000 +@@ -13,71 +13,72 @@ + #define O_TMP_DIRECTORY 11 + #define O_EDCOMPATIBLE 12 + #define O_ESCAPETIME 13 +-#define O_ERRORBELLS 14 +-#define O_EXRC 15 +-#define O_EXTENDED 16 +-#define O_FILEC 17 +-#define O_FILEENCODING 18 +-#define O_FLASH 19 +-#define O_HARDTABS 20 +-#define O_ICLOWER 21 +-#define O_IGNORECASE 22 +-#define O_INPUTENCODING 23 +-#define O_KEYTIME 24 +-#define O_LEFTRIGHT 25 +-#define O_LINES 26 +-#define O_LISP 27 +-#define O_LIST 28 +-#define O_LOCKFILES 29 +-#define O_MAGIC 30 +-#define O_MATCHTIME 31 +-#define O_MESG 32 +-#define O_MODELINE 33 +-#define O_MSGCAT 34 +-#define O_NOPRINT 35 +-#define O_NUMBER 36 +-#define O_OCTAL 37 +-#define O_OPEN 38 +-#define O_OPTIMIZE 39 +-#define O_PARAGRAPHS 40 +-#define O_PATH 41 +-#define O_PRINT 42 +-#define O_PROMPT 43 +-#define O_READONLY 44 +-#define O_RECDIR 45 +-#define O_REDRAW 46 +-#define O_REMAP 47 +-#define O_REPORT 48 +-#define O_RULER 49 +-#define O_SCROLL 50 +-#define O_SEARCHINCR 51 +-#define O_SECTIONS 52 +-#define O_SECURE 53 +-#define O_SHELL 54 +-#define O_SHELLMETA 55 +-#define O_SHIFTWIDTH 56 +-#define O_SHOWMATCH 57 +-#define O_SHOWMODE 58 +-#define O_SIDESCROLL 59 +-#define O_SLOWOPEN 60 +-#define O_SOURCEANY 61 +-#define O_TABSTOP 62 +-#define O_TAGLENGTH 63 +-#define O_TAGS 64 +-#define O_TERM 65 +-#define O_TERSE 66 +-#define O_TILDEOP 67 +-#define O_TIMEOUT 68 +-#define O_TTYWERASE 69 +-#define O_VERBOSE 70 +-#define O_W1200 71 +-#define O_W300 72 +-#define O_W9600 73 +-#define O_WARN 74 +-#define O_WINDOW 75 +-#define O_WINDOWNAME 76 +-#define O_WRAPLEN 77 +-#define O_WRAPMARGIN 78 +-#define O_WRAPSCAN 79 +-#define O_WRITEANY 80 +-#define O_OPTIONCOUNT 81 ++#define O_EXPANDTAB 14 ++#define O_ERRORBELLS 15 ++#define O_EXRC 16 ++#define O_EXTENDED 17 ++#define O_FILEC 18 ++#define O_FILEENCODING 19 ++#define O_FLASH 20 ++#define O_HARDTABS 21 ++#define O_ICLOWER 22 ++#define O_IGNORECASE 23 ++#define O_INPUTENCODING 24 ++#define O_KEYTIME 25 ++#define O_LEFTRIGHT 26 ++#define O_LINES 27 ++#define O_LISP 28 ++#define O_LIST 29 ++#define O_LOCKFILES 30 ++#define O_MAGIC 31 ++#define O_MATCHTIME 32 ++#define O_MESG 33 ++#define O_MODELINE 34 ++#define O_MSGCAT 35 ++#define O_NOPRINT 36 ++#define O_NUMBER 37 ++#define O_OCTAL 38 ++#define O_OPEN 39 ++#define O_OPTIMIZE 40 ++#define O_PARAGRAPHS 41 ++#define O_PATH 42 ++#define O_PRINT 43 ++#define O_PROMPT 44 ++#define O_READONLY 45 ++#define O_RECDIR 46 ++#define O_REDRAW 47 ++#define O_REMAP 48 ++#define O_REPORT 49 ++#define O_RULER 50 ++#define O_SCROLL 51 ++#define O_SEARCHINCR 52 ++#define O_SECTIONS 53 ++#define O_SECURE 54 ++#define O_SHELL 55 ++#define O_SHELLMETA 56 ++#define O_SHIFTWIDTH 57 ++#define O_SHOWMATCH 58 ++#define O_SHOWMODE 59 ++#define O_SIDESCROLL 60 ++#define O_SLOWOPEN 61 ++#define O_SOURCEANY 62 ++#define O_TABSTOP 63 ++#define O_TAGLENGTH 64 ++#define O_TAGS 65 ++#define O_TERM 66 ++#define O_TERSE 67 ++#define O_TILDEOP 68 ++#define O_TIMEOUT 69 ++#define O_TTYWERASE 70 ++#define O_VERBOSE 71 ++#define O_W1200 72 ++#define O_W300 73 ++#define O_W9600 74 ++#define O_WARN 75 ++#define O_WINDOW 76 ++#define O_WINDOWNAME 77 ++#define O_WRAPLEN 78 ++#define O_WRAPMARGIN 79 ++#define O_WRAPSCAN 80 ++#define O_WRITEANY 81 ++#define O_OPTIONCOUNT 82 +diff -u ../ex/ex_shift.c.orig ../ex/ex_shift.c +--- ../ex/ex_shift.c.orig 2007-11-18 16:41:42.000000000 +0000 ++++ ../ex/ex_shift.c 2019-02-02 00:56:44.320820000 +0000 +@@ -131,10 +131,19 @@ + * Build a new indent string and count the number of + * characters it uses. + */ ++#ifdef O_EXPANDTAB ++/* NetBSD 5.0 */ ++ tbp = bp; ++ newidx = 0; ++ if (!O_ISSET(sp, O_EXPANDTAB)) { ++#endif + for (tbp = bp, newidx = 0; + newcol >= O_VAL(sp, O_TABSTOP); ++newidx) { + *tbp++ = '\t'; + newcol -= O_VAL(sp, O_TABSTOP); ++#ifdef O_EXPANDTAB ++ } ++#endif + } + for (; newcol > 0; --newcol, ++newidx) + *tbp++ = ' '; +diff -u ../ex/ex_txt.c.orig ../ex/ex_txt.c +--- ../ex/ex_txt.c.orig 2007-11-18 16:41:42.000000000 +0000 ++++ ../ex/ex_txt.c 2019-02-01 23:18:48.174717000 +0000 +@@ -403,8 +403,17 @@ + * + * Count up spaces/tabs needed to get to the target. + */ ++#ifdef O_EXPANDTAB ++/* NetBSD 5.0 */ ++ cno = 0; ++ tabs = 0; ++ if (!O_ISSET(sp, O_EXPANDTAB)) { ++#endif + for (cno = 0, tabs = 0; cno + COL_OFF(cno, ts) <= scno; ++tabs) + cno += COL_OFF(cno, ts); ++#ifdef O_EXPANDTAB ++ } ++#endif + spaces = scno - cno; + + /* Make sure there's enough room. */ +diff -u ../vi/v_txt.c.orig ../vi/v_txt.c +--- ../vi/v_txt.c.orig 2007-11-18 16:41:42.000000000 +0000 ++++ ../vi/v_txt.c 2019-02-01 23:18:48.175305000 +0000 +@@ -1720,12 +1720,26 @@ + * If there are no spaces, or no tabs after spaces and less than + * ts spaces, it's already minimal. + */ ++#ifdef O_EXPANDTAB ++/* NetBSD 5.0 */ ++ ++ /* Keep analysing if expandtabs is set. */ ++ if (!O_ISSET(sp, O_EXPANDTAB)) ++#endif + if (!spaces || !tab_after_sp && spaces < ts) + return; + + /* Count up spaces/tabs needed to get to the target. */ ++#ifdef O_EXPANDTAB ++ cno = 0; ++ tabs = 0; ++ if (!O_ISSET(sp, O_EXPANDTAB)) { ++#endif + for (cno = 0, tabs = 0; cno + COL_OFF(cno, ts) <= scno; ++tabs) + cno += COL_OFF(cno, ts); ++#ifdef O_EXPANDTAB ++ } ++#endif + spaces = scno - cno; + + /* +@@ -1957,9 +1971,17 @@ + if (current >= target) + spaces = tabs = 0; + else { ++#ifdef O_EXPANDTAB ++ cno = current; ++ tabs = 0; ++ if (!O_ISSET(sp, O_EXPANDTAB)) { ++#endif + for (cno = current, + tabs = 0; cno + COL_OFF(cno, ts) <= target; ++tabs) + cno += COL_OFF(cno, ts); ++#ifdef O_EXPANDTAB ++ } ++#endif + spaces = target - cno; + } +