Date: Thu, 12 Jun 2008 03:14:09 +0800 (CST) From: Yi-Jheng Lin <yzlin@cs.nctu.edu.tw> To: FreeBSD-gnats-submit@FreeBSD.org Cc: cy@FreeBSD.org Subject: ports/124492: [PATCH] sysutils/screen: new knob WITH_SHOWENC Message-ID: <200806111914.m5BJE9Rp073442@stucgi.cs.nctu.edu.tw> Resent-Message-ID: <200806111930.m5BJU1TI077565@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 124492 >Category: ports >Synopsis: [PATCH] sysutils/screen: new knob WITH_SHOWENC >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 11 19:30:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Yi-Jheng Lin >Release: FreeBSD 7.0-RELEASE-p1 amd64 >Organization: NCTU CS >Environment: System: FreeBSD stucgi 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #0: Thu Apr 17 15:56:39 CST 2008 >Description: [DESCRIBE CHANGES] A new status line parameter is added. With this patch, screen could show encoding of every window on status line (caption or hardstatus) by adding a parameter "%e". Here is an example: hardstatus alwayslastline "%=%e %H %c %d/%m/%Y Load: %l " It's an useful feature for switching between windows with different encodings such as Big5 & UTF-8. And I don't have to use "^A + i" to check which encoding I use. Added file(s): - files/opt-showencoding Port maintainer (cy@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.77 >How-To-Repeat: >Fix: --- screen-4.0.3_5.patch begins here --- diff -ruN --exclude=CVS sysutils/screen.orig/Makefile sysutils/screen/Makefile --- sysutils/screen.orig/Makefile 2008-06-10 13:53:18.000000000 +0800 +++ sysutils/screen/Makefile 2008-06-12 02:51:31.000000000 +0800 @@ -7,7 +7,7 @@ PORTNAME= screen PORTVERSION= 4.0.3 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \ http://komquats.com/distfiles/ \ @@ -23,7 +23,8 @@ MAN "Build and install man pages" ON \ NETHACK "Enable nethack-style messages" ON \ XTERM_256 "Enable support for 256 colour xterm" OFF \ - HOSTINLOCKED "Print user@host in locked message" OFF + HOSTINLOCKED "Print user@host in locked message" OFF \ + SHOWENC "Show encoding on the status line" OFF NO_PACKAGE= Tends to loop using 100% CPU when used from package - perhaps it hard-codes information about the build host @@ -67,6 +68,11 @@ EXTRA_PATCHES+= ${FILESDIR}/opt-hostinlocked .endif +# show encoding on the status line via option "showenc" +.if defined(WITH_SHOWENC) +EXTRA_PATCHES+= ${FILESDIR}/opt-showencoding +.endif + post-patch: @${RM} ${WRKSRC}/doc/screen.info* @${REINPLACE_CMD} -e 's|/dev/ptmx|/nonexistent|' ${WRKSRC}/configure diff -ruN --exclude=CVS sysutils/screen.orig/files/opt-showencoding sysutils/screen/files/opt-showencoding --- sysutils/screen.orig/files/opt-showencoding 1970-01-01 08:00:00.000000000 +0800 +++ sysutils/screen/files/opt-showencoding 2008-06-12 02:25:34.000000000 +0800 @@ -0,0 +1,31 @@ +--- process.c.orig 2008-05-08 02:37:33.000000000 +0800 ++++ process.c 2008-05-08 02:37:49.000000000 +0800 +@@ -3422,6 +3422,7 @@ + { + WinSwitchEncoding(fore, n); + ResetCharsets(fore); ++ RedisplayDisplays(0); + } + else if (i && display) + D_encoding = n; +--- screen.c.orig 2008-05-08 02:37:22.000000000 +0800 ++++ screen.c 2008-05-20 20:34:37.000000000 +0800 +@@ -2584,6 +2584,18 @@ + } + p += strlen(p) - 1; + break; ++#ifdef ENCODINGS ++ case 'e': ++ *p = 0; ++ D_encoding = nwin_options.encoding > 0 ? nwin_options.encoding : 0; ++ if (win && win->w_encoding) ++ { ++ *p++ = ' '; ++ strcpy(p, EncodingName(win->w_encoding)); ++ } ++ p += strlen(p) - 1; ++ break; ++#endif + case '{': + { + char rbuf[128]; --- screen-4.0.3_5.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806111914.m5BJE9Rp073442>