From owner-svn-ports-all@freebsd.org Sat Jun 20 13:39:50 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5476235231D; Sat, 20 Jun 2020 13:39:50 +0000 (UTC) (envelope-from jbeich@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 49pxcQ1dRyz43Mg; Sat, 20 Jun 2020 13:39:50 +0000 (UTC) (envelope-from jbeich@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 33541D052; Sat, 20 Jun 2020 13:39:50 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05KDdonP076797; Sat, 20 Jun 2020 13:39:50 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05KDdnG5076795; Sat, 20 Jun 2020 13:39:49 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <202006201339.05KDdnG5076795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Sat, 20 Jun 2020 13:39:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r539734 - in head/editors/emacs: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in head/editors/emacs: . files X-SVN-Commit-Revision: 539734 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2020 13:39:50 -0000 Author: jbeich Date: Sat Jun 20 13:39:49 2020 New Revision: 539734 URL: https://svnweb.freebsd.org/changeset/ports/539734 Log: editors/emacs: backport 24-bit color fix for tty mode libncurses in base system only supports termcap(5). RGB has 3 colors but termcap(5) supports at most 2 arguments e.g., $ export TERMCAP="${TERM}:Co#0x1000000:AF=\E[38;2;%d;%d;%dm:AB=\E[48;2;%d;%d;%dm:tc=${TERM}:" $ tput AB 1 1 1 tput: too many arguments (3) for capability `AB' To work around the limitation make Emacs check if environ(7) has COLORTERM=truecolor some terminal emulators define by default e.g., - x11-toolkits/vte3 (gnome-terminal, sakura, ...) - x11/alacritty - x11/aminal - x11/kitty (bug 233010) - x11/konsole - x11/qterminal while others require defining COLORTERM=truecolor manually e.g., - x11/cool-retro-term - x11/sterm - x11/xterm PR: 247248 Approved by: jrm Obtained from: upstream Added: head/editors/emacs/files/patch-tty-rgb (contents, props changed) Modified: head/editors/emacs/Makefile (contents, props changed) Modified: head/editors/emacs/Makefile ============================================================================== --- head/editors/emacs/Makefile Sat Jun 20 12:13:25 2020 (r539733) +++ head/editors/emacs/Makefile Sat Jun 20 13:39:49 2020 (r539734) @@ -3,7 +3,7 @@ PORTNAME= emacs DISTVERSION= 26.3 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 3 CATEGORIES= editors MASTER_SITES= GNU Added: head/editors/emacs/files/patch-tty-rgb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/emacs/files/patch-tty-rgb Sat Jun 20 13:39:49 2020 (r539734) @@ -0,0 +1,34 @@ +Add RGB fallback if environment has COLORTERM=truecolor +https://github.com/emacs-mirror/emacs/commit/50f489b5dc59 + +--- doc/misc/efaq.texi.orig 2019-01-07 14:26:06 UTC ++++ doc/misc/efaq.texi +@@ -1603,6 +1603,10 @@ Currently there's no standard way to determine whether + supports direct color mode. If such standard arises later on, support + for @samp{setb24} and @samp{setf24} may be removed. + ++If Terminfo database is not available, but 24-bit direct color mode is ++supported, it can still be enabled by defining the environment ++variable @env{COLORTERM} to @samp{truecolor}. ++ + @node Debugging a customization file + @section How do I debug a @file{.emacs} file? + @cindex Debugging @file{.emacs} file +--- src/term.c.orig 2019-01-07 14:26:07 UTC ++++ src/term.c +@@ -4157,6 +4157,15 @@ use the Bourne shell command 'TERM=...; export TERM' ( + tty->TS_set_background = bg; + tty->TN_max_colors = 16777216; + } ++ /* Fall back to xterm+direct (semicolon version) if requested ++ by the COLORTERM environment variable. */ ++ else if ((bg = getenv("COLORTERM")) != NULL ++ && strcasecmp(bg, "truecolor") == 0) ++ { ++ tty->TS_set_foreground = "\033[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; ++ tty->TS_set_background = "\033[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; ++ tty->TN_max_colors = 16777216; ++ } + } + #endif +